From ad4aeb98f9ebc13ebf9a81de5392ad8cd30c7525 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 11 Jun 2012 22:49:31 +0200 Subject: [PATCH] pvops: respect 'removable' xenstore flag for block devices Especially this is needed by pmount to allow mount qvm-block attached devices by normal user. --- drivers/block/xen-blkfront.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 0ed4b200fa58..2054a3e9e435 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2339,6 +2339,7 @@ static void blkfront_connect(struct blkfront_info *info) unsigned int binfo; char *envp[] = { "RESIZE=1", NULL }; int err, i; + int removable; switch (info->connected) { case BLKIF_STATE_CONNECTED: @@ -2406,6 +2407,12 @@ static void blkfront_connect(struct blkfront_info *info) } } + err = xenbus_gather(XBT_NIL, info->xbdev->otherend, + "removable", "%d", &removable, + NULL); + if (!err && removable) + binfo |= VDISK_REMOVABLE; + err = xlvbd_alloc_gendisk(sectors, info, binfo, sector_size, physical_sector_size); if (err) { -- 2.20.1