提交 1fa73be6 编写于 作者: K K. Y. Srinivasan 提交者: Jens Axboe

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: NK. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
上级 5d7ed20e
...@@ -930,9 +930,24 @@ static void blkfront_connect(struct blkfront_info *info) ...@@ -930,9 +930,24 @@ static void blkfront_connect(struct blkfront_info *info)
unsigned int binfo; unsigned int binfo;
int err; int err;
if ((info->connected == BLKIF_STATE_CONNECTED) || switch (info->connected) {
(info->connected == BLKIF_STATE_SUSPENDED) ) case BLKIF_STATE_CONNECTED:
/*
* Potentially, the back-end may be signalling
* a capacity change; update the capacity.
*/
err = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
"sectors", "%Lu", &sectors);
if (XENBUS_EXIST_ERR(err))
return;
printk(KERN_INFO "Setting capacity to %Lu\n",
sectors);
set_capacity(info->gd, sectors);
/* fall through */
case BLKIF_STATE_SUSPENDED:
return; return;
}
dev_dbg(&info->xbdev->dev, "%s:%s.\n", dev_dbg(&info->xbdev->dev, "%s:%s.\n",
__func__, info->xbdev->otherend); __func__, info->xbdev->otherend);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册