From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Halil Pasic <pasic@linux.vnet.ibm.com>
Cc: Amit Shah <amit.shah@redhat.com>,
Juan Quintela <quintela@redhat.com>,
qemu-devel@nongnu.org, Guenther Hutzl <hutzl@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/2] migration: drop unused VMStateField.start
Date: Tue, 31 Jan 2017 20:00:17 +0000 [thread overview]
Message-ID: <20170131200016.GP2395@work-vm> (raw)
In-Reply-To: <b1f6f338-601f-8525-1f1b-cffdbe203453@linux.vnet.ibm.com>
* Halil Pasic (pasic@linux.vnet.ibm.com) wrote:
>
>
> On 10/20/2016 03:25 PM, Halil Pasic wrote:
> > diff --git a/migration/vmstate.c b/migration/vmstate.c
> > index fc29acf..8767e40 100644
> > --- a/migration/vmstate.c
> > +++ b/migration/vmstate.c
> > @@ -66,10 +66,10 @@ static void *vmstate_base_addr(void *opaque, VMStateField *field, bool alloc)
> > }
> > }
> > if (size) {
> > - *((void **)base_addr + field->start) = g_malloc(size);
> > + *(void **)base_addr = g_malloc(size);
> > }
> > }
> > - base_addr = *(void **)base_addr + field->start;
> > + base_addr = *(void **)base_addr;
> > }
> >
> > return base_addr;
> Hi!
>
> It is been a while, and IMHO this is still broken, and the
> VMSTATE_VBUFFER* macros are still only used with the start argument
> being zero.
>
> What changed is that with commit 94869d5c ("migration: migrate QTAILQ")
> from Jan 19 we have code actually using VMStateDecription.start -- but
> for something different (IMHO), as allocation is done by get_qtailq and
> not by vmstate_base_addr (as in case of VMSTATE_VBUFFER_ALLOC_UINT32).
> Thus I would need to update the commit message and keep the start field
> at least.
>
> But before I do so, I would like to ask the maintainers if there is
> interest in a change like this?
I think it's certainly worth fixing VMSTATE_BUFFER_ALLOC*; if it can't
use the start field properly then it should have the start parameter
removed.
I'll admit I can't remember the details of why field->start as an offset
didn't work; are the other macros that take a start value correct?
If we can't remove the start variable then it's probably not removing
the start parameter everywhere.
That alloc case looks the most unusual in that vmstate_base_addr()
function; I *think* the non-alloc case makes sense
(i.e. follow a pointer and then use an offset from that pointer?)
even if no one currently uses it.
Dave
> Regards,
> Halil
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2017-01-31 20:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 13:25 [Qemu-devel] [PATCH v2 0/2] remove unused VMSTateField.start Halil Pasic
2016-10-20 13:25 ` [Qemu-devel] [PATCH v2 1/2] tests/test-vmstate.c: add vBuffer test Halil Pasic
2016-10-20 13:25 ` [Qemu-devel] [PATCH v2 2/2] migration: drop unused VMStateField.start Halil Pasic
2017-01-30 15:28 ` Halil Pasic
2017-01-31 20:00 ` Dr. David Alan Gilbert [this message]
2017-02-01 13:02 ` Halil Pasic
2017-02-01 18:41 ` Dr. David Alan Gilbert
2016-10-20 13:48 ` [Qemu-devel] [PATCH v2 0/2] remove unused VMSTateField.start no-reply
2016-10-31 17:33 ` Halil Pasic
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=20170131200016.GP2395@work-vm \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=hutzl@linux.vnet.ibm.com \
--cc=pasic@linux.vnet.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 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.