Blame SOURCES/0011-Give-linux-s-parse-functions-the-unmodified-device-l.patch

36520b
From ba0655c62978ba64c227f1f87d9da3e1dea4f821 Mon Sep 17 00:00:00 2001
36520b
From: Peter Jones <pjones@redhat.com>
36520b
Date: Wed, 20 Jun 2018 14:37:14 -0400
36520b
Subject: [PATCH 11/39] Give linux-*'s ->parse() functions the unmodified
36520b
 device link as well
36520b
36520b
Signed-off-by: Peter Jones <pjones@redhat.com>
36520b
---
36520b
 src/linux-ata.c     | 2 +-
36520b
 src/linux-i2o.c     | 2 +-
36520b
 src/linux-nvme.c    | 2 +-
36520b
 src/linux-pci.c     | 2 +-
36520b
 src/linux-pmem.c    | 2 +-
36520b
 src/linux-sas.c     | 2 +-
36520b
 src/linux-sata.c    | 2 +-
36520b
 src/linux-scsi.c    | 2 +-
36520b
 src/linux-virtblk.c | 2 +-
36520b
 src/linux.c         | 4 ++--
36520b
 src/linux.h         | 3 ++-
36520b
 11 files changed, 13 insertions(+), 12 deletions(-)
36520b
36520b
diff --git a/src/linux-ata.c b/src/linux-ata.c
36520b
index 6a47ff3f279..dab02f3d224 100644
36520b
--- a/src/linux-ata.c
36520b
+++ b/src/linux-ata.c
36520b
@@ -58,7 +58,7 @@ is_pata(struct device *dev)
36520b
  * 11:0 -> ../../devices/pci0000:00/0000:00:11.5/ata3/host2/target2:0:0/2:0:0:0/block/sr0
36520b
  */
36520b
 static ssize_t
36520b
-parse_ata(struct device *dev, const char *current)
36520b
+parse_ata(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         uint32_t scsi_host, scsi_bus, scsi_device, scsi_target;
36520b
         uint64_t scsi_lun;
36520b
diff --git a/src/linux-i2o.c b/src/linux-i2o.c
36520b
index e57c0cb344f..4fe79e5719f 100644
36520b
--- a/src/linux-i2o.c
36520b
+++ b/src/linux-i2o.c
36520b
@@ -33,7 +33,7 @@
36520b
  * ... probably doesn't work.
36520b
  */
36520b
 static ssize_t
36520b
-parse_i2o(struct device *dev, const char *current UNUSED)
36520b
+parse_i2o(struct device *dev, const char *current UNUSED, const char *root UNUSED)
36520b
 {
36520b
         debug(DEBUG, "entry");
36520b
         /* I2O disks can have up to 16 partitions, or 4 bits worth. */
36520b
diff --git a/src/linux-nvme.c b/src/linux-nvme.c
36520b
index 6d5196fc082..00f53d5a9a7 100644
36520b
--- a/src/linux-nvme.c
36520b
+++ b/src/linux-nvme.c
36520b
@@ -48,7 +48,7 @@
36520b
  */
36520b
 
36520b
 static ssize_t
36520b
-parse_nvme(struct device *dev, const char *current)
36520b
+parse_nvme(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         int rc;
36520b
         int32_t tosser0, tosser1, tosser2, ctrl_id, ns_id, partition;
36520b
diff --git a/src/linux-pci.c b/src/linux-pci.c
36520b
index 0d2a90ab166..4fbd108e3ed 100644
36520b
--- a/src/linux-pci.c
36520b
+++ b/src/linux-pci.c
36520b
@@ -41,7 +41,7 @@
36520b
  *
36520b
  */
36520b
 static ssize_t
36520b
-parse_pci(struct device *dev, const char *current)
36520b
+parse_pci(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         int rc;
36520b
         int pos;
36520b
diff --git a/src/linux-pmem.c b/src/linux-pmem.c
36520b
index 045650bc471..9a075716f7f 100644
36520b
--- a/src/linux-pmem.c
36520b
+++ b/src/linux-pmem.c
36520b
@@ -70,7 +70,7 @@
36520b
  */
36520b
 
36520b
 static ssize_t
36520b
-parse_pmem(struct device *dev, const char *current)
36520b
+parse_pmem(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         uint8_t *filebuf = NULL;
36520b
         uint8_t system, sysbus, acpi_id;
36520b
diff --git a/src/linux-sas.c b/src/linux-sas.c
36520b
index 4a11147aef1..5f44f2c1f7b 100644
36520b
--- a/src/linux-sas.c
36520b
+++ b/src/linux-sas.c
36520b
@@ -45,7 +45,7 @@
36520b
  * I'm not sure at the moment if they're the same or not.
36520b
  */
36520b
 static ssize_t
36520b
-parse_sas(struct device *dev, const char *current)
36520b
+parse_sas(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         struct stat statbuf = { 0, };
36520b
         int rc;
36520b
diff --git a/src/linux-sata.c b/src/linux-sata.c
36520b
index a670ad9907e..d9a62efdbe6 100644
36520b
--- a/src/linux-sata.c
36520b
+++ b/src/linux-sata.c
36520b
@@ -138,7 +138,7 @@ sysfs_sata_get_port_info(uint32_t print_id, struct device *dev)
36520b
 }
36520b
 
36520b
 static ssize_t
36520b
-parse_sata(struct device *dev, const char *devlink)
36520b
+parse_sata(struct device *dev, const char *devlink, const char *root UNUSED)
36520b
 {
36520b
         const char *current = devlink;
36520b
         uint32_t print_id;
36520b
diff --git a/src/linux-scsi.c b/src/linux-scsi.c
36520b
index 87f2f7f7c92..153a4ff87ad 100644
36520b
--- a/src/linux-scsi.c
36520b
+++ b/src/linux-scsi.c
36520b
@@ -160,7 +160,7 @@ parse_scsi_link(const char *current, uint32_t *scsi_host,
36520b
 }
36520b
 
36520b
 static ssize_t
36520b
-parse_scsi(struct device *dev, const char *current)
36520b
+parse_scsi(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         uint32_t scsi_host, scsi_bus, scsi_device, scsi_target;
36520b
         uint64_t scsi_lun;
36520b
diff --git a/src/linux-virtblk.c b/src/linux-virtblk.c
36520b
index 6dedf0f27ee..9ee7994aeb3 100644
36520b
--- a/src/linux-virtblk.c
36520b
+++ b/src/linux-virtblk.c
36520b
@@ -45,7 +45,7 @@
36520b
  * But usually we just write the HD() entry, of course.
36520b
  */
36520b
 static ssize_t
36520b
-parse_virtblk(struct device *dev, const char *current)
36520b
+parse_virtblk(struct device *dev, const char *current, const char *root UNUSED)
36520b
 {
36520b
         uint32_t tosser;
36520b
         int pos;
36520b
diff --git a/src/linux.c b/src/linux.c
36520b
index fe45c6004b9..ef560753481 100644
36520b
--- a/src/linux.c
36520b
+++ b/src/linux.c
36520b
@@ -352,7 +352,7 @@ struct device HIDDEN
36520b
                 efi_error("strdup(\"%s\") failed", linkbuf);
36520b
                 goto err;
36520b
         }
36520b
-        debug(DEBUG, "dev->link: %s\n", dev->link);
36520b
+        debug(DEBUG, "dev->link: %s", dev->link);
36520b
 
36520b
         if (dev->part == -1) {
36520b
                 rc = read_sysfs_file(&tmpbuf, "dev/block/%s/partition", dev->link);
36520b
@@ -431,7 +431,7 @@ struct device HIDDEN
36520b
                 }
36520b
 
36520b
                 debug(DEBUG, "trying %s", probe->name);
36520b
-                pos = probe->parse(dev, current);
36520b
+                pos = probe->parse(dev, current, dev->link);
36520b
                 if (pos < 0) {
36520b
                         efi_error("parsing %s failed", probe->name);
36520b
                         goto err;
36520b
diff --git a/src/linux.h b/src/linux.h
36520b
index 39826224a53..35951bb4d16 100644
36520b
--- a/src/linux.h
36520b
+++ b/src/linux.h
36520b
@@ -244,7 +244,8 @@ struct dev_probe {
36520b
         char *name;
36520b
         enum interface_type *iftypes;
36520b
         uint32_t flags;
36520b
-        ssize_t (*parse)(struct device *dev, const char * const current);
36520b
+        ssize_t (*parse)(struct device *dev,
36520b
+                         const char * const current, const char * const root);
36520b
         ssize_t (*create)(struct device *dev,
36520b
                           uint8_t *buf, ssize_t size, ssize_t off);
36520b
         char *(*make_part_name)(struct device *dev);
36520b
-- 
36520b
2.17.1
36520b