On Tue, Jul 17, 2018 at 02:14:28PM +0200, Peter Krempa wrote:
Similarly to qemuDomainDiskRemoveManagedPR make it enter monitor on
it's own so that it can be reused. Future users will be in the snapshot
its
code and in removable media change code.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 55 ++++++++++++++++++++++++++-----------------------
1 file changed, 29 insertions(+), 26 deletions(-)
@@ -619,11 +628,10 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr
driver,
if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks + 1) < 0)
goto error;
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuHotplugAttachManagedPR(driver, vm, disk->src, QEMU_ASYNC_JOB_NONE) <
0)
+ goto error;
- if (managedPrmgrProps &&
- qemuMonitorAddObject(priv->mon, &managedPrmgrProps,
&managedPrmgrAlias) < 0)
Both variables are unused after this change.
- goto exit_monitor;
+ qemuDomainObjEnterMonitor(driver, vm);
if (qemuHotplugDiskSoureceAttach(priv->mon, diskdata) < 0)
goto exit_monitor;
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano