From: Anthony PERARD <anthony.perard@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
xen-devel@lists.xenproject.org, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [Qemu-devel] [PATCH v9 16/18] xen: automatically create XenBlockDevice-s
Date: Wed, 9 Jan 2019 12:09:16 +0000 [thread overview]
Message-ID: <20190109120916.GI1508@perard.uk.xensource.com> (raw)
In-Reply-To: <20190108144903.8249-17-paul.durrant@citrix.com>
On Tue, Jan 08, 2019 at 02:49:01PM +0000, Paul Durrant wrote:
> This patch adds create and destroy function for XenBlockDevice-s so that
> they can be created automatically when the Xen toolstack instantiates a new
> PV backend via xenstore. When the XenBlockDevice is created this way it is
> also necessary to create a 'drive' which matches the configuration that the
> Xen toolstack has written into xenstore. This is done by formulating the
> parameters necessary for each 'blockdev' layer of the drive and then using
> qmp_blockdev_add() to create the layers. Also, for compatibility with the
> legacy 'xen_disk' implementation, an iothread is automatically created for
> the new XenBlockDevice. This, like the driver layers, will be destroyed
> after the XenBlockDevice is unrealized.
>
> The legacy backend scan for 'qdisk' is removed by this patch, which makes
> the 'xen_disk' code is redundant. The code will be removed by a subsequent
> patch.
>
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Signed-off-by: Anthony Perard <anthony.perard@citrix.com>
> ---
> diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
> index a7c37c185a..c6ec1d9543 100644
> --- a/hw/block/xen-block.c
> +++ b/hw/block/xen-block.c
> @@ -7,12 +7,20 @@
...
> +static XenBlockDrive *xen_block_drive_create(const char *id,
> + const char *device_type,
> + QDict *opts, Error **errp)
> +{
...
> + Error *local_err = NULL;
...
> + if (!filename) {
> + error_setg(errp, "no filename");
> + goto done;
> + }
...
> + drive->node_name = xen_block_blockdev_add(drive->id, driver_layer,
> + &local_err);
> +
> +done:
> + g_free(driver);
> + g_free(filename);
> +
> + if (local_err) {
When xen_block_blockdev_add failed, it sets local_err, but nothing after
sets errp. I'm going to add this while preparing the pull request:
error_propagate(errp, local_err);
Is this fine with you?
With that fix, I think the series is ready, so:
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
> + xen_block_drive_destroy(drive, NULL);
> + return NULL;
> + }
> +
> + return drive;
> +}
There is still the warning about using the 'file' driver when
'host_device' should be use, but I think we can try to fix that later.
Thanks,
--
Anthony PERARD
next prev parent reply other threads:[~2019-01-09 12:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 14:48 [Qemu-devel] [PATCH v9 00/18] Xen PV backend 'qdevification' Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 01/18] xen: re-name XenDevice to XenLegacyDevice Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 02/18] xen: introduce new 'XenBus' and 'XenDevice' object hierarchy Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 03/18] xen: introduce 'xen-block', 'xen-disk' and 'xen-cdrom' Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 04/18] xen: create xenstore areas for XenDevice-s Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 05/18] xen: add xenstore watcher infrastructure Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 06/18] xen: add grant table interface for XenDevice-s Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 07/18] xen: add event channel " Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 08/18] xen: duplicate xen_disk.c as basis of dataplane/xen-block.c Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 09/18] xen: remove unnecessary code from dataplane/xen-block.c Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 10/18] xen: add header and build dataplane/xen-block.c Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 11/18] xen: remove 'XenBlkDev' and 'blkdev' names from dataplane/xen-block Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 12/18] xen: remove 'ioreq' struct/varable/field names from dataplane/xen-block.c Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 13/18] xen: purge 'blk' and 'ioreq' from function names in dataplane/xen-block.c Paul Durrant
2019-01-08 14:48 ` [Qemu-devel] [PATCH v9 14/18] xen: add implementations of xen-block connect and disconnect functions Paul Durrant
2019-01-08 14:49 ` [Qemu-devel] [PATCH v9 15/18] xen: add a mechanism to automatically create XenDevice-s Paul Durrant
2019-01-08 14:49 ` [Qemu-devel] [PATCH v9 16/18] xen: automatically create XenBlockDevice-s Paul Durrant
2019-01-09 12:09 ` Anthony PERARD [this message]
2019-01-09 12:30 ` Paul Durrant
2019-01-08 14:49 ` [Qemu-devel] [PATCH v9 17/18] MAINTAINERS: add myself as a Xen maintainer Paul Durrant
2019-01-08 14:49 ` [Qemu-devel] [PATCH v9 18/18] xen: remove the legacy 'xen_disk' backend Paul Durrant
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=20190109120916.GI1508@perard.uk.xensource.com \
--to=anthony.perard@citrix.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=paul.durrant@citrix.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--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).