Earlier commit 714080791778e3dfbd484ccb3953bffd820b8ba9 forgot to deal
properly with status XMLs where we want the libvirt-internal paths to be
kept in place and not cleared, otherwise we could end up copying a NULL
string and segfaulting th daemon.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_domain.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1cd0260c7bbe..14d1e1ba5af1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1256,7 +1256,7 @@ static int
qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
const virDomainDef *def,
virCapsPtr caps ATTRIBUTE_UNUSED,
- unsigned int parseFlags ATTRIBUTE_UNUSED,
+ unsigned int parseFlags,
void *opaque)
{
virQEMUDriverPtr driver = opaque;
@@ -1331,8 +1331,9 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
ARCH_IS_S390(def->os.arch))
dev->data.controller->model =
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
- /* clear auto generated unix socket path */
- if (dev->type == VIR_DOMAIN_DEVICE_CHR &&
+ /* clear auto generated unix socket path for inactive definitions */
+ if ((parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
+ dev->type == VIR_DOMAIN_DEVICE_CHR &&
dev->data.chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
dev->data.chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO
&&
dev->data.chr->source.type == VIR_DOMAIN_CHR_TYPE_UNIX &&
--
2.7.0