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

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



On Tue, Nov 29, 2011 at 10:41:58AM -0700, Eric Blake wrote:
> 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)

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


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