mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
Avoid deadlock setting vcpus in QEMU driver
This commit is contained in:
parent
35625e5aa8
commit
8fa62166c4
@ -1,3 +1,8 @@
|
|||||||
|
Mon Mar 16 11:44:00 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/qemu_driver.c: Avoid deadlock in virDomainSetVcpus
|
||||||
|
driver impl
|
||||||
|
|
||||||
Mon Mar 16 10:55:00 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
Mon Mar 16 10:55:00 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
Fix subsystem lookup for older HAL releases
|
Fix subsystem lookup for older HAL releases
|
||||||
|
@ -2725,6 +2725,7 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
|
|||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
int max;
|
int max;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
const char *type;
|
||||||
|
|
||||||
qemuDriverLock(driver);
|
qemuDriverLock(driver);
|
||||||
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
||||||
@ -2745,7 +2746,14 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((max = qemudDomainGetMaxVcpus(dom)) < 0) {
|
if (!(type = virDomainVirtTypeToString(vm->def->virtType))) {
|
||||||
|
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("unknown virt type in domain definition '%d'"),
|
||||||
|
vm->def->virtType);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((max = qemudGetMaxVCPUs(dom->conn, type)) < 0) {
|
||||||
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("could not determine max vcpus for the domain"));
|
_("could not determine max vcpus for the domain"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user