pvops: respect 'removable' xenstore flag for block devices
Especially this is needed by pmount to allow mount qvm-block attached devices by normal user.
This commit is contained in:
parent
550b5f7d95
commit
5751db78f9
26
patches.xen/pvops-blkfront-removable-flag.patch
Normal file
26
patches.xen/pvops-blkfront-removable-flag.patch
Normal file
@ -0,0 +1,26 @@
|
||||
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
|
||||
@@ -1188,7 +1188,7 @@ static void blkfront_connect(struct blkfront_info *info)
|
||||
unsigned long sector_size;
|
||||
unsigned int binfo;
|
||||
int err;
|
||||
- int barrier, flush, discard;
|
||||
+ int barrier, flush, discard, removable;
|
||||
|
||||
switch (info->connected) {
|
||||
case BLKIF_STATE_CONNECTED:
|
||||
@@ -1266,6 +1266,12 @@ static void blkfront_connect(struct blkfront_info *info)
|
||||
if (!err && discard)
|
||||
blkfront_setup_discard(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);
|
||||
if (err) {
|
||||
xenbus_dev_fatal(info->xbdev, err, "xlvbd_add at %s",
|
@ -4,3 +4,4 @@ patches.xen/pvops-3.4-0003-xen-acpi-sleep-Register-to-the-acpi_suspend_lowlevel.
|
||||
patches.xen/pvops-3.4-enable-netfront-in-dom0.patch
|
||||
patches.xen/pvops-netback-calculate-correctly-the-SKB-slots.patch
|
||||
patches.xen/pvops-3.4-0100-usb-xen-pvusb-driver.patch
|
||||
patches.xen/pvops-blkfront-removable-flag.patch
|
||||
|
Loading…
Reference in New Issue
Block a user