]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
virpci: Decrease scope of VIR_PF_PHYS_PORT_NAME_REGEX macro
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 28 Nov 2023 15:02:00 +0000 (16:02 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Dec 2023 08:26:47 +0000 (09:26 +0100)
The VIR_PF_PHYS_PORT_NAME_REGEX macro is used only in
virPCIGetNetName() and nowhere else. It's not necessary to expose
it in the header file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virpci.c
src/util/virpci.h

index baacde4c14f783e97a44e5eaba29a5d703a2e5b0..eae698c0a0e3626298eb46b455430b5efea6850d 100644 (file)
@@ -2536,6 +2536,12 @@ virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddress *addr,
     return 0;
 }
 
+
+/* Represents format of PF's phys_port_name in switchdev mode:
+ * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file.
+ */
+# define VIR_PF_PHYS_PORT_NAME_REGEX  "(p[0-9]+$)|(p[0-9]+s[0-9]+$)"
+
 /**
  * virPCIGetNetName:
  * @device_link_sysfs_path: sysfs path to the PCI device
@@ -2661,6 +2667,8 @@ virPCIGetNetName(const char *device_link_sysfs_path,
     return -1;
 }
 
+# undef VIR_PF_PHYS_PORT_NAME_REGEX
+
 int
 virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
                              int pfNetDevIdx,
index faca6cf6f997476470c05c6c8f15dbcf52bfae5c..e964a2685cd66f5d04d6c643ce1ae426f77ce9ef 100644 (file)
@@ -52,11 +52,6 @@ struct _virZPCIDeviceAddress {
 
 #define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d"
 
-/* Represents format of PF's phys_port_name in switchdev mode:
- * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file.
- */
-#define VIR_PF_PHYS_PORT_NAME_REGEX  "(p[0-9]+$)|(p[0-9]+s[0-9]+$)"
-
 struct _virPCIDeviceAddress {
     unsigned int domain;
     unsigned int bus;