Pablo Greco 40546a
From dd083516c7057ee50e59290643634156daf0773b Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <dd083516c7057ee50e59290643634156daf0773b@dist-git>
Pablo Greco 40546a
From: Yi Min Zhao <zyimin@linux.ibm.com>
Pablo Greco 40546a
Date: Mon, 8 Apr 2019 10:57:18 +0200
Pablo Greco 40546a
Subject: [PATCH] conf: Add definitions for 'uid' and 'fid' PCI address
Pablo Greco 40546a
 attributes
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
Add zPCI definitions in preparation of extending the PCI address
Pablo Greco 40546a
with parameters uid (user-defined identifier) and fid (PCI function
Pablo Greco 40546a
identifier).
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Yi Min Zhao <zyimin@linux.ibm.com>
Pablo Greco 40546a
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Pablo Greco 40546a
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Pablo Greco 40546a
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Pablo Greco 40546a
Pablo Greco 40546a
(cherry-picked from commit 30522c78c11d9ff6c6c177dfca4a0da8057095fe)
Pablo Greco 40546a
Pablo Greco 40546a
https://bugzilla.redhat.com/show_bug.cgi?id=1508149
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Pablo Greco 40546a
Message-Id: <20190408085732.28684-2-abologna@redhat.com>
Pablo Greco 40546a
Reviewed-by: Laine Stump <laine@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 cfg.mk            | 1 +
Pablo Greco 40546a
 src/util/virpci.h | 7 +++++++
Pablo Greco 40546a
 2 files changed, 8 insertions(+)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/cfg.mk b/cfg.mk
Pablo Greco 40546a
index e3e94bf6f0..7fd2b1dcb6 100644
Pablo Greco 40546a
--- a/cfg.mk
Pablo Greco 40546a
+++ b/cfg.mk
Pablo Greco 40546a
@@ -472,6 +472,7 @@ sc_prohibit_canonicalize_file_name:
Pablo Greco 40546a
 # Insist on correct types for [pug]id.
Pablo Greco 40546a
 sc_correct_id_types:
Pablo Greco 40546a
 	@prohibit='\<(int|long) *[pug]id\>' \
Pablo Greco 40546a
+	exclude='exempt from syntax-check' \
Pablo Greco 40546a
 	halt='use pid_t for pid, uid_t for uid, gid_t for gid' \
Pablo Greco 40546a
 	  $(_sc_search_regexp)
Pablo Greco 40546a
 
Pablo Greco 40546a
diff --git a/src/util/virpci.h b/src/util/virpci.h
Pablo Greco 40546a
index 794b7e59db..01df652b86 100644
Pablo Greco 40546a
--- a/src/util/virpci.h
Pablo Greco 40546a
+++ b/src/util/virpci.h
Pablo Greco 40546a
@@ -36,6 +36,13 @@ typedef virPCIDeviceAddress *virPCIDeviceAddressPtr;
Pablo Greco 40546a
 typedef struct _virPCIDeviceList virPCIDeviceList;
Pablo Greco 40546a
 typedef virPCIDeviceList *virPCIDeviceListPtr;
Pablo Greco 40546a
 
Pablo Greco 40546a
+typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress;
Pablo Greco 40546a
+typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr;
Pablo Greco 40546a
+struct _virZPCIDeviceAddress {
Pablo Greco 40546a
+    unsigned int uid; /* exempt from syntax-check */
Pablo Greco 40546a
+    unsigned int fid;
Pablo Greco 40546a
+};
Pablo Greco 40546a
+
Pablo Greco 40546a
 struct _virPCIDeviceAddress {
Pablo Greco 40546a
     unsigned int domain;
Pablo Greco 40546a
     unsigned int bus;
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a