[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] xen-block: handle resize callback

From: Paul Durrant
Subject: Re: [Qemu-block] [PATCH] xen-block: handle resize callback
Date: Tue, 29 Jan 2019 13:27:57 +0000

> -----Original Message-----
> From: Anthony PERARD [mailto:address@hidden
> Sent: 29 January 2019 12:25
> To: Paul Durrant <address@hidden>
> Cc: address@hidden; address@hidden; qemu-
> address@hidden; Stefan Hajnoczi <address@hidden>; Stefano
> Stabellini <address@hidden>; Kevin Wolf <address@hidden>; Max
> Reitz <address@hidden>
> Subject: Re: [PATCH] xen-block: handle resize callback
> On Wed, Jan 23, 2019 at 09:08:49AM +0000, Paul Durrant wrote:
> > Some frontend drivers will handle dynamic resizing of PV disks, so set
> up
> > the BlockDevOps resize_cb() method during xen_block_realize() to allow
> > this to be done.
> "will": which drivers are you thinking about? The Linux one seems to be
> able to handle resize already.

Yes, that's what I meant by 'will'... it wasn't supposed to imply future tense. 
English can be confusing :-/

> About the Linux one, it check the new size only when the backend set
> its "state" to "connected" again.
> It's frontend seems to implement resize with
> 1fa73be6be65028a7543bba8f14474b42e064a1b.
> There is this is the source code:
>     static void blkfront_connect(struct blkfront_info *info)
>     {
>         // ...
>         switch (info->connected) {
>                 /*
>                  * Potentially, the back-end may be signalling
>                  * a capacity change; update the capacity.
>                  */
> In the backend, Linux does this:
>     xenbus_printf(xbt, dev->nodename, "sectors", "%llu", ...
>     /*
>      * Write the current state; we will use this to synchronize
>      * the front-end. If the current state is "connected" the
>      * front-end will get the new size information online.
>      */
>      xenbus_printf(xbt, dev->nodename, "state", "%d", dev->state);
> Maybe the QEMU backend needs do to the same thing, and write its current
> state again?

Yes, that can easily be done. The Windows frontend simply re-reads 'sectors' 
whenever it sees any change in the backend area (it watches the top level key 
rather than just the 'state' key).

> FreeBSD doesn't seems to care about resize.
> And there is nothing in blkif.h about resizing :(.

Nope, hence the discrepancy between the frontend implementations. I can send a 
patch to xen-devel to note the existing state of affairs and perhaps 
standardize on the re-writing of 'state' being the official way to inform the 


> Thanks,
> --
> Anthony PERARD

reply via email to

[Prev in Thread] Current Thread [Next in Thread]