libxl: Share logic for finding path between qemuu and pygrub
qemu can also access disks which will be provided with a qdisk backend
directly; add a flag to libxl__device_disk_find_local_path to indicate
whether to check for qdisk direct access.
Call libxl__device_disk_find_local_path() for most paths. If we can't
find a local path, print an error and skip the disk, rather than using
a bogus path.
Now if there is no local access to the disk (i.e., because the disk
has a non-local backend, or relies on a custom hotplug script), libxl
will now print a warning and not provide the emulated disk, rather
than providing bogus parameters to qemu which cause it to error out.
(Such disks will still be available via the PV backend.)
I left the libxl__blktap_devpath in the qemuu-specific code rather
than sharing it with the pyrgub code because:
1) When the pygrub path runs the guest disks have not yet been set up
2) libxl__blktap_devpath() will give you the existing devpath if it
already exists, but will set one up for you if you don't. So on the
pygrub path, this would end up setting up a new tap device.
3) There is no tap-specific teardown code on the pygrub path, and I
don't want to add any (particularly since I'm hoping to remove tapdisk
altogether soon).
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: George Dunlap <george.dunlap@citrix.com>