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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 2018/6/2 下午10:22, Ján Tomko 写道:
On Thu, May 24, 2018 at 02:24:31PM +0200, Xiao Feng Ren wrote:
From: Yi Min Zhao <zyimin@xxxxxxxxxxxxx>

Add new functions to generate zPCI command string and append it to
QEMU command line.

Signed-off-by: Yi Min Zhao <zyimin@xxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Stefan Zimmermann <stzi@xxxxxxxxxxxxx>
Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx>
---
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?
Yes, sounds reasonable. Until now, as my test, it's doable. But I think we need
more test. If it has no problem, I will change this as your comment in next
version. Thanks for your comment!

Jano

+        return qemuAppendZPCIDevStr(cmd, dev);
+    }
+
+    return 0;
+}

static int
qemuBulildFloppyCommandLineOptions(virCommandPtr cmd,

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux