From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Amar Tumballi <amarts@redhat.com>,
Vijay Bellur <vbellur@redhat.com>,
Anand Avati <aavati@redhat.com>,
qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v4 2/2] block: Support GlusterFS as a QEMU block backend
Date: Thu, 2 Aug 2012 09:25:26 +0530 [thread overview]
Message-ID: <20120802035526.GG21697@in.ibm.com> (raw)
In-Reply-To: <CAAu8pHuP_YTwkMvV2MwR2z83zFCrMr=22spjNQ_Q3x6LLFbrWw@mail.gmail.com>
On Wed, Aug 01, 2012 at 06:35:22PM +0000, Blue Swirl wrote:
> > +
> > + if (!transport) {
> > + uri->transport = strdup("socket");
>
> g_strdup
Sorry about that, pitfalls of developing the parsing code out of line :(
> > +static int qemu_gluster_parseuri(GlusterURI *uri, const char *filename)
> > +{
> > + char *token, *saveptr;
> > + char *p, *r;
> > + int ret = -EINVAL;
> > +
> > + p = r = g_strdup(filename);
>
> Why?
- Are you asking why use 2 variables ? I need them because I loose p and
need r to free the string.
- Or are you asking why strdup ? That's because filename is const char *
and I need to modify the filename when parsing.
> > +static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
> > +{
> > + GlusterAIOCB *acb = (GlusterAIOCB *)arg;
> > + BDRVGlusterState *s = acb->common.bs->opaque;
> > +
> > + acb->ret = ret;
> > + if (qemu_gluster_send_pipe(s, acb) < 0) {
> > + error_report("Could not complete read/write/flush from gluster");
> > + abort();
>
> Aborting is a bit drastic, it would be nice to save and exit gracefully.
I am not sure if there is an easy way to recover sanely and exit from this
kind of error.
Here the non-QEMU thread (gluster thread) failed to notify the QEMU thread
on the read side of the pipe about the IO completion. So essentially
bdrv_read or bdrv_write will never complete if this error happens.
Do you have any suggestions on how to exit gracefully here ?
> > +static QEMUOptionParameter qemu_gluster_create_options[] = {
>
> 'const'?
Hmm no precedence of const usage for identical scenario in other block
drivers in QEMU.
>
> > + {
> > + .name = BLOCK_OPT_SIZE,
> > + .type = OPT_SIZE,
> > + .help = "Virtual disk size"
> > + },
> > + { NULL }
> > +};
> > +
> > +static BlockDriver bdrv_gluster = {
>
> 'const'?
Again dodn't see the precedence for this.
Thanks for your review.
Regards,
Bharata.
next prev parent reply other threads:[~2012-08-02 3:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 14:14 [Qemu-devel] [PATCH v4 0/2] GlusterFS support in QEMU - v4 Bharata B Rao
2012-08-01 14:15 ` [Qemu-devel] [PATCH v4 1/2] qemu: Add a config option for GlusterFS as block backend Bharata B Rao
2012-08-01 14:16 ` [Qemu-devel] [PATCH v4 2/2] block: Support GlusterFS as a QEMU " Bharata B Rao
2012-08-01 18:35 ` Blue Swirl
2012-08-02 3:55 ` Bharata B Rao [this message]
2012-08-03 15:57 ` Blue Swirl
2012-08-04 2:44 ` Bharata B Rao
2012-08-04 11:28 ` Blue Swirl
2012-08-02 10:31 ` [Qemu-devel] [PATCH v4 0/2] GlusterFS support in QEMU - v4 Stefan Hajnoczi
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=20120802035526.GG21697@in.ibm.com \
--to=bharata@linux.vnet.ibm.com \
--cc=aavati@redhat.com \
--cc=amarts@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
--cc=vbellur@redhat.com \
/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).