[libvirt] [PATCH 2/2] qemuDomainUSBAddressAddHubs: use numeric comparison

Ján Tomko jtomko at redhat.com
Tue Mar 13 09:45:31 UTC 2018


Since data.count is not a pointer, but an integer,
compare it against an integer value instead of using
the implicit "boolean" conversion that is customarily
used for pointers.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/qemu/qemu_domain_address.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 3fcb36add..5f4e8edd2 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2701,7 +2701,7 @@ qemuDomainUSBAddressAddHubs(virDomainDefPtr def)
                                               &data,
                                               false));
 
-    if (data.count && !virDomainDefHasUSB(def)) {
+    if (data.count > 0 && !virDomainDefHasUSB(def)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("USB is disabled for this domain, but USB devices "
                          "are present in the domain XML"));
-- 
2.13.6




More information about the libvir-list mailing list