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

Re: [Xen-devel] [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.

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?

FreeBSD doesn't seems to care about resize.

And there is nothing in blkif.h about resizing :(.

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.