[libvirt] [PATCH v3 06/12] qemu: Introduce qemuDomainDeviceDefValidateControllerPCI
Ján Tomko
jtomko at redhat.com
Fri Dec 8 15:38:55 UTC 2017
On Wed, Dec 06, 2017 at 08:14:02PM -0500, John Ferlan wrote:
>Move PCI validation checks out of qemu_command into the proper
>qemu_domain validation helper.
>
>Since there's a lot to move, we'll start slow by replicating the
>pcie-root and pci-root avoidance from qemuBuildSkipController and
>the first switch found in qemuBuildControllerDevStr.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_command.c | 20 --------------------
> src/qemu/qemu_domain.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 48 insertions(+), 21 deletions(-)
>
>diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
>index 428db1193..ceb03a0cd 100644
>--- a/src/qemu/qemu_domain.c
>+++ b/src/qemu/qemu_domain.c
>@@ -4010,6 +4010,50 @@ qemuDomainDeviceDefValidateControllerSCSI(const virDomainControllerDef *controll
>
>
> static int
>+qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *controller,
>+ const virDomainDef *def)
>+{
>+ virDomainControllerModelPCI model = controller->model;
>+
>+ /* skip pcie-root */
>+ if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
We already checked that the controller type is PCI in the caller.
>+ controller->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT)
>+ return 0;
>+
>+ /* Skip pci-root, except for pSeries guests (which actually
>+ * support more than one PCI Host Bridge per guest) */
>+ if (!qemuDomainIsPSeries(def) &&
>+ controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
Same here.
>+ controller->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT)
>+ return 0;
>+
Jan
-------------- 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/20171208/2479627b/attachment-0001.sig>
More information about the libvir-list
mailing list