From: Lei Li Date: Thu, 1 Dec 2011 07:55:26 +0000 (+0800) Subject: Fix a logic error for setting block I/O X-Git-Tag: v0.9.8-rc2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac6b368d8a56caf9e986f7a882fad54f210d258f;p=thirdparty%2Flibvirt.git Fix a logic error for setting block I/O 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ed90c66d37..1e5ed9a986 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11233,9 +11233,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, qemuDomainObjEnterMonitorWithDriver(driver, vm); ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info); qemuDomainObjExitMonitorWithDriver(driver, vm); + if (ret < 0) + goto endjob; } - if (ret < 0) - goto endjob; if (flags & VIR_DOMAIN_AFFECT_CONFIG) { sa_assert(persistentDef && idx >= 0);