]> xenbits.xensource.com Git - libvirt.git/commitdiff
nodedev: Expose sysfs path of device
authorOsier Yang <jyang@redhat.com>
Mon, 3 Jun 2013 10:05:30 +0000 (18:05 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 18 Jun 2013 08:31:07 +0000 (16:31 +0800)
The name format is constructed by libvirt, it's not that clear to
get what the device's sysfs path should be. This exposes the device's
sysfs path by a new tag <path>.

Since the sysfspath is filled during enumerating the devices by
either udev or HAL. It's an output-only tag.

src/conf/node_device_conf.c

index 4eeb3b30211c6e756556ef062a3f0d6c43210df3..cc6f297b2a78121ebfc90b2d76c6a65001eee2fa 100644 (file)
@@ -236,6 +236,7 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDefPtr def)
 
     virBufferAddLit(&buf, "<device>\n");
     virBufferEscapeString(&buf, "  <name>%s</name>\n", def->name);
+    virBufferEscapeString(&buf, "  <path>%s</path>\n", def->sysfs_path);
     if (def->parent) {
         virBufferEscapeString(&buf, "  <parent>%s</parent>\n", def->parent);
     }