2012-06-11 20:49:31 +00:00
|
|
|
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
|
|
|
|
index 4e86393..34493d7 100644
|
|
|
|
--- a/drivers/block/xen-blkfront.c
|
|
|
|
+++ b/drivers/block/xen-blkfront.c
|
2017-10-02 03:04:33 +00:00
|
|
|
@@ -2317,6 +2317,7 @@ static void blkfront_connect(struct blkfront_info *info)
|
2012-06-11 20:49:31 +00:00
|
|
|
unsigned int binfo;
|
2017-10-02 03:04:33 +00:00
|
|
|
char *envp[] = { "RESIZE=1", NULL };
|
2016-11-11 13:28:22 +00:00
|
|
|
int err, i;
|
2016-01-04 11:54:07 +00:00
|
|
|
+ int removable;
|
2012-06-11 20:49:31 +00:00
|
|
|
|
|
|
|
switch (info->connected) {
|
|
|
|
case BLKIF_STATE_CONNECTED:
|
2017-10-02 03:04:33 +00:00
|
|
|
@@ -2384,6 +2385,12 @@ static void blkfront_connect(struct blkfront_info *info)
|
2016-11-11 13:28:22 +00:00
|
|
|
}
|
2016-01-04 11:54:07 +00:00
|
|
|
}
|
2012-06-11 20:49:31 +00:00
|
|
|
|
|
|
|
+ err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
|
|
|
|
+ "removable", "%d", &removable,
|
|
|
|
+ NULL);
|
|
|
|
+ if (!err && removable)
|
|
|
|
+ binfo |= VDISK_REMOVABLE;
|
|
|
|
+
|
2016-01-04 11:54:07 +00:00
|
|
|
err = xlvbd_alloc_gendisk(sectors, info, binfo, sector_size,
|
2017-10-02 03:04:33 +00:00
|
|
|
physical_sector_size);
|
2016-01-04 11:54:07 +00:00
|
|
|
if (err) {
|