]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainNamespaceTeardownHostdev: Drop useless check
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 6 Sep 2018 16:14:55 +0000 (18:14 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 7 Sep 2018 05:11:16 +0000 (07:11 +0200)
There is no need to check if @npaths is not zero. Let's
qemuDomainNamespaceUnlinkPaths() handle that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_domain.c

index 05e90c36156b3088bc737924042038682d6692d1..5329899b137300938f6e6f2f8bbf182d03aabcb5 100644 (file)
@@ -12476,7 +12476,8 @@ qemuDomainNamespaceUnlinkPaths(virDomainObjPtr vm,
     size_t i;
     int ret = -1;
 
-    if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
+    if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) ||
+        !npaths)
         return 0;
 
     cfg = virQEMUDriverGetConfig(driver);
@@ -12606,8 +12607,7 @@ qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm,
                                  &npaths, &paths, NULL) < 0)
         goto cleanup;
 
-    if (npaths != 0 &&
-        qemuDomainNamespaceUnlinkPaths(vm, (const char **)paths, npaths) < 0)
+    if (qemuDomainNamespaceUnlinkPaths(vm, (const char **)paths, npaths) < 0)
         goto cleanup;
 
     ret = 0;