mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
qemu: Start nested job in qemuDomainCheckEjectableMedia
Originally, qemuDomainCheckEjectableMedia was entering monitor with qemu
driver lock. Commit 2067e31bf9
, which I
made to fix that, revealed another issue we had (but didn't notice it
since the driver was locked): we didn't set nested job when
qemuDomainCheckEjectableMedia is called during migration. Thus the
original fix I made was wrong.
This commit is contained in:
parent
11ec6bd891
commit
66cab01ae1
@ -8816,6 +8816,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
struct qemud_driver *driver = domain->conn->privateData;
|
struct qemud_driver *driver = domain->conn->privateData;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
char *xml = NULL;
|
char *xml = NULL;
|
||||||
|
enum qemuDomainAsyncJob asyncJob;
|
||||||
|
|
||||||
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
|
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
|
||||||
|
|
||||||
@ -8832,9 +8833,11 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
if ((flags & VIR_MIGRATE_CHANGE_PROTECTION)) {
|
if ((flags & VIR_MIGRATE_CHANGE_PROTECTION)) {
|
||||||
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
|
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
asyncJob = QEMU_ASYNC_JOB_MIGRATION_OUT;
|
||||||
} else {
|
} else {
|
||||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
asyncJob = QEMU_ASYNC_JOB_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
@ -8847,7 +8850,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
|||||||
* We don't want to require them on the destination.
|
* We don't want to require them on the destination.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (qemuDomainCheckEjectableMedia(driver, vm) < 0)
|
if (qemuDomainCheckEjectableMedia(driver, vm, asyncJob) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (!(xml = qemuMigrationBegin(driver, vm, xmlin, dname,
|
if (!(xml = qemuMigrationBegin(driver, vm, xmlin, dname,
|
||||||
|
@ -155,16 +155,18 @@ error:
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
|
qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
|
||||||
virDomainObjPtr vm)
|
virDomainObjPtr vm,
|
||||||
|
enum qemuDomainAsyncJob asyncJob)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
virHashTablePtr table;
|
virHashTablePtr table = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
|
||||||
table = qemuMonitorGetBlockInfo(priv->mon);
|
table = qemuMonitorGetBlockInfo(priv->mon);
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
}
|
||||||
|
|
||||||
if (!table)
|
if (!table)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
# define __QEMU_HOTPLUG_H__
|
# define __QEMU_HOTPLUG_H__
|
||||||
|
|
||||||
# include "qemu_conf.h"
|
# include "qemu_conf.h"
|
||||||
|
# include "qemu_domain.h"
|
||||||
# include "domain_conf.h"
|
# include "domain_conf.h"
|
||||||
|
|
||||||
int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
|
int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
|
||||||
@ -32,7 +33,8 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
|
|||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
bool force);
|
bool force);
|
||||||
int qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
|
int qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
|
||||||
virDomainObjPtr vm);
|
virDomainObjPtr vm,
|
||||||
|
enum qemuDomainAsyncJob asyncJob);
|
||||||
int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
|
int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
|
||||||
struct qemud_driver *driver,
|
struct qemud_driver *driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
@ -3106,7 +3106,7 @@ qemuProcessReconnect(void *opaque)
|
|||||||
if (qemuProcessFiltersInstantiate(conn, obj->def))
|
if (qemuProcessFiltersInstantiate(conn, obj->def))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (qemuDomainCheckEjectableMedia(driver, obj) < 0)
|
if (qemuDomainCheckEjectableMedia(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (qemuProcessRecoverJob(driver, obj, conn, &oldjob) < 0)
|
if (qemuProcessRecoverJob(driver, obj, conn, &oldjob) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user