mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
Fix some locking issues
* src/conf/domain_conf.c: don't call virDomainObjUnlock twice * src/qemu/qemu_driver.c: relock driver lock if an error occurs in qemuDomainObjBeginJobWithDriver, enter/exit monitor with driver in qemudDomainSave
This commit is contained in:
parent
816d79143b
commit
7a18fbeeb8
@ -5317,7 +5317,6 @@ virDomainObjIsDuplicate(virDomainObjListPtr doms,
|
||||
}
|
||||
|
||||
dupVM = 1;
|
||||
virDomainObjUnlock(vm);
|
||||
} else {
|
||||
/* UUID does not match, but if a name matches, refuse it */
|
||||
vm = virDomainFindByName(doms, def->name);
|
||||
|
@ -229,6 +229,7 @@ static int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
|
||||
else
|
||||
virReportSystemError(NULL, errno,
|
||||
"%s", _("cannot acquire job mutex"));
|
||||
qemuDriverLock(driver);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -3471,9 +3472,9 @@ static int qemudDomainSave(virDomainPtr dom,
|
||||
if (header.compressed == QEMUD_SAVE_FORMAT_RAW) {
|
||||
const char *args[] = { "cat", NULL };
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
qemuDomainObjEnterMonitor(vm);
|
||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||
rc = qemuMonitorMigrateToCommand(priv->mon, 0, args, path);
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
} else {
|
||||
const char *prog = qemudSaveCompressionTypeToString(header.compressed);
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
@ -3482,9 +3483,9 @@ static int qemudDomainSave(virDomainPtr dom,
|
||||
"-c",
|
||||
NULL
|
||||
};
|
||||
qemuDomainObjEnterMonitor(vm);
|
||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||
rc = qemuMonitorMigrateToCommand(priv->mon, 0, args, path);
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
}
|
||||
|
||||
if (rc < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user