From: Ian Campbell Subject: Re: Xen guest disk online resize, xenstore/blkback/blkfront questions Date: Wed, 6 Jan 2010 20:44:25 +0000 Message-ID: <1262810665.28737.102.camel@localhost.localdomain> References: <20100106202631.GK25902@reaktio.net> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20100106202631.GK25902@reaktio.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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 o= r > 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: >=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 c= ould 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 You might need to close and reopen the block device?=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 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 fronte= nd > /local/domain/X/device/vbd/Y/ to notify the blkfront driver in the gu= est. >=20 > 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.