From 2a994a3b1e0a0e505e18306b1d850c17e70f0f89 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Thu, 8 Dec 2011 17:41:25 +1100 Subject: [PATCH] qemu: Add address in qemuBuildChrDeviceStr() on pseries For the PPC64 pseries machine type we need to add address information for the spapr-vty device. Signed-off-by: Michael Ellerman --- src/qemu/qemu_command.c | 10 +++++++--- src/qemu/qemu_command.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cc8dc9b354..14bcd9d909 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4586,7 +4586,8 @@ qemuBuildCommandLine(virConnectPtr conn, VIR_FREE(devstr); virCommandAddArg(cmd, "-device"); - if (!(devstr = qemuBuildChrDeviceStr(serial, def->os.arch, + if (!(devstr = qemuBuildChrDeviceStr(serial, qemuCaps, + def->os.arch, def->os.machine))) goto error; virCommandAddArg(cmd, devstr); @@ -5482,15 +5483,18 @@ qemuBuildCommandLine(virConnectPtr conn, */ char * qemuBuildChrDeviceStr(virDomainChrDefPtr serial, + virBitmapPtr qemuCaps, char *os_arch, char *machine) { virBuffer cmd = VIR_BUFFER_INITIALIZER; - if (STREQ(os_arch, "ppc64") && STREQ(machine, "pseries")) + if (STREQ(os_arch, "ppc64") && STREQ(machine, "pseries")) { virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", serial->info.alias); - else + if (qemuBuildDeviceAddressStr(&cmd, &serial->info, qemuCaps) < 0) + goto error; + } else virBufferAsprintf(&cmd, "isa-serial,chardev=char%s,id=%s", serial->info.alias, serial->info.alias); diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 3978b2b361..c76f83ac1c 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -56,6 +56,7 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn, /* Generate string for arch-specific '-device' parameter */ char * qemuBuildChrDeviceStr (virDomainChrDefPtr serial, + virBitmapPtr qemuCaps, char *os_arch, char *machine);