]> git.proxmox.com Git - mirror_qemu.git/commit
qga: don't fail if mount doesn't have slave devices
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 23 Mar 2017 20:24:32 +0000 (15:24 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 30 Mar 2017 19:12:57 +0000 (14:12 -0500)
commit8251a72f8bb8764c13dd5ba627e7d9e6d35d188e
tree5e244fe9d991c77bf0540f75a9d78810b284489e
parentdf9046363220e57d45818312759b954c033c58ab
qga: don't fail if mount doesn't have slave devices

In some cases the slave devices of a virtual block device are tracked
by the parent in the corresponding sysfs node. For instance, if we
have a loop-back mount of the form:

  /dev/loop3p1 on /home/mdroth/mnt type ext4 (rw,relatime,data=ordered)

this will be reflected in sysfs as:

  /sys/devices/virtual/block/loop3/
  ...
  /sys/devices/virtual/block/loop3/slaves
  /sys/devices/virtual/block/loop3/loop3p1

The current code however assumes the mounted virtual block device,
loop3p1 in this case, contains the slaves directory, and reports an
error otherwise. This breaks 'make check' in certain environments.

Fix this by simply skipping attempts to generate disk topology
information in these cases. Since this information is documented
in QAPI as optionally-reported, this should be ok from an API
perspective.

In the future, this can possibly be improved upon by collecting
topology information from the parent in these cases.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
qga/commands-posix.c