[libvirt] [PATCH v2 0/2] qemu: xml->native memballoon fixes
v1: https://www.redhat.com/archives/libvir-list/2013-April/msg01910.html v2: Instead of assuming 'pci' as the default memballoon device, assign the addresses when doing xml->native conversion and add an error message for the wrong address type. Ján Tomko (2): qemu: assign addresses when converting xml to native qemu: report an error if memballoon has wrong address type src/qemu/qemu_command.c | 3 +++ src/qemu/qemu_driver.c | 3 +++ 2 files changed, 6 insertions(+) -- 1.8.1.5
This adds addresses to domxml-to-native output and chooses the correct virtio devices for ccw and s390 machines. https://bugzilla.redhat.com/show_bug.cgi?id=957077 --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2d3b24a..296efe3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5271,6 +5271,9 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, if (qemuAssignDeviceAliases(def, qemuCaps) < 0) goto cleanup; + if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0) + goto cleanup; + if (!(cmd = qemuBuildCommandLine(conn, driver, def, &monConfig, monitor_json, qemuCaps, NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP))) -- 1.8.1.5
On 04/29/2013 12:20 PM, Ján Tomko wrote:
This adds addresses to domxml-to-native output and chooses the correct virtio devices for ccw and s390 machines.
https://bugzilla.redhat.com/show_bug.cgi?id=957077 --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+)
ACK.
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2d3b24a..296efe3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5271,6 +5271,9 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, if (qemuAssignDeviceAliases(def, qemuCaps) < 0) goto cleanup;
+ if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0) + goto cleanup; + if (!(cmd = qemuBuildCommandLine(conn, driver, def, &monConfig, monitor_json, qemuCaps, NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP)))
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
qemuBuildMemballoonDevStr returns NULL if memballoon doesn't have the right address type, but it doesn't report an error, leading to: error: An error occurred, but the cause is unknown Report a helpful error message instead, e.g.: error: XML error: memballoon unsupported with address type 'usb' --- src/qemu/qemu_command.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d161b56..3184e5b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4175,6 +4175,9 @@ qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev, virBufferAddLit(&buf, "virtio-balloon-ccw"); break; default: + virReportError(VIR_ERR_XML_ERROR, + _("memballoon unsupported with address type '%s'"), + virDomainDeviceAddressTypeToString(dev->info.type)); goto error; } -- 1.8.1.5
On 04/29/2013 12:20 PM, Ján Tomko wrote:
qemuBuildMemballoonDevStr returns NULL if memballoon doesn't have the right address type, but it doesn't report an error, leading to: error: An error occurred, but the cause is unknown
Report a helpful error message instead, e.g.: error: XML error: memballoon unsupported with address type 'usb' --- src/qemu/qemu_command.c | 3 +++ 1 file changed, 3 insertions(+)
ACK. Both worth including in 1.0.5
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d161b56..3184e5b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4175,6 +4175,9 @@ qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev, virBufferAddLit(&buf, "virtio-balloon-ccw"); break; default: + virReportError(VIR_ERR_XML_ERROR, + _("memballoon unsupported with address type '%s'"), + virDomainDeviceAddressTypeToString(dev->info.type)); goto error; }
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
On 04/30/2013 12:14 AM, Eric Blake wrote:
On 04/29/2013 12:20 PM, Ján Tomko wrote:
qemuBuildMemballoonDevStr returns NULL if memballoon doesn't have the right address type, but it doesn't report an error, leading to: error: An error occurred, but the cause is unknown
Report a helpful error message instead, e.g.: error: XML error: memballoon unsupported with address type 'usb' --- src/qemu/qemu_command.c | 3 +++ 1 file changed, 3 insertions(+)
ACK. Both worth including in 1.0.5
Thanks, both pushed now. Jan
participants (2)
-
Eric Blake -
Ján Tomko