summaryrefslogtreecommitdiffstats
path: root/hw/xen_devconfig.c
diff options
context:
space:
mode:
authorMarkus Armbruster2012-06-13 10:11:50 +0200
committerKevin Wolf2012-06-15 14:03:43 +0200
commit093003b1d3d7453d65bcbe8ad7e911950fc076f5 (patch)
tree22913be6da30b0869af11adb82704641aef05055 /hw/xen_devconfig.c
parentxen: Don't change -drive if=xen device name during machine init (diff)
downloadqemu-093003b1d3d7453d65bcbe8ad7e911950fc076f5.tar.gz
qemu-093003b1d3d7453d65bcbe8ad7e911950fc076f5.tar.xz
qemu-093003b1d3d7453d65bcbe8ad7e911950fc076f5.zip
xen: Don't peek behind the BlockDriverState abstraction
First offender is xen_config_dev_blk()'s use of disk->bdrv->filename. Get the filename from disk->opts instead. Same result, except for snapshots: there, we now get the filename specified by the user instead of the name of the temporary image created by bdrv_open(). Should be an improvement. Second offender is blk_init()'s use of blkdev->bs->drv->format_name. Simply use the appropriate interface to get the format name. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/xen_devconfig.c')
-rw-r--r--hw/xen_devconfig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/xen_devconfig.c b/hw/xen_devconfig.c
index 7b7b0a2bf0..0928613b55 100644
--- a/hw/xen_devconfig.c
+++ b/hw/xen_devconfig.c
@@ -1,6 +1,5 @@
#include "xen_backend.h"
#include "blockdev.h"
-#include "block_int.h" /* XXX */
/* ------------------------------------------------------------- */
@@ -99,10 +98,11 @@ int xen_config_dev_blk(DriveInfo *disk)
int cdrom = disk->media_cd;
const char *devtype = cdrom ? "cdrom" : "disk";
const char *mode = cdrom ? "r" : "w";
+ const char *filename = qemu_opt_get(disk->opts, "file");
snprintf(device_name, sizeof(device_name), "xvd%c", 'a' + disk->unit);
xen_be_printf(NULL, 1, "config disk %d [%s]: %s\n",
- disk->unit, device_name, disk->bdrv->filename);
+ disk->unit, device_name, filename);
xen_config_dev_dirs("vbd", "qdisk", vdev, fe, be, sizeof(fe));
/* frontend */
@@ -112,7 +112,7 @@ int xen_config_dev_blk(DriveInfo *disk)
/* backend */
xenstore_write_str(be, "dev", device_name);
xenstore_write_str(be, "type", "file");
- xenstore_write_str(be, "params", disk->bdrv->filename);
+ xenstore_write_str(be, "params", filename);
xenstore_write_str(be, "mode", mode);
/* common stuff */