* Re: Resizing block devices live?
2012-12-18 14:06 ` George Dunlap
@ 2012-12-18 14:34 ` Jan Beulich
2012-12-18 14:37 ` Konrad Rzeszutek Wilk
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Jan Beulich @ 2012-12-18 14:34 UTC (permalink / raw)
To: George Dunlap
Cc: xen-devel@lists.xen.org, Ian Campbell, Konrad Rzeszutek Wilk,
Roger Pau Monne
>>> On 18.12.12 at 15:06, George Dunlap <George.Dunlap@eu.citrix.com> wrote:
> On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:
>
>> On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote:
>> > One of the requests from the xenorg.uservoice.com page that had a
>> > moderate amount of interest was to allow block devices to be resized.
>> > There's a description here:
>> >
>> >
>>
> https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-i
> mplement-block-device-resize
>> >
>> >
>> > I have no idea what this would take -- can anyone comment?
>>
>> Doesn't that already work? I thought this was patch in the PV block
>> drivers ages ago...
>>
>> Yes, http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36.
>>
>> Maybe this is a missing feature of (lib)xl vs xend?
>>
>
> "xm help" doesn't show a "block-resize" command, nor does grepping through
> tools for "resize" turn up anything.
>
> Would someone be willing to do some investigation into whether such a
> command is implemented in the protocol, and what it would take to get a "xm
> block-resize" command working? (Not necessarily do it, but have an idea
> what probably needs to be done.)
Have a look at http://xenbits.xen.org/hg/linux-2.6.18-xen.hg/rev/f7f420bd7b7a
- I don't think there is a strict need for xm/xl commands, except as
a courtesy.
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Resizing block devices live?
2012-12-18 14:06 ` George Dunlap
2012-12-18 14:34 ` Jan Beulich
@ 2012-12-18 14:37 ` Konrad Rzeszutek Wilk
2012-12-18 14:43 ` Ian Campbell
2012-12-18 14:51 ` Jan Beulich
[not found] ` <CAFLBxZazULnr8PRN_4fshUAmuohyn2o4AcqpohdjxbmDnVStGQ@mail.gmail.com>
2012-12-18 20:23 ` Pasi Kärkkäinen
3 siblings, 2 replies; 10+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-12-18 14:37 UTC (permalink / raw)
To: George Dunlap; +Cc: xen-devel@lists.xen.org, Ian Campbell, Roger Pau Monne
On Tue, Dec 18, 2012 at 02:06:56PM +0000, George Dunlap wrote:
> On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:
>
> > On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote:
> > > One of the requests from the xenorg.uservoice.com page that had a
> > > moderate amount of interest was to allow block devices to be resized.
> > > There's a description here:
> > >
> > >
> > https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize
> > >
> > >
> > > I have no idea what this would take -- can anyone comment?
> >
> > Doesn't that already work? I thought this was patch in the PV block
> > drivers ages ago...
> >
> > Yes, http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36.
> >
> > Maybe this is a missing feature of (lib)xl vs xend?
> >
>
> "xm help" doesn't show a "block-resize" command, nor does grepping through
> tools for "resize" turn up anything.
>
> Would someone be willing to do some investigation into whether such a
> command is implemented in the protocol, and what it would take to get a "xm
> block-resize" command working? (Not necessarily do it, but have an idea
> what probably needs to be done.)
Looking at the history it looks to be:
1fa73be6be65028a7543bba8f14474b42e064a1b which is
commit 1fa73be6be65028a7543bba8f14474b42e064a1b
Author: K. Y. Srinivasan <ksrinivasan@novell.com>
Date: Thu Mar 11 13:42:26 2010 -0800
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>
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 60006b7..f47b096 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)
unsigned int binfo;
int err;
- if ((info->connected == BLKIF_STATE_CONNECTED) ||
- (info->connected == BLKIF_STATE_SUSPENDED) )
+ switch (info->connected) {
+ 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", §ors);
+ 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;
+ }
dev_dbg(&info->xbdev->dev, "%s:%s.\n",
__func__, info->xbdev->otherend);
So it should be altering the 'sectors' value and just writting
the backend state from XenbusStateConnected to XenbusStateConnected.
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: Resizing block devices live?
2012-12-18 14:37 ` Konrad Rzeszutek Wilk
@ 2012-12-18 14:43 ` Ian Campbell
2012-12-18 14:51 ` Jan Beulich
1 sibling, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2012-12-18 14:43 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: George Dunlap, xen-devel@lists.xen.org, Roger Pau Monne
On Tue, 2012-12-18 at 14:37 +0000, Konrad Rzeszutek Wilk wrote:
>
> So it should be altering the 'sectors' value and just writting
> the backend state from XenbusStateConnected to XenbusStateConnected.
I wonder if anyone fancies patching xen/include/public/io/blkif.h to say
so.
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Resizing block devices live?
2012-12-18 14:37 ` Konrad Rzeszutek Wilk
2012-12-18 14:43 ` Ian Campbell
@ 2012-12-18 14:51 ` Jan Beulich
2012-12-18 15:58 ` Ian Campbell
1 sibling, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2012-12-18 14:51 UTC (permalink / raw)
To: George Dunlap, Konrad Rzeszutek Wilk
Cc: xen-devel@lists.xen.org, Ian Campbell, Roger Pau Monne
>>> On 18.12.12 at 15:37, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> So it should be altering the 'sectors' value and just writting
> the backend state from XenbusStateConnected to XenbusStateConnected.
Which is what the corresponding backend patch does (which for
upstream was separate because I think blkback wasn't upstream
yet back when KY did that work).
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Resizing block devices live?
2012-12-18 14:51 ` Jan Beulich
@ 2012-12-18 15:58 ` Ian Campbell
0 siblings, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2012-12-18 15:58 UTC (permalink / raw)
To: Jan Beulich
Cc: George Dunlap, Roger Pau Monne, xen-devel@lists.xen.org,
Konrad Rzeszutek Wilk
On Tue, 2012-12-18 at 14:51 +0000, Jan Beulich wrote:
> >>> On 18.12.12 at 15:37, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > So it should be altering the 'sectors' value and just writting
> > the backend state from XenbusStateConnected to XenbusStateConnected.
>
> Which is what the corresponding backend patch does (which for
> upstream was separate because I think blkback wasn't upstream
> yet back when KY did that work).
Looks like this was upstream, in the first version of the patch from the
looks of things.
I suspect it wasn't usable until 496b318eb655 which fixed a xenbus hang
on the second resize but that was in v3.0-rc1 so it ought to be ok...
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <CAFLBxZazULnr8PRN_4fshUAmuohyn2o4AcqpohdjxbmDnVStGQ@mail.gmail.com>]
* Re: Resizing block devices live?
[not found] ` <CAFLBxZazULnr8PRN_4fshUAmuohyn2o4AcqpohdjxbmDnVStGQ@mail.gmail.com>
@ 2012-12-18 15:50 ` George Dunlap
0 siblings, 0 replies; 10+ messages in thread
From: George Dunlap @ 2012-12-18 15:50 UTC (permalink / raw)
To: Ian Campbell, xen-devel@lists.xen.org
[-- Attachment #1.1: Type: text/plain, Size: 816 bytes --]
Oops, somehow forgot to cc the list here...
On Tue, Dec 18, 2012 at 2:13 PM, George Dunlap
<George.Dunlap@eu.citrix.com>wrote:
> On Tue, Dec 18, 2012 at 2:06 PM, George Dunlap <
> George.Dunlap@eu.citrix.com> wrote:
>
>> "xm help" doesn't show a "block-resize" command, nor does grepping
>> through tools for "resize" turn up anything.
>>
>
> According to the guy who submitted the patch that was accepted into
> 2.6.36: "My goal was to not have the end-user do anything other than what
> was minimally required to resizing the device on the host side. Once the
> device is resized on the host side, this capacity change is propagated to
> the guest without having to invoke any xm command."
>
> So in theory this should already work.
>
> I've asked the guy who submitted the request to test it.
>
> -George
>
[-- Attachment #1.2: Type: text/html, Size: 1774 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Resizing block devices live?
2012-12-18 14:06 ` George Dunlap
` (2 preceding siblings ...)
[not found] ` <CAFLBxZazULnr8PRN_4fshUAmuohyn2o4AcqpohdjxbmDnVStGQ@mail.gmail.com>
@ 2012-12-18 20:23 ` Pasi Kärkkäinen
3 siblings, 0 replies; 10+ messages in thread
From: Pasi Kärkkäinen @ 2012-12-18 20:23 UTC (permalink / raw)
To: George Dunlap
Cc: Roger Pau Monne, xen-devel@lists.xen.org, Ian Campbell,
Konrad Rzeszutek Wilk
On Tue, Dec 18, 2012 at 02:06:56PM +0000, George Dunlap wrote:
> On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell <[1]Ian.Campbell@citrix.com>
> wrote:
>
> On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote:
> > One of the requests from the [2]xenorg.uservoice.com page that had a
> > moderate amount of interest was to allow block devices to be resized.
> > There's a description here:
> >
> >
> [3]https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize
> >
> >
> > I have no idea what this would take -- can anyone comment?
>
> Doesn't that already work? I thought this was patch in the PV block
> drivers ages ago...
>
> Yes, [4]http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36.
>
> Maybe this is a missing feature of (lib)xl vs xend?
>
> "xm help" doesn't show a "block-resize" command, nor does grepping through
> tools for "resize" turn up anything.
>
> Would someone be willing to do some investigation into whether such a
> command is implemented in the protocol, and what it would take to get a
> "xm block-resize" command working? (Not necessarily do it, but have an
> idea what probably needs to be done.)
>
Resizing is supported automatically if running new enough blkback and blkfront!
Resize the backing LVM volume in dom0 and the domU will notice the disk has been resized.
There has been discussion (and patches) on xen-devel a couple of years ago.
-- Pasi
^ permalink raw reply [flat|nested] 10+ messages in thread