[libvirt] [PATCH v2 RESEND 01/12] conf: Add definitions for 'uid' and 'fid' PCI address attributes

Yi Min Zhao posted 12 patches 7 years, 7 months ago
There is a newer version of this series
[libvirt] [PATCH v2 RESEND 01/12] conf: Add definitions for 'uid' and 'fid' PCI address attributes
Posted by Yi Min Zhao 7 years, 7 months ago
Add zPCI definitions in preparation of extending the PCI address
with parameters uid (user-defined identifier) and fid (PCI function
identifier).

Signed-off-by: Yi Min Zhao <zyimin@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/virpci.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/util/virpci.h b/src/util/virpci.h
index 794b7e59db..3546992fee 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -36,12 +36,22 @@ typedef virPCIDeviceAddress *virPCIDeviceAddressPtr;
 typedef struct _virPCIDeviceList virPCIDeviceList;
 typedef virPCIDeviceList *virPCIDeviceListPtr;
 
+typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress;
+typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr;
+struct _virZPCIDeviceAddress {
+    unsigned int zpci_fid;
+    unsigned int zpci_uid;
+    bool fid_assigned;
+    bool uid_assigned;
+};
+
 struct _virPCIDeviceAddress {
     unsigned int domain;
     unsigned int bus;
     unsigned int slot;
     unsigned int function;
     int multi; /* virTristateSwitch */
+    virZPCIDeviceAddressPtr zpci;
 };
 
 typedef enum {
-- 
Yi Min

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 RESEND 01/12] conf: Add definitions for 'uid' and 'fid' PCI address attributes
Posted by Andrea Bolognani 7 years, 6 months ago
On Tue, 2018-07-10 at 16:02 +0800, Yi Min Zhao wrote:
>  struct _virPCIDeviceAddress {
>      unsigned int domain;
>      unsigned int bus;
>      unsigned int slot;
>      unsigned int function;
>      int multi; /* virTristateSwitch */
> +    virZPCIDeviceAddressPtr zpci;

This should probably be an embedded structure rather than a pointer
to a separate, heap allocated structure.

I remember Laine having somewhat strong feelings about the topic,
so I'll leave arguing for or against that to him :)

-- 
Andrea Bolognani / Red Hat / Virtualization

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