[PATCH 13/33] qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB3

Daniel Henrique Barboza danielhb413 at gmail.com
Mon Jan 24 13:37:11 UTC 2022



On 1/21/22 11:21, Peter Krempa wrote:
> On Thu, Jan 20, 2022 at 10:52:16 -0300, Daniel Henrique Barboza wrote:
>> The pnv-phb3 device is the pcie-root controller for PowerNV8 domains.
>>
>> Add its QEMU capability so Libvirt can recognize it.
>>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
>> ---
>>   src/qemu/qemu_capabilities.c                    | 2 ++
>>   src/qemu/qemu_capabilities.h                    | 1 +
>>   tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
>>   tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
>>   tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 +
>>   tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 +
>>   6 files changed, 7 insertions(+)
>>
>> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
>> index a4cea7b90e..a1012d4795 100644
>> --- a/src/qemu/qemu_capabilities.c
>> +++ b/src/qemu/qemu_capabilities.c
>> @@ -658,6 +658,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
>>                 /* 420 */
>>                 "device.json+hotplug", /* QEMU_CAPS_DEVICE_JSON */
>>                 "pnv-phb3-root-port", /* QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT */
>> +              "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */
> 
> Can the latter exist without the former? I'm trying to see whether it
> we can't assume that QEMU_CAPS_DEVICE_PNV_PHB3 is supported if
> QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT or vice versa to not add
> capabilities that are redundant.

Makes sense. Yes, the root-port is dependent of the pnv-phb support. We can check
for QEMU_CAPS_DEVICE_PNV_PHB3 and assume that QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT is
supported.

I believe it's a matter of adding just this capability and then, in
virQEMUCapsObjectTypes[], do something like this to allow for both devices be bound
to the same cap:


@@ -1358,6 +1359,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
      { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST },
      { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI },
+    { "pnv-phb3-root-port", QEMU_CAPS_DEVICE_PNV_PHB3 },
+    { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 },
  };



This is a change that reflects on the pnv-phb4 devices so I'll also change those
patches accordingly.


Thanks,


Daniel

> 




More information about the libvir-list mailing list