aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkfront.c
diff options
context:
space:
mode:
authorK. Y. Srinivasan <ksrinivasan@novell.com>2010-03-11 16:42:26 -0500
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:31:27 -0400
commit1fa73be6be65028a7543bba8f14474b42e064a1b (patch)
tree1bd0e5a44c99231afefe53e447bddc4b73d091cb /drivers/block/xen-blkfront.c
parent5d7ed20e822ef82117a4d9928b030fa0247b789d (diff)
xen/front: Propagate changed size of VBDs
Support dynamic resizing of virtual block devices. This patch supports both file backed block devices as well as physical devices that can be dynamically resized on the host side. Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r--drivers/block/xen-blkfront.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 60006b730872..f47b0961fab1 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -930,9 +930,24 @@ static void blkfront_connect(struct blkfront_info *info)
930 unsigned int binfo; 930 unsigned int binfo;
931 int err; 931 int err;
932 932
933 if ((info->connected == BLKIF_STATE_CONNECTED) || 933 switch (info->connected) {
934 (info->connected == BLKIF_STATE_SUSPENDED) ) 934 case BLKIF_STATE_CONNECTED:
935 /*
936 * Potentially, the back-end may be signalling
937 * a capacity change; update the capacity.
938 */
939 err = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
940 "sectors", "%Lu", &sectors);
941 if (XENBUS_EXIST_ERR(err))
942 return;
943 printk(KERN_INFO "Setting capacity to %Lu\n",
944 sectors);
945 set_capacity(info->gd, sectors);
946
947 /* fall through */
948 case BLKIF_STATE_SUSPENDED:
935 return; 949 return;
950 }
936 951
937 dev_dbg(&info->xbdev->dev, "%s:%s.\n", 952 dev_dbg(&info->xbdev->dev, "%s:%s.\n",
938 __func__, info->xbdev->otherend); 953 __func__, info->xbdev->otherend);