[PATCH 11/33] conf: add 'pnv-phb3-root-port' domain definition

Daniel Henrique Barboza posted 33 patches 4 years ago
There is a newer version of this series
[PATCH 11/33] conf: add 'pnv-phb3-root-port' domain definition
Posted by Daniel Henrique Barboza 4 years ago
Apart from being usable only with pnv-phb3 PCIE host bridges (to be
added soon), this device acts as a regular pcie-root-port but with a
specific model name.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 docs/schemas/domaincommon.rng | 1 +
 src/conf/domain_conf.c        | 1 +
 src/conf/domain_conf.h        | 1 +
 src/qemu/qemu_validate.c      | 2 ++
 4 files changed, 5 insertions(+)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 169b8d8dee..9e2797ec58 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2601,6 +2601,7 @@
                     <!-- implementations of "pcie-root-port" -->
                     <value>ioh3420</value>
                     <value>pcie-root-port</value>
+                    <value>pnv-phb3-root-port</value>
                     <!-- implementations of "pcie-switch-upstream-port" -->
                     <value>x3130-upstream</value>
                     <!-- implementations of "pcie-switch-downstream-port" -->
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 393f9d9478..c540b740df 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -437,6 +437,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName,
               "pcie-root-port",
               "spapr-pci-host-bridge",
               "pcie-pci-bridge",
+              "pnv-phb3-root-port",
 );
 
 VIR_ENUM_IMPL(virDomainControllerModelSCSI,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e2f35fe20b..18aa7a885b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -645,6 +645,7 @@ typedef enum {
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE,
+    VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT,
 
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST
 } virDomainControllerPCIModelName;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 95af0ecf3b..bdb7c6f1e6 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -3429,6 +3429,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName)
         return QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE;
     case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE:
         return QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE;
+    case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT:
+        return QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT;
     case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE:
         return 0;
     case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST:
-- 
2.34.1

Re: [PATCH 11/33] conf: add 'pnv-phb3-root-port' domain definition
Posted by Peter Krempa 4 years ago
On Thu, Jan 20, 2022 at 10:52:14 -0300, Daniel Henrique Barboza wrote:
> Apart from being usable only with pnv-phb3 PCIE host bridges (to be
> added soon), this device acts as a regular pcie-root-port but with a
> specific model name.
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>  docs/schemas/domaincommon.rng | 1 +
>  src/conf/domain_conf.c        | 1 +
>  src/conf/domain_conf.h        | 1 +
>  src/qemu/qemu_validate.c      | 2 ++
>  4 files changed, 5 insertions(+)

[...]

> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 393f9d9478..c540b740df 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -437,6 +437,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName,
>                "pcie-root-port",
>                "spapr-pci-host-bridge",
>                "pcie-pci-bridge",
> +              "pnv-phb3-root-port",
>  );

Missing corresponding 'docs/formatdomain.rst' change.

Re: [PATCH 11/33] conf: add 'pnv-phb3-root-port' domain definition
Posted by Daniel Henrique Barboza 4 years ago

On 1/21/22 11:17, Peter Krempa wrote:
> On Thu, Jan 20, 2022 at 10:52:14 -0300, Daniel Henrique Barboza wrote:
>> Apart from being usable only with pnv-phb3 PCIE host bridges (to be
>> added soon), this device acts as a regular pcie-root-port but with a
>> specific model name.
>>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>> ---
>>   docs/schemas/domaincommon.rng | 1 +
>>   src/conf/domain_conf.c        | 1 +
>>   src/conf/domain_conf.h        | 1 +
>>   src/qemu/qemu_validate.c      | 2 ++
>>   4 files changed, 5 insertions(+)
> 
> [...]
> 
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index 393f9d9478..c540b740df 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>> @@ -437,6 +437,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName,
>>                 "pcie-root-port",
>>                 "spapr-pci-host-bridge",
>>                 "pcie-pci-bridge",
>> +              "pnv-phb3-root-port",
>>   );
> 
> Missing corresponding 'docs/formatdomain.rst' change.

The reason I didn't add a note in that doc is because of this specific paragraph:

"PCI controllers also have an optional subelement <model> with an attribute name. The name
attribute holds the name of the specific device that qemu is emulating (e.g. "i82801b11-bridge")
rather than simply the class of device ("pcie-to-pci-bridge", "pci-bridge"), which is set in
the controller element's model attribute. In almost all cases, you should not manually add a
<model> subelement to a controller, nor should you modify one that is automatically generated
by libvirt. Since 1.2.19 (QEMU only)."

This, summed up with the fact that not all PCI model names are documented in this doc (e.g.
the ioh3420 root port model name), gave me the impression that we don't want/bother to
specify these details to the user.


All this said, I can add a patch that documents all the model names currently supported,
then I can add the new stuff on top of it.


Thanks,


Daniel


>