[libvirt PATCH] qemu: simplify machine-type check for implicit floppy controller

Ján Tomko posted 1 patch 2 years, 8 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/e3e4c6e31170e6f60f9b678e93324e685c907e8e.1629717316.git.jtomko@redhat.com
src/qemu/qemu_domain.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
[libvirt PATCH] qemu: simplify machine-type check for implicit floppy controller
Posted by Ján Tomko 2 years, 8 months ago
Q35 machine types 2.3 and older had an integrated floppy controller.

Support for these machine types was removed by QEMU commit

  commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe
      q35: Remove old machine versions
  git describe: v2.5.0-1530-g86165b499e contains: v2.6.0-rc0~76^2~4

In libvirt, we have bumped the minimum QEMU version to 2.11:

  commit b4cbdbe90bbf85eaf687f532d5a52a11e664b781
    qemu: Formally deprecate support for qemu < 2.11
  git describe: v7.3.0-13-gb4cbdbe90b contains: v7.4.0-rc1~300

Since this QEMU version only supports Q35 machine versions 2.4+,
remove the code dealing with older ones.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_domain.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9baa4b5d90..50a921c80d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8823,22 +8823,12 @@ static bool
 qemuDomainMachineNeedsFDC(const char *machine,
                           const virArch arch)
 {
-    const char *p = STRSKIP(machine, "pc-q35-");
-
     if (!ARCH_IS_X86(arch))
         return false;
 
-    if (!p)
+    if (!STRPREFIX(machine, "pc-q35-"))
         return false;
 
-    if (STRPREFIX(p, "1.") ||
-        STREQ(p, "2.0") ||
-        STREQ(p, "2.1") ||
-        STREQ(p, "2.2") ||
-        STREQ(p, "2.3")) {
-        return false;
-    }
-
     return true;
 }
 
-- 
2.31.1

Re: [libvirt PATCH] qemu: simplify machine-type check for implicit floppy controller
Posted by Martin Kletzander 2 years, 8 months ago
On Mon, Aug 23, 2021 at 01:15:34PM +0200, Ján Tomko wrote:
>Q35 machine types 2.3 and older had an integrated floppy controller.
>
>Support for these machine types was removed by QEMU commit
>
>  commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe
>      q35: Remove old machine versions
>  git describe: v2.5.0-1530-g86165b499e contains: v2.6.0-rc0~76^2~4
>
>In libvirt, we have bumped the minimum QEMU version to 2.11:
>
>  commit b4cbdbe90bbf85eaf687f532d5a52a11e664b781
>    qemu: Formally deprecate support for qemu < 2.11
>  git describe: v7.3.0-13-gb4cbdbe90b contains: v7.4.0-rc1~300
>
>Since this QEMU version only supports Q35 machine versions 2.4+,
>remove the code dealing with older ones.
>
>Signed-off-by: Ján Tomko <jtomko@redhat.com>

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>