]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainUSBAddressAddHubs: use numeric comparison
authorJán Tomko <jtomko@redhat.com>
Tue, 13 Mar 2018 09:38:48 +0000 (10:38 +0100)
committerJán Tomko <jtomko@redhat.com>
Tue, 13 Mar 2018 09:38:48 +0000 (10:38 +0100)
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@redhat.com>
src/qemu/qemu_domain_address.c

index 3fcb36add4e8585159214af25222dbc61558f0a7..5f4e8edd2c2b97ce3371147e368b6edf9ba104bd 100644 (file)
@@ -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"));