[libvirt] [PATCH v5 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes

Yi Min Zhao posted 13 patches 7 years, 5 months ago
There is a newer version of this series
[libvirt] [PATCH v5 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes
Posted by Yi Min Zhao 7 years, 5 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>
---
 cfg.mk            | 1 +
 src/util/virpci.h | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index 609ae869c2..1116feb299 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -472,6 +472,7 @@ sc_prohibit_canonicalize_file_name:
 # Insist on correct types for [pug]id.
 sc_correct_id_types:
 	@prohibit='\<(int|long) *[pug]id\>' \
+	exclude='exempt from syntax-check' \
 	halt='use pid_t for pid, uid_t for uid, gid_t for gid' \
 	  $(_sc_search_regexp)
 
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 2ac87694df..b7bcfa6d9f 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -37,12 +37,20 @@ typedef virPCIDeviceAddress *virPCIDeviceAddressPtr;
 typedef struct _virPCIDeviceList virPCIDeviceList;
 typedef virPCIDeviceList *virPCIDeviceListPtr;
 
+typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress;
+typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr;
+struct _virZPCIDeviceAddress {
+    unsigned int uid; /* exempt from syntax-check */
+    unsigned int fid;
+};
+
 struct _virPCIDeviceAddress {
     unsigned int domain;
     unsigned int bus;
     unsigned int slot;
     unsigned int function;
     int multi; /* virTristateSwitch */
+    virZPCIDeviceAddress zpci;
 };
 
 typedef enum {
-- 
Yi Min

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v5 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes
Posted by Andrea Bolognani 7 years, 5 months ago
On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote:
> 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>

[...]
> +typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress;
> +typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr;
> +struct _virZPCIDeviceAddress {
> +    unsigned int uid; /* exempt from syntax-check */
> +    unsigned int fid;
> +};
> +
>  struct _virPCIDeviceAddress {
>      unsigned int domain;
>      unsigned int bus;
>      unsigned int slot;
>      unsigned int function;
>      int multi; /* virTristateSwitch */
> +    virZPCIDeviceAddress zpci;
>  };

As mentioned during an earlier review, virPCIDeviceAddress
should itself include a virDomainPCIAddressExtensionFlags
so that it would be possible to know whether zpci should be
taken into account without having to look at other structs.
Perhaps virPCIDeviceAddressExtensionFlags would be a more
appropriate name then?


An aside. I see you've carried over Jano's R-b from v2;
given that the patch has changed substantially since then,
I don't think it's fair to assume he'd stand behind the
current incarnation just as he did originally. IMHO you
should just drop R-bs when posting a new version, unless
the patch is unchanged or the changes made are trivial.

-- 
Andrea Bolognani / Red Hat / Virtualization

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