qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jianjun Duan <duanj@linux.vnet.ibm.com>
Cc: veroniabahaa@gmail.com, peter maydell <peter.maydell@linaro.org>,
	mdroth@linux.vnet.ibm.com, mst@redhat.com, quintela@redhat.com,
	mark cave-ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, mreitz@redhat.com, blauwirbel@gmail.com,
	amit shah <amit.shah@redhat.com>,
	qemu-ppc@nongnu.org, kraxel@redhat.com, dmitry@daynix.com,
	kwolf@redhat.com, rth@twiddle.net,
	leon alrae <leon.alrae@imgtec.com>,
	aurelien@aurel32.net, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [QEMU RFC PATCH v3 4/6] Migration: migrate QTAILQ
Date: Wed, 1 Jun 2016 20:32:18 +0200	[thread overview]
Message-ID: <6b62efec-9c26-d84c-9999-83a8843dc3a9@redhat.com> (raw)
In-Reply-To: <574F15F8.8000400@linux.vnet.ibm.com>



On 01/06/2016 19:06, Jianjun Duan wrote:
> On 06/01/2016 08:29 AM, Paolo Bonzini wrote:
>> On 31/05/2016 23:53, Jianjun Duan wrote:
>>> On 05/31/2016 12:54 PM, Paolo Bonzini wrote:
>>>>> +/* put for QTAILQ */
>>>>> +static void put_qtailq(QEMUFile *f, void *pv, size_t unused_size,
>>>>> +                       VMStateField *field, QJSON *vmdesc)
>>>>> +{
>>>>> +    bool link = true;
>>>>> +    const VMStateDescription *vmsd = field->vmsd;
>>>>> +    size_t entry = field->start;
>>>>> +    void *elm;
>>>>> +
>>>>> +    if (vmdesc) {
>>>>> +        json_prop_str(vmdesc, "vmsd_name", vmsd->name);
>>>>> +        json_prop_int(vmdesc, "version", vmsd->version_id);
>>>>> +        json_start_array(vmdesc, "fields");
>>>>
>>>> You need to store the fields exactly once here, even if there are
>>>> 0 or >1 elements.
>>>>
>>> Do you mean the json entries? I think it is already doing that.
>>
>> In the case of 0 entries we don't go through the loop, so the JSON
>> entries are definitely missing in that case.  I'm not sure if QJSON
>> handles duplicates in the case of 2+ entries.
> 
> The vmsd here is the vmsd for the queue elements. Not for the queue.
> Maybe the stuff written here should be information about the qtailq
> instead, but we don't have a vmsd for the queue as a whole.

You're right, you could use vmsd_can_compress but it's not necessary to
do so.  Your code is fine.

Paolo

  reply	other threads:[~2016-06-01 18:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 18:02 [Qemu-devel] [QEMU RFC PATCH v3 0/6]Migration: ensure hotplug and migration work together Jianjun Duan
2016-05-31 18:02 ` [Qemu-devel] [QEMU RFC PATCH v3 1/6] Migration: Defined VMStateDescription struct for spapr_drc Jianjun Duan
2016-06-02  4:07   ` David Gibson
2016-06-03  0:28     ` Jianjun Duan
2016-06-03  1:48       ` David Gibson
2016-05-31 18:02 ` [Qemu-devel] [QEMU RFC PATCH v3 2/6] vmstate: Define VARRAY with VMS_ALLOC Jianjun Duan
2016-05-31 18:02 ` [Qemu-devel] [QEMU RFC PATCH v3 3/6] Migration: extend VMStateInfo Jianjun Duan
2016-05-31 18:02 ` [Qemu-devel] [QEMU RFC PATCH v3 4/6] Migration: migrate QTAILQ Jianjun Duan
2016-05-31 19:54   ` Paolo Bonzini
2016-05-31 21:53     ` Jianjun Duan
2016-06-01 15:29       ` Paolo Bonzini
2016-06-01 17:06         ` Jianjun Duan
2016-06-01 18:32           ` Paolo Bonzini [this message]
2016-06-02  3:58   ` David Gibson
2016-06-02 15:01   ` Sascha Silbe
2016-06-02 16:11     ` Jianjun Duan
2016-06-07 14:43       ` Dr. David Alan Gilbert
2016-06-07 16:31         ` Paolo Bonzini
2016-06-07 16:33           ` Michael S. Tsirkin
2016-06-07 16:34           ` Dr. David Alan Gilbert
2016-06-07 16:35             ` Paolo Bonzini
2016-06-07 16:46               ` Dr. David Alan Gilbert
2016-06-07 16:43         ` [Qemu-devel] [Qemu-ppc] " Jianjun Duan
2016-06-03 17:12     ` [Qemu-devel] " Jianjun Duan
2016-06-06 13:47     ` Paolo Bonzini
2016-05-31 18:02 ` [Qemu-devel] [QEMU RFC PATCH v3 5/6] Migration: migrate ccs_list in spapr state Jianjun Duan
2016-05-31 18:02 ` [Qemu-devel] [QEMU RFC PATCH v3 6/6] Migration: migrate pending_events of " Jianjun Duan

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=6b62efec-9c26-d84c-9999-83a8843dc3a9@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dmitry@daynix.com \
    --cc=duanj@linux.vnet.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=leon.alrae@imgtec.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=veroniabahaa@gmail.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).