[libvirt] [PATCH 6/6] qemu: domain: Fix machine type version check for 'isa-fdc' usage
Ján Tomko
jtomko at redhat.com
Thu Aug 9 14:17:33 UTC 2018
On Thu, Aug 09, 2018 at 02:48:59PM +0200, Peter Krempa wrote:
>Starting from pc-q35-2.4 the floppy controller is not enabled by
>default. Fix the version check so that it does not match 2.11 as being
>2.1.
>
O:-)
Thanks.
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_domain.c | 12 ++++++++----
> .../qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args | 4 +---
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
>diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
>index a5d81f863b..654cd4b872 100644
>--- a/src/qemu/qemu_domain.c
>+++ b/src/qemu/qemu_domain.c
>@@ -9427,10 +9427,14 @@ qemuDomainMachineNeedsFDC(const char *machine)
>
> if (p) {
> if (STRPREFIX(p, "1.") ||
>- STRPREFIX(p, "2.0") ||
>- STRPREFIX(p, "2.1") ||
>- STRPREFIX(p, "2.2") ||
>- STRPREFIX(p, "2.3"))
>+ STREQ(p, "2.0") ||
>+ STRPREFIX(p, "2.0-") ||
>+ STREQ(p, "2.1") ||
>+ STRPREFIX(p, "2.1-") ||
>+ STREQ(p, "2.2") ||
>+ STRPREFIX(p, "2.2-") ||
>+ STREQ(p, "2.3") ||
>+ STRPREFIX(p, "2.3-"))
I think STREQs are just enough here - unless you know of any downstreams
adding something after the QEMU version after a dash.
Reviewed-by: Ján Tomko <jtomko at redhat.com>
Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180809/202ac055/attachment-0001.sig>
More information about the libvir-list
mailing list