提交 2a994a3b 编写于 作者: M Michael Ellerman 提交者: Eric Blake

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: NMichael Ellerman <michael@ellerman.id.au>
上级 e1636f47
...@@ -4586,7 +4586,8 @@ qemuBuildCommandLine(virConnectPtr conn, ...@@ -4586,7 +4586,8 @@ qemuBuildCommandLine(virConnectPtr conn,
VIR_FREE(devstr); VIR_FREE(devstr);
virCommandAddArg(cmd, "-device"); virCommandAddArg(cmd, "-device");
if (!(devstr = qemuBuildChrDeviceStr(serial, def->os.arch, if (!(devstr = qemuBuildChrDeviceStr(serial, qemuCaps,
def->os.arch,
def->os.machine))) def->os.machine)))
goto error; goto error;
virCommandAddArg(cmd, devstr); virCommandAddArg(cmd, devstr);
...@@ -5482,15 +5483,18 @@ qemuBuildCommandLine(virConnectPtr conn, ...@@ -5482,15 +5483,18 @@ qemuBuildCommandLine(virConnectPtr conn,
*/ */
char * char *
qemuBuildChrDeviceStr(virDomainChrDefPtr serial, qemuBuildChrDeviceStr(virDomainChrDefPtr serial,
virBitmapPtr qemuCaps,
char *os_arch, char *os_arch,
char *machine) char *machine)
{ {
virBuffer cmd = VIR_BUFFER_INITIALIZER; 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", virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s",
serial->info.alias); serial->info.alias);
else if (qemuBuildDeviceAddressStr(&cmd, &serial->info, qemuCaps) < 0)
goto error;
} else
virBufferAsprintf(&cmd, "isa-serial,chardev=char%s,id=%s", virBufferAsprintf(&cmd, "isa-serial,chardev=char%s,id=%s",
serial->info.alias, serial->info.alias); serial->info.alias, serial->info.alias);
......
...@@ -56,6 +56,7 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn, ...@@ -56,6 +56,7 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
/* Generate string for arch-specific '-device' parameter */ /* Generate string for arch-specific '-device' parameter */
char * char *
qemuBuildChrDeviceStr (virDomainChrDefPtr serial, qemuBuildChrDeviceStr (virDomainChrDefPtr serial,
virBitmapPtr qemuCaps,
char *os_arch, char *os_arch,
char *machine); char *machine);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册