[libvirt] [PATCH v2 08/12] qemuDomainDetachDeviceLiveAndConfig: Don't use driver->caps directly

Michal Privoznik posted 12 patches 6 years, 11 months ago
[libvirt] [PATCH v2 08/12] qemuDomainDetachDeviceLiveAndConfig: Don't use driver->caps directly
Posted by Michal Privoznik 6 years, 11 months ago
Funny, we obtain driver caps at the beginning of the function,
but then for unknown reason access driver->caps directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3a328e5d46..992f140b2b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8723,7 +8723,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
          * changed even if we failed to attach the device. For example,
          * a new controller may be created.
          */
-        if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
+        if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, caps) < 0) {
             ret = -1;
             goto cleanup;
         }
@@ -8731,7 +8731,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
 
     /* Finally, if no error until here, we can save config. */
     if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
-        ret = virDomainSaveConfig(cfg->configDir, driver->caps, vmdef);
+        ret = virDomainSaveConfig(cfg->configDir, caps, vmdef);
         if (!ret) {
             virDomainObjAssignDef(vm, vmdef, false, NULL);
             vmdef = NULL;
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 08/12] qemuDomainDetachDeviceLiveAndConfig: Don't use driver->caps directly
Posted by Ján Tomko 6 years, 11 months ago
On Thu, May 24, 2018 at 01:13:35PM +0200, Michal Privoznik wrote:
>Funny, we obtain driver caps at the beginning of the function,
>but then for unknown reason access driver->caps directly.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> src/qemu/qemu_driver.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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