Re: [PATCH] Fix a logic error for setting block I/O

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

 



On 12/01/2011 12:55 AM, Lei Li wrote:
> Fix a logic error, the initial value of ret = -1, if just set --config,
> it will goto endjob directly without doing its really job here.
> 
> 
> Signed-off-by: Lei Li <lilei@xxxxxxxxxxxxxxxxxx>
> ---
>  src/qemu/qemu_driver.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index ed90c66..8ea6f48 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -11234,8 +11234,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
>          ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info);
>          qemuDomainObjExitMonitorWithDriver(driver, vm);
>      }
> -    if (ret < 0)
> -        goto endjob;

Not quite right - we don't want to affect config if live failed.
Rather, move the } to be after the (ret < 0) check.

ACK with this squashed in, and pushed.


diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index 8ea6f48..1e5ed9a 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -11233,6 +11233,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         qemuDomainObjEnterMonitorWithDriver(driver, vm);
         ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info);
         qemuDomainObjExitMonitorWithDriver(driver, vm);
+        if (ret < 0)
+            goto endjob;
     }

     if (flags & VIR_DOMAIN_AFFECT_CONFIG) {

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]