[PATCH 1.5/4] qemu, lxc: drop redundant checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After the previous patch, there are now some redundant checks.

* src/qemu/qemu_driver.c (qemudDomainGetVcpuPinInfo)
(qemuGetSchedulerParametersFlags): Drop checks now guaranteed by
libvirt.c.
* src/lxc/lxc_driver.c (lxcGetSchedulerParametersFlags):
Likewise.
---

>> Drivers were inconsistent when presented both --live and --config
>> at once.

>> * src/libvirt.c (virDomainGetMemoryParameters)
>> (virDomainGetBlkioParameters)
>> (virDomainGetSchedulerParametersFlags, virDomainGetVcpuPinInfo):
>> Borrow sanity checking from virDomainGetVcpusFlags.

> ACK

I'm now pushing 1/4, but in the process of my final pre-push review,
I noticed that this would be a worthwhile followup patch.

 src/lxc/lxc_driver.c   |    7 -------
 src/qemu/qemu_driver.c |   14 --------------
 2 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index c02fe70..8bd1501 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2959,13 +2959,6 @@ lxcGetSchedulerParametersFlags(virDomainPtr dom,

     lxcDriverLock(driver);

-    if ((flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) ==
-        (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) {
-        lxcError(VIR_ERR_INVALID_ARG, "%s",
-                 _("cannot query live and config together"));
-        goto cleanup;
-    }
-
     if (*nparams > 1) {
         rc = lxcGetCpuBWStatus(driver->cgroup);
         if (rc < 0)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3be97f3..307cc37 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3574,13 +3574,6 @@ qemudDomainGetVcpuPinInfo(virDomainPtr dom,
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG, -1);

-    if ((flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) ==
-        (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) {
-        qemuReportError(VIR_ERR_INVALID_ARG, "%s",
-                        _("cannot get live and persistent info concurrently"));
-        goto cleanup;
-    }
-
     qemuDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
     qemuDriverUnlock(driver);
@@ -6902,13 +6895,6 @@ qemuGetSchedulerParametersFlags(virDomainPtr dom,
     /* We don't return strings, and thus trivially support this flag.  */
     flags &= ~VIR_TYPED_PARAM_STRING_OKAY;

-    if ((flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) ==
-        (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) {
-        qemuReportError(VIR_ERR_INVALID_ARG, "%s",
-                        _("cannot query live and config together"));
-        goto cleanup;
-    }
-
     if (*nparams > 1) {
         rc = qemuGetCpuBWStatus(driver->cgroup);
         if (rc < 0)
-- 
1.7.7.3

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]