[libvirt] [PATCH] Drop needless virtType validation

Cole Robinson posted 1 patch 5 years, 1 month ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/7f55992124317d35929f20f99985da6b5d445524.1552852963.git.crobinso@redhat.com
src/lxc/lxc_driver.c   |  7 -------
src/qemu/qemu_driver.c | 14 --------------
2 files changed, 21 deletions(-)
[libvirt] [PATCH] Drop needless virtType validation
Posted by Cole Robinson 5 years, 1 month ago
This code originates from:

commit d0aa10fdd6c108ad442886e4451b2629a3dc8b86
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Tue Mar 3 12:03:44 2009 +0000

    QEMU security driver usage for sVirt support (James Morris, Dan Walsh, Daniel Berrange)

Originally in the qemudDomainGetSecurityLabel function. It doesn't
appear to have done anything useful back then either. The other two
instances look like copy+paste

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 src/lxc/lxc_driver.c   |  7 -------
 src/qemu/qemu_driver.c | 14 --------------
 2 files changed, 21 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 760f9f8bdf..e981f8e901 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1268,13 +1268,6 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla
     if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;
 
-    if (!virDomainVirtTypeToString(vm->def->virtType)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unknown virt type in domain definition '%d'"),
-                       vm->def->virtType);
-        goto cleanup;
-    }
-
     /*
      * Theoretically, the pid can be replaced during this operation and
      * return the label of a different process.  If atomicity is needed,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3615270650..a16eab5467 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6445,13 +6445,6 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl
     if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;
 
-    if (!virDomainVirtTypeToString(vm->def->virtType)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unknown virt type in domain definition '%d'"),
-                       vm->def->virtType);
-        goto cleanup;
-    }
-
     /*
      * Theoretically, the pid can be replaced during this operation and
      * return the label of a different process.  If atomicity is needed,
@@ -6493,13 +6486,6 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom,
     if (virDomainGetSecurityLabelListEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;
 
-    if (!virDomainVirtTypeToString(vm->def->virtType)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unknown virt type in domain definition '%d'"),
-                       vm->def->virtType);
-        goto cleanup;
-    }
-
     /*
      * Check the comment in qemuDomainGetSecurityLabel function.
      */
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Drop needless virtType validation
Posted by Ján Tomko 5 years, 1 month ago
On Sun, Mar 17, 2019 at 04:02:43PM -0400, Cole Robinson wrote:
>This code originates from:
>
>commit d0aa10fdd6c108ad442886e4451b2629a3dc8b86
>Author: Daniel P. Berrange <berrange@redhat.com>
>Date:   Tue Mar 3 12:03:44 2009 +0000
>
>    QEMU security driver usage for sVirt support (James Morris, Dan Walsh, Daniel Berrange)
>
>Originally in the qemudDomainGetSecurityLabel function. It doesn't
>appear to have done anything useful back then either. The other two
>instances look like copy+paste
>
>Signed-off-by: Cole Robinson <crobinso@redhat.com>
>---
> src/lxc/lxc_driver.c   |  7 -------
> src/qemu/qemu_driver.c | 14 --------------
> 2 files changed, 21 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list