X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fpath_id%2Fpath_id.c;h=c19bfd0f8d59fae57a74d1ba88ab47748efc6f08;hb=8741f2defaf26aafe5ee0fd29954cfdf84ee519c;hp=dbb52bad2141ffc06308bbd45f5e5fe6ee980f8c;hpb=48a9b173e88738ff4eefb3519f1d27711b417c8d;p=elogind.git diff --git a/extras/path_id/path_id.c b/extras/path_id/path_id.c index dbb52bad2..c19bfd0f8 100644 --- a/extras/path_id/path_id.c +++ b/extras/path_id/path_id.c @@ -1,8 +1,10 @@ /* - * compose persisistent device path + * compose persistent device path * * Copyright (C) 2009 Kay Sievers * + * Logic based on Hannes Reinecke's shell script. + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or @@ -29,9 +31,9 @@ #include #include "libudev.h" -#include "../../udev/udev.h" +#include "libudev-private.h" -int debug; +static int debug; static void log_fn(struct udev *udev, int priority, const char *file, int line, const char *fn, @@ -366,7 +368,7 @@ int main(int argc, char **argv) if (udev == NULL) goto exit; - logging_init("path_id"); + udev_log_init("path_id"); udev_set_log_fn(udev, log_fn); while (1) { @@ -446,6 +448,9 @@ int main(int argc, char **argv) } else if (strcmp(subsys, "xen") == 0) { path_prepend(&path, "xen-%s", udev_device_get_sysname(parent)); parent = skip_subsystem(parent, "xen"); + } else if (strcmp(subsys, "virtio") == 0) { + path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent)); + parent = skip_subsystem(parent, "virtio"); } parent = udev_device_get_parent(parent); @@ -465,6 +470,6 @@ out: udev_device_unref(dev); exit: udev_unref(udev); - logging_close(); + udev_log_close(); return rc; }