qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 3/3] savevm: Convert loadvm handlers list to LIST
Date: Mon, 31 Aug 2009 19:27:55 -0300	[thread overview]
Message-ID: <20090831192755.4b011b4e@doriath> (raw)
In-Reply-To: <m3d46b3ac4.fsf@neno.mitica>

On Tue, 01 Sep 2009 00:08:43 +0200
Juan Quintela <quintela@redhat.com> wrote:

> Luiz Capitulino <lcapitulino@redhat.com> wrote:
> > On Fri, 28 Aug 2009 22:31:57 +0200
> > Juan Quintela <quintela@redhat.com> wrote:
> >
> >> 
> >> Signed-off-by: Juan Quintela <quintela@redhat.com>
> >> ---
> >>  savevm.c |   20 +++++++++++---------
> >>  1 files changed, 11 insertions(+), 9 deletions(-)
> >> 
> >> diff --git a/savevm.c b/savevm.c
> >> index baef277..9836c60 100644
> >> --- a/savevm.c
> >> +++ b/savevm.c
> >> @@ -1260,10 +1260,10 @@ static SaveStateEntry *find_se(const char *idstr, int instance_id)
> >>  }
> >> 
> >>  typedef struct LoadStateEntry {
> >> +    LIST_ENTRY(LoadStateEntry) entry;
> >>      SaveStateEntry *se;
> >>      int section_id;
> >>      int version_id;
> >> -    struct LoadStateEntry *next;
> >>  } LoadStateEntry;
> >> 
> >>  static int qemu_loadvm_state_v2(QEMUFile *f)
> >> @@ -1309,7 +1309,8 @@ static int qemu_loadvm_state_v2(QEMUFile *f)
> >> 
> >>  int qemu_loadvm_state(QEMUFile *f)
> >>  {
> >> -    LoadStateEntry *first_le = NULL;
> >> +    LIST_HEAD(, LoadStateEntry) loadvm_handlers;
> >
> >  You're missing the initialization here, spot this while
> > testing staging.
> 
> I looked at aio.c and guess what :)  No LIST_INIT() either.

 As we talked by irc, if you are referring to 'aio_handlers' it's
global, so it will be initialized to 0 by the kernel.

> My understanding is that it is not needed (but it is better to add it,
> just in case the implementation change).

 I'm getting a segfault when I try to loadvm, I can write a recipe
to reproduce if needed.

> #define LIST_HEAD_INITIALIZER(head)                                     \
>         { NULL }
> 
> #define LIST_INIT(head) do {                                            \
>         (head)->lh_first = NULL;                                        \
> } while (/*CONSTCOND*/0)
> 
> 
> This should be what it does without puting it.  Perhaps we should
> "correct" also the other users?

 Yes, IMHO. Not because it's a fix, but it's good practice to use the API
w/o making assumptions on its internals.

  reply	other threads:[~2009-08-31 22:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 20:31 [Qemu-devel] [PATCH 0/3] Bring savevm.c to the wonderful world of sys-queue.h Juan Quintela
2009-08-28 20:31 ` [Qemu-devel] [PATCH 1/3] savevm: Convert savevm handlers list to TAILQ Juan Quintela
2009-09-01  8:33   ` Gerd Hoffmann
2009-08-28 20:31 ` [Qemu-devel] [PATCH 2/3] Add LIST_FOREACH_SAFE() definition Juan Quintela
2009-08-28 20:31 ` [Qemu-devel] [PATCH 3/3] savevm: Convert loadvm handlers list to LIST Juan Quintela
2009-08-31 19:00   ` Luiz Capitulino
2009-08-31 22:08     ` [Qemu-devel] " Juan Quintela
2009-08-31 22:27       ` Luiz Capitulino [this message]
2009-09-01  0:25         ` Juan Quintela

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=20090831192755.4b011b4e@doriath \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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).