SHA256
1
0
forked from pool/systemd
systemd/1014-udev-update-net_id-comments.patch

103 lines
4.4 KiB
Diff
Raw Normal View History

Accepting request 233680 from Base:System - Add patch log-target-null-instead-kmsg.patch from Thomas Blume to enable the kernel developers to see a clean kmsg ring buffer without any systemd/udev messages included (bnc#877021) - Add upstram patches for backlight 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch 0002-backlight-do-nothing-if-max_brightness-is-0.patch 0003-backlight-unify-error-messages.patch 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch - Add upstream patches 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch 0003-analyze-fix-plot-with-bad-y-size.patch 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch - Drop upstream-net_id-changes.patch and replace them with the correct patches from upstream and their commits: add: 1014-udev-update-net_id-comments.patch add: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch - Add patch log-target-null-instead-kmsg.patch from Thomas Blume to enable the kernel developers to see a clean kmsg ring buffer without any systemd/udev messages included (bnc#877021) - Add upstram patches for backlight 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch 0002-backlight-do-nothing-if-max_brightness-is-0.patch OBS-URL: https://build.opensuse.org/request/show/233680 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=186
2014-05-13 20:46:20 +02:00
From d4b687c96adf207f0878aebf3ce3371f6160687f Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Thu, 27 Mar 2014 15:30:09 +0100
Subject: [PATCH] udev: update net_id comments
Signed-off-by: Robert Milasan <rmilasan@suse.com>
---
src/udev/udev-builtin-net_id.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 4f2b2c1..9ac07de 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -33,8 +33,11 @@
* ww -- wwan
*
* Type of names:
+ * b<number> -- BCMA bus core number
+ * ccw<name> -- CCW bus group name
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_id>] -- hotplug slot index number
+ * v<number> -- virtio number
* x<MAC> -- MAC address
* [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>]
* -- PCI geographical location
@@ -119,12 +122,9 @@ struct netnames {
const char *pci_onboard_label;
char usb_ports[IFNAMSIZ];
-
char bcma_core[IFNAMSIZ];
-
- char virtio_core[IFNAMSIZ];
-
- char ccw_core[IFNAMSIZ];
+ char virtio[IFNAMSIZ];
+ char ccw_group[IFNAMSIZ];
};
/* retrieve on-board index number and label from firmware */
@@ -353,18 +353,17 @@ static int names_bcma(struct udev_device *dev, struct netnames *names) {
static int names_virtio(struct udev_device *dev, struct netnames *names) {
struct udev_device *virtdev;
- unsigned int core;
+ unsigned int num;
virtdev = udev_device_get_parent_with_subsystem_devtype(dev, "virtio", NULL);
if (!virtdev)
return -ENOENT;
- /* core num */
- if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &core) != 1)
+ if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &num) != 1)
return -EINVAL;
- /* suppress the common core == 0 */
- if (core > 0)
- snprintf(names->virtio_core, sizeof(names->virtio_core), "v%u", core);
+ /* suppress the common num == 0 */
+ if (num > 0)
+ snprintf(names->virtio, sizeof(names->virtio), "v%u", num);
names->type = NET_VIRTIO;
return 0;
@@ -402,8 +401,8 @@ static int names_ccw(struct udev_device *dev, struct netnames *names) {
return -EINVAL;
/* Store the CCW bus-ID for use as network device name */
- rc = snprintf(names->ccw_core, sizeof(names->ccw_core), "ccw%s", bus_id);
- if (rc >= 0 && rc < (int)sizeof(names->ccw_core))
+ rc = snprintf(names->ccw_group, sizeof(names->ccw_group), "ccw%s", bus_id);
+ if (rc >= 0 && rc < (int)sizeof(names->ccw_group))
names->type = NET_CCWGROUP;
return 0;
}
@@ -517,7 +516,7 @@ static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
if (err >= 0 && names.type == NET_CCWGROUP) {
char str[IFNAMSIZ];
- if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_group) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
goto out;
}
@@ -585,11 +584,11 @@ static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
char str[IFNAMSIZ];
if (names.pci_path[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
if (names.pci_slot[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
goto out;
}
--
1.8.4.5