All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ján Tomko" <jtomko@redhat.com>
To: Jim Fehlig <jfehlig@suse.com>
Cc: libvirt-list@redhat.com, xen-devel@lists.xen.org
Subject: Re: [libvirt] [PATCH V2 4/4] libxl: add support for rbd qdisk
Date: Mon, 22 Feb 2016 15:35:23 +0100	[thread overview]
Message-ID: <20160222143523.GF2228@dnr.brq.redhat.com> (raw)
In-Reply-To: <1455755625-13329-5-git-send-email-jfehlig@suse.com>

On Wed, Feb 17, 2016 at 05:33:45PM -0700, Jim Fehlig wrote:
> xl/libxl already supports qemu's network-based block backends
> such as nbd and rbd. libvirt has supported configuring such
> <disk>s for long time too. This patch adds support for rbd
> disks in the libxl driver by generating a rbd device URL from
> the virDomainDiskDef object. The URL is passed to libxl via the
> pdev_path field of libxl_device_disk struct. libxl then passes
> the URL to qemu for cosumption by the rbd backend.
> 
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
>  src/libxl/libxl_conf.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 191 insertions(+), 1 deletion(-)
> 

ACK with the whitespace fix.

> +
> +static int
> +libxlMakeNetworkDiskSrc(virStorageSourcePtr src, char **srcstr)
> +{
> +    virConnectPtr conn = NULL;
> +    char *secret = NULL;
> +    char *username = NULL;
> +    int ret = -1;
> +
> +    *srcstr = NULL;
> +    if (src->auth && src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD) {
> +        const char *protocol = virStorageNetProtocolTypeToString(src->protocol);
> +
> +        username = src->auth->username;
> +        if (!(conn = virConnectOpen("xen:///system")))
> +            goto cleanup;
> +

Opening a connection feels out of place in this function, but I see it's
already done for NICs.

It would be nice to reuse it as is done in the qemu driver.

> +        if (!(secret = libxlGetSecretString(conn,
> +                                            protocol,
> +                                            true,
> +                                            src->auth,
> +                                            VIR_SECRET_USAGE_TYPE_CEPH)))
> +            goto cleanup;
> +    }
> +
> +    if (!(*srcstr = libxlMakeNetworkDiskSrcStr(src, username, secret)))
> +            goto cleanup;

The indentation looks off here.

Jan

  reply	other threads:[~2016-02-22 14:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18  0:33 [PATCH V2 0/4] libxl: support qemu's network-based block backends Jim Fehlig
2016-02-18  0:33 ` [PATCH V2 1/4] xenconfig: replace text 'xm' with 'xl' in xlconfigtest Jim Fehlig
2016-02-22 14:15   ` [libvirt] " Ján Tomko
2016-02-18  0:33 ` [PATCH V2 2/4] xenconfig: produce key=value disk config syntax in xl formatter Jim Fehlig
2016-02-22 14:16   ` [libvirt] " Ján Tomko
2016-02-18  0:33 ` [PATCH V2 3/4] xenconfig: support xl<->xml conversion of rbd disk devices Jim Fehlig
2016-02-22 14:22   ` [libvirt] " Ján Tomko
2016-02-18  0:33 ` [PATCH V2 4/4] libxl: add support for rbd qdisk Jim Fehlig
2016-02-22 14:35   ` Ján Tomko [this message]
2016-02-23  3:34     ` [libvirt] " Jim Fehlig
2016-02-23 23:46     ` Jim Fehlig
2016-02-24  4:11     ` Jim Fehlig
2016-02-18 10:51 ` [PATCH V2 0/4] libxl: support qemu's network-based block backends Ian Campbell
     [not found] ` <1455792671.6225.28.camel@citrix.com>
2016-02-22 19:08   ` Jim Fehlig

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=20160222143523.GF2228@dnr.brq.redhat.com \
    --to=jtomko@redhat.com \
    --cc=jfehlig@suse.com \
    --cc=libvirt-list@redhat.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.