libvirt/libvirt-0.6.1-vcpu-deadlock.patch
Daniel P. Berrange 511f6cd625 - Fix memory allocation for xend lookup
- Avoid crash if storage volume deletion fails
- Fix multiple FD leaks
- Fix bug in dispatch FD events when a callback is marked deleted
- Fix parsing of storage volume owner/group/mode
- Fix memory allocation for virDomainGetVcpus RPC handler
- Avoid deadlock in setting vCPU count
- Use correct driver name in Xen block detach
2009-03-17 10:29:42 +00:00

37 lines
1.4 KiB
Diff

From: Daniel P. Berrange <berrange@redhat.com>
Date: Mon, 16 Mar 2009 11:44:46 +0000 (+0000)
Subject: Avoid deadlock setting vcpus in QEMU driver
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=4d7ecd146ce4de847256ae0887963719f214f62f
Avoid deadlock setting vcpus in QEMU driver
---
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index dad7098..51442d6 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2725,6 +2725,7 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
virDomainObjPtr vm;
int max;
int ret = -1;
+ const char *type;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -2745,7 +2746,14 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
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",
_("could not determine max vcpus for the domain"));
goto cleanup;