libxl: Rearrange qemu upstream disk argument code
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 24 Mar 2016 17:18:33 +0000 (17:18 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 4 Apr 2016 16:48:44 +0000 (17:48 +0100)
commit3fec17d4bb56567d139d7806392f4d8702d3f6a7
tree6db593a1c203429bef02385f9d66321bc71abb8f
parentf525acf3c01f2bf4d68ad6b691b7cd8297ab98be
libxl: Rearrange qemu upstream disk argument code

Reorganize the qemuu disk argument code to make a clean separation
between finding a file to use, and constructing the parameters:

* Rename pdev_path to target_path

* Only use qemu_disk_format_string() in circumstances where qemu may
be interpreting the disk (i.e., backend==QDISK).  In all other cases,
it should use RAW.

* Share as much as possible between the is_cdrom path and the normal
path.

This is mainly prep for sharing the local path finder with the
bootloader; but it does allow cdroms to use any backend that a normal
disk can use. Previously this was limited to RAW files or things that
qemu could handle directly; as of this changeset, it now includes tap
disks; and in future changesets it will include backends with custom
block scripts.

NB that this retains an existing bug, that disks with custom block
scripts or non-dom0 backends will have the bogus pdev_path passed in
to qemu, most likely resulting in qemu exiting with an error.  This
will be fixed in follow-up patches.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Tested-by: George Dunlap <george.dunlap@citrix.com>
tools/libxl/libxl_dm.c