From 4e68eab71ab6da915b4dae974113bfc15dc995b8 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. --- .../pvops-blkfront-removable-flag.patch | 26 +++++++++++++++++++ series-pvops.conf | 1 + 2 files changed, 27 insertions(+) create mode 100644 patches.xen/pvops-blkfront-removable-flag.patch diff --git a/patches.xen/pvops-blkfront-removable-flag.patch b/patches.xen/pvops-blkfront-removable-flag.patch new file mode 100644 index 0000000..633f708 --- /dev/null +++ b/patches.xen/pvops-blkfront-removable-flag.patch @@ -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", diff --git a/series-pvops.conf b/series-pvops.conf index 61beb0a..9f9819b 100644 --- a/series-pvops.conf +++ b/series-pvops.conf @@ -11,3 +11,4 @@ patches.xen/pvops-0010-CPUFREQ-xen-governor-for-Xen-hypervisor-frequency-sc.patc patches.xen/pvops-0011-x86-PCI-Expand-the-x86_msi_ops-to-have-a-restore-MSI.patch patches.xen/pvops-enable-netfront-in-dom0.patch patches.xen/pvops-netback-calculate-correctly-the-SKB-slots.patch +patches.xen/pvops-blkfront-removable-flag.patch