mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu_migration: Use EnterMonitorAsync in qemuDomainGetMigrationBlockers
The code is run with an async job and thus needs to make sure a nested job is acquired before entering the monitor. While touching the code in qemuMigrationSrcIsAllowed I also fixed the grammar which was accidentally broken by v8.5.0-140-g2103807e33. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
356669955a
commit
6262752460
@ -1418,12 +1418,15 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
|
||||
static int
|
||||
qemuDomainGetMigrationBlockers(virQEMUDriver *driver,
|
||||
virDomainObj *vm,
|
||||
int asyncJob,
|
||||
char ***blockers)
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
int rc;
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||
return -1;
|
||||
|
||||
rc = qemuMonitorGetMigrationBlockers(priv->mon, blockers);
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
|
||||
@ -1458,10 +1461,12 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver,
|
||||
bool blockedReasonsCap = virQEMUCapsGet(priv->qemuCaps,
|
||||
QEMU_CAPS_MIGRATION_BLOCKED_REASONS);
|
||||
|
||||
/* Ask qemu if it have a migration blocker */
|
||||
/* Ask qemu if it has a migration blocker */
|
||||
if (blockedReasonsCap) {
|
||||
g_auto(GStrv) blockers = NULL;
|
||||
if (qemuDomainGetMigrationBlockers(driver, vm, &blockers) < 0)
|
||||
if (qemuDomainGetMigrationBlockers(driver, vm,
|
||||
VIR_ASYNC_JOB_MIGRATION_OUT,
|
||||
&blockers) < 0)
|
||||
return false;
|
||||
|
||||
if (blockers && blockers[0]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user