From 244ebb8f2bb6628937fd96cbf0835706e0cfb55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 21 Oct 2016 14:18:54 +0200 Subject: [PATCH] Do not try to release virtio serial addresses Return 0 instead of 1, so that qemuDomainAttachChrDevice does not assume the address neeeds to be released on error. No functional change, since qemuDomainReleaseDeviceAddress has been a noop for virtio serial addresses since the address cache was removed in commit 19a148b. --- src/qemu/qemu_hotplug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0f59468587..f60cf860f5 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1756,6 +1756,10 @@ qemuDomainChrRemove(virDomainDefPtr vmdef, return ret; } +/* Returns 1 if the address will need to be released later, + * -1 on error + * 0 otherwise + */ static int qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm, virDomainChrDefPtr chr) @@ -1767,7 +1771,7 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm, chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) { if (virDomainVirtioSerialAddrAutoAssign(def, &chr->info, true) < 0) return -1; - return 1; + return 0; } else if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI) { @@ -1786,7 +1790,7 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm, chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) { if (virDomainVirtioSerialAddrAutoAssign(def, &chr->info, false) < 0) return -1; - return 1; + return 0; } if (chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL || -- GitLab