]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Replace @dom argument with @driver in qemuDomainUpdateDeviceLive()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Apr 2023 15:29:57 +0000 (17:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 25 Apr 2023 06:46:27 +0000 (08:46 +0200)
The qemuDomainUpdateDeviceLive() accepts virDomainPtr as one of
its arguments, but use it only to get QEMU driver out of it.
Well, the only caller already does that and thus can pass it
instead of virDomainPtr.

This also makes it look like the rest of device hot(un-)plug
functions: qemuDomainAttachDeviceLive() and
qemuDomainUpdateDeviceLive().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
src/qemu/qemu_driver.c

index 523a83682ceb5dea7ebdbb208bb34195b46d7017..48eb759531681f27e6ed250156657470a11652fa 100644 (file)
@@ -7070,10 +7070,9 @@ qemuDomainChangeMemoryLive(virQEMUDriver *driver G_GNUC_UNUSED,
 static int
 qemuDomainUpdateDeviceLive(virDomainObj *vm,
                            virDomainDeviceDef *dev,
-                           virDomainPtr dom,
+                           virQEMUDriver *driver,
                            bool force)
 {
-    virQEMUDriver *driver = dom->conn->privateData;
     virDomainDeviceDef oldDev = { .type = dev->type };
     int idx;
 
@@ -7939,7 +7938,7 @@ qemuDomainUpdateDeviceFlags(virDomainPtr dom,
     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
         /* virDomainDefCompatibleDevice call is delayed until we know the
          * device we're going to update. */
-        if ((ret = qemuDomainUpdateDeviceLive(vm, dev_live, dom, force)) < 0)
+        if ((ret = qemuDomainUpdateDeviceLive(vm, dev_live, driver, force)) < 0)
             goto endjob;
 
         qemuDomainSaveStatus(vm);