提交 6589ce35 编写于 作者: T Tomáš Golembiovský 提交者: Michael Roth

qga: linux: return disk device in guest-get-fsinfo

Report device node of the disk on Linux (e.g. "/dev/sda2").
Requirs libudev.
Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 b616105a
......@@ -950,7 +950,12 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
if (udev == NULL || udevice == NULL) {
g_debug("failed to query udev");
} else {
const char *serial;
const char *devnode, *serial;
devnode = udev_device_get_devnode(udevice);
if (devnode != NULL) {
disk->dev = g_strdup(devnode);
disk->has_dev = true;
}
serial = udev_device_get_property_value(udevice, "ID_SERIAL");
if (serial != NULL && *serial != 0) {
disk->serial = g_strdup(serial);
......
......@@ -835,6 +835,7 @@
# @target: target id
# @unit: unit id
# @serial: serial number (since: 3.1)
# @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
#
# Since: 2.2
##
......@@ -842,7 +843,7 @@
'data': {'pci-controller': 'GuestPCIAddress',
'bus-type': 'GuestDiskBusType',
'bus': 'int', 'target': 'int', 'unit': 'int',
'*serial': 'str'} }
'*serial': 'str', '*dev': 'str'} }
##
# @GuestFilesystemInfo:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册