From 1b9928a04716a54933dcaff9ec7e68323f58090b 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 a74d03913822..e76b999fceca 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.21.0