mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
Fix autodestroy of QEMU guests
The virQEMUCloseCallbacksRunOne method was passing a uuid string
to virDomainObjListFindByUUID, when it actually expected to get
a raw uuid buffer. This was not caught by the compiler because
the method was using a 'void *uuid' instead of first casting
it to the expected type.
This regression was accidentally caused by refactoring in
commit 568a6cda27
Author: Jiri Denemark <jdenemar@redhat.com>
Date: Fri Feb 15 15:11:47 2013 +0100
qemu: Avoid deadlock in autodestroy
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
25dc8ba08b
commit
b4a124efc3
@ -805,22 +805,26 @@ struct virQEMUCloseCallbacksData {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
virQEMUCloseCallbacksRunOne(void *payload,
|
virQEMUCloseCallbacksRunOne(void *payload,
|
||||||
const void *uuid,
|
const void *key,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
struct virQEMUCloseCallbacksData *data = opaque;
|
struct virQEMUCloseCallbacksData *data = opaque;
|
||||||
qemuDriverCloseDefPtr closeDef = payload;
|
qemuDriverCloseDefPtr closeDef = payload;
|
||||||
virDomainObjPtr dom;
|
virDomainObjPtr dom;
|
||||||
|
const char *uuidstr = key;
|
||||||
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
|
|
||||||
|
if (virUUIDParse(uuidstr, uuid) < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
VIR_DEBUG("conn=%p, thisconn=%p, uuid=%s, cb=%p",
|
VIR_DEBUG("conn=%p, thisconn=%p, uuid=%s, cb=%p",
|
||||||
closeDef->conn, data->conn, (const char *) uuid, closeDef->cb);
|
closeDef->conn, data->conn, uuidstr, closeDef->cb);
|
||||||
|
|
||||||
if (data->conn != closeDef->conn || !closeDef->cb)
|
if (data->conn != closeDef->conn || !closeDef->cb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(dom = virDomainObjListFindByUUID(data->driver->domains, uuid))) {
|
if (!(dom = virDomainObjListFindByUUID(data->driver->domains, uuid))) {
|
||||||
VIR_DEBUG("No domain object with UUID %s",
|
VIR_DEBUG("No domain object with UUID %s", uuidstr);
|
||||||
(const char *) uuid);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user