From: Paul Durrant <Paul.Durrant@citrix.com>
To: Anthony Perard <anthony.perard@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] xen-block: handle resize callback
Date: Tue, 29 Jan 2019 13:27:57 +0000 [thread overview]
Message-ID: <d90fbb449fa04875ae7ec44d645c076a@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <20190129122514.GB2306@perard.uk.xensource.com>
> -----Original Message-----
> From: Anthony PERARD [mailto:anthony.perard@citrix.com]
> Sent: 29 January 2019 12:25
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: xen-devel@lists.xenproject.org; qemu-block@nongnu.org; qemu-
> devel@nongnu.org; Stefan Hajnoczi <stefanha@redhat.com>; Stefano
> Stabellini <sstabellini@kernel.org>; Kevin Wolf <kwolf@redhat.com>; Max
> Reitz <mreitz@redhat.com>
> 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) {
> case BLKIF_STATE_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 frontend.
Paul
>
> Thanks,
>
> --
> Anthony PERARD
prev parent reply other threads:[~2019-01-29 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 9:08 [Qemu-devel] [PATCH] xen-block: handle resize callback Paul Durrant
2019-01-29 12:25 ` Anthony PERARD
2019-01-29 13:27 ` Paul Durrant [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d90fbb449fa04875ae7ec44d645c076a@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).