qemu: hotplug: consolidate media change code paths

Use qemuDomainAttachDeviceDiskLive to change the media in
qemuDomainChangeDiskLive as the former function already does all the
necessary steps to prepare the new medium.

This also allows us to turn qemuDomainChangeEjectableMedia static.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa
2018-08-13 14:05:12 +02:00
parent 8b5c8ecc0b
commit 663b1d55de
4 changed files with 20 additions and 29 deletions

View File

@@ -120,7 +120,7 @@ testQemuHotplugAttach(virDomainObjPtr vm,
/* conn in only used for storage pool and secrets lookup so as long
* as we don't use any of them, passing NULL should be safe
*/
ret = qemuDomainAttachDeviceDiskLive(&driver, vm, dev);
ret = qemuDomainAttachDeviceDiskLive(&driver, vm, dev, false);
break;
case VIR_DOMAIN_DEVICE_CHR:
ret = qemuDomainAttachChrDevice(&driver, vm, dev->data.chr);