From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: Xen guest disk online resize, xenstore/blkback/blkfront questions Date: Wed, 6 Jan 2010 23:57:35 +0200 Message-ID: <20100106215735.GM25902@reaktio.net> References: <20100106202631.GK25902@reaktio.net> <1262810665.28737.102.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1262810665.28737.102.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Wed, Jan 06, 2010 at 08:44:25PM +0000, Ian Campbell wrote: > On Wed, 2010-01-06 at 20:26 +0000, Pasi K=E4rkk=E4inen wrote: > [...]=20 > > Is this more or less correct? Please correct if I've missed something= or > > understood something wrong. >=20 > All sounds vaguely familiar, although it's been a while since I last ha= d > to follow those twisty paths around... >=20 > > So, what I need to do next: > >=20 > > - LVM online-resize the guest disk LV in dom0. > >=20 > > - write something to xenstore block device backend structures,=20 > > to get the blkback driver notified about the 'block-resize'. > >=20 > > 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= ?=20 > >=20 > > - blkback driver then needs to update/fetch the new size of the vbd,=20 > > and update the xenstore /local/domain/0/backend/vbd/X/sectors field= . > >=20 > > Any problems getting the new size/sectors on-the-fly in the kernel?= =20 >=20 > You might need to close and reopen the block device?=20 >=20 > 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 tim= e > and if it is rewritten (including to the same value) reopening the > physical device and setting things up again (picking up a size change a= s > a side effect). >=20 Good idea. I'll experiment with this. > 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. >=20 > > - blkback then needs to write something to xenstore block device fron= tend > > /local/domain/X/device/vbd/Y/ to notify the blkfront driver in the = guest. > >=20 > > Same thing here, should blkfront have a watch for some 'resize' fie= ld > > or so? >=20 > blkfront can probably just watch /local/domain/0/backend/vbd/X/sectors >=20 Sounds good.=20 Thanks for the reply! -- Pasi