[libvirt] [PATCH] Fix a logic error for setting block I/O
Eric Blake
eblake at redhat.com
Thu Dec 1 14:59:45 UTC 2011
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 at linux.vnet.ibm.com>
> ---
> 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 at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111201/011fbdc8/attachment-0001.sig>
More information about the libvir-list
mailing list