[libvirt] [PATCH 06/13] qemu: Generate and use zPCI device in QEMU command line

Ján Tomko jtomko at redhat.com
Sat Jun 2 14:22:58 UTC 2018


On Thu, May 24, 2018 at 02:24:31PM +0200, Xiao Feng Ren wrote:
>From: Yi Min Zhao <zyimin at linux.ibm.com>
>
>Add new functions to generate zPCI command string and append it to
>QEMU command line.
>
>Signed-off-by: Yi Min Zhao <zyimin at linux.ibm.com>
>Reviewed-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
>Reviewed-by: Stefan Zimmermann <stzi at linux.ibm.com>
>Reviewed-by: Bjoern Walk <bwalk at linux.vnet.ibm.com>
>---
> src/qemu/qemu_command.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++
> src/qemu/qemu_command.h |   4 ++
> 2 files changed, 108 insertions(+)
>

>+static int
>+qemuBuildExtensionCommandLine(virCommandPtr cmd,
>+                              virQEMUCapsPtr qemuCaps,
>+                              virDomainDeviceInfoPtr dev)
>+{
>+    if (qemuCheckDeviceIsZPCI(dev)) {
>+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_ZPCI)) {
>+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
>+                           _("This QEMU doesn't support zpci devices"));
>+            return -1;
>+        }

Even though we have a lot of pre-existing code, qemuBuild* should not be
reporting errors based on missing caps. That belongs in Validate.

But it's not necessary here, because we would not have set VIR_PCI_ADDRESS_EXTENSION_ZPCI
otherwise, right?

Jano

>+        return qemuAppendZPCIDevStr(cmd, dev);
>+    }
>+
>+    return 0;
>+}
>
> static int
> qemuBulildFloppyCommandLineOptions(virCommandPtr cmd,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180602/e4198376/attachment-0001.sig>


More information about the libvir-list mailing list