qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for 2.1] qemu_opts_append: Play nicely with Qemu


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH for 2.1] qemu_opts_append: Play nicely with QemuOptsList's head
Date: Thu, 26 Jun 2014 15:56:11 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 25.06.2014 um 15:46 hat Eric Blake geschrieben:
> On 06/25/2014 02:38 AM, Michal Privoznik wrote:
> > When running a libvirt test suite I've noticed the qemu-img is
> > crashing occasionally. Tracing the problem down led me to the
> > following valgrind output:
> 
> Thanks for tracking this! It has been reported in other threads, but
> yours is the first patch.
> 
> > The problem is apparently in the qemu_opts_append(). Well, if it
> > gets called twice or more. On the first call, when @dst is NULL
> > some initialization is done during which @dst->head list gets
> > initialized. The list is initialized in a way, so that the list
> > tail points at the list head. However, the next time
> > qemu_opts_append() is called for new options to be added,
> > g_realloc() may move @dst at new address making the old list tail
> 
> s/at new/to a new/
> 
> > point at invalid address. If that's the case we must update the
> > list pointers.
> > 
> > Signed-off-by: Michal Privoznik <address@hidden>
> > ---
> >  util/qemu-option.c | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Eric Blake <address@hidden>
> 
> 
> > +        need_head_update = true;
> > +    } else {
> > +        /* Moreover, even if dst is not NULL, the realloc may move it at a
> 
> s/at/to/

Thanks, fixed the comments and applied to the block branch.

Kevin

Attachment: pgpQoBO7VFHL2.pgp
Description: PGP signature


reply via email to

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