qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 5/5] block: Support GlusterFS as a QEMU block


From: Bharata B Rao
Subject: Re: [Qemu-devel] [PATCH v7 5/5] block: Support GlusterFS as a QEMU block backend.
Date: Thu, 20 Sep 2012 14:42:14 +0530
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 20, 2012 at 10:20:33AM +0200, Paolo Bonzini wrote:
> Il 20/09/2012 09:53, Paolo Bonzini ha scritto:
> >>>> Would look a bit nicer with strstart() form cutils.c instead of 
> >>>> strncmp().
> >> > strstart() works with const char pointers, but I have char pointers here
> >> > which I need to modify.
> > You can pass a char* to a function that accepts const char*.  In your
> > case, the last argument to strstart would be NULL.
> 
> As you pointed out on IRC, you meant the last argument.  I don't think
> it would be a problem to cast that from char ** to const char **.
> 
> Perhaps it would be cleaner to make qemu_gluster_parseuri and
> parse_gluster_spec accept a const char *.  You can replace strtok_r +
> g_strdup with strspn/strcspn followed by g_strndup.

I feel the current approach of using the combination of strncmp, strtok_r
and g_strdup should be good enough.

But if you feel and insist that the right way to do this is to use the
combination of strstart, strspn and g_strndup, I could give it a try.

Regards,
Bharata.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]