WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Xen guest disk online resize, xenstore/blkback/blkfront

To: Pasi Kärkkäinen <pasik@xxxxxx>
Subject: Re: [Xen-devel] Xen guest disk online resize, xenstore/blkback/blkfront questions
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Wed, 6 Jan 2010 20:44:25 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 06 Jan 2010 12:44:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100106202631.GK25902@xxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <20100106202631.GK25902@xxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2010-01-06 at 20:26 +0000, Pasi Kärkkäinen wrote:
[...] 
> Is this more or less correct? Please correct if I've missed something or
> understood something wrong.

All sounds vaguely familiar, although it's been a while since I last had
to follow those twisty paths around...

> So, what I need to do next:
> 
> - LVM online-resize the guest disk LV in dom0.
> 
> - write something to xenstore block device backend structures, 
>   to get the blkback driver notified about the 'block-resize'.
> 
>   Should I add a new xenbus_watch for some, say, 'resize' field, so I could 
> get
>   callback to blkback device_resize() easily when xenstore is updated? 
> 
> - blkback driver then needs to update/fetch the new size of the vbd, 
>   and update the xenstore /local/domain/0/backend/vbd/X/sectors field.
> 
>   Any problems getting the new size/sectors on-the-fly in the kernel? 

You might need to close and reopen the block device? 

Idle speculation: perhaps instead of an explicit "resize" field in
xenstore you could just have the backend continue watching the
'physical-device' node even after everything is connected the first time
and if it is rewritten (including to the same value) reopening the
physical device and setting things up again (picking up a size change as
a side effect).

There's no particular reason why the physical device couldn't change
over this operation either, you could maybe imagine changing to a
different device mapper node (e.g. perhaps some sort of wierd snapshot
mechanism?) or perhaps implementing some sort of PV-CDROM media change
in the same way.

> - blkback then needs to write something to xenstore block device frontend
>   /local/domain/X/device/vbd/Y/ to notify the blkfront driver in the guest.
> 
>   Same thing here, should blkfront have a watch for some 'resize' field
>   or so?

blkfront can probably just watch /local/domain/0/backend/vbd/X/sectors

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel