qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.vnet.ibm.com>
To: quintela@redhat.com
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] s390x: vmstatify config migration for virtio-ccw
Date: Thu, 1 Jun 2017 11:45:53 +0200	[thread overview]
Message-ID: <00cb5dd9-7d21-a680-9d5e-401720e034c4@linux.vnet.ibm.com> (raw)
In-Reply-To: <87mv9sc2sk.fsf@secure.mitica>



On 05/31/2017 08:13 PM, Juan Quintela wrote:
> Halil Pasic <pasic@linux.vnet.ibm.com> wrote:
>> Let's vmstatify virtio_ccw_save_config and virtio_ccw_load_config for
>> flexibility (extending using subsections) and for fun.
>>
>> To achieve this we need to hack the config_vector, which is VirtIODevice
>> (that is common virtio) state, in the middle of the VirtioCcwDevice state
>> representation.  This somewhat ugly, but we have no choice because the
>> stream format needs to be preserved.
>>
>> Almost no changes in behavior. Exception is everything that comes with
>> vmstate like extra bookkeeping about what's in the stream, and maybe some
>> extra checks and better error reporting.
>>
>> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> 
> Reviewed-by: Juan Quintela <quintela@redhat.com>
> 
>> +static void subch_dev_pre_save(void *opaque)
>> +{
>> +    SubchDev *s = opaque;
>> +
>> +    /* Prepare remote_schid for save */
>> +    s->migrated_schid = s->schid;
>> +}
>> +
>> +static int subch_dev_post_load(void *opaque, int version_id)
>> +{
>> +
>> +    SubchDev *s = opaque;
>> +
>> +    /* Re-assign the subchannel to remote_schid if necessary */
>> +    if (s->migrated_schid != s->schid) {
>> +        if (css_find_subch(true, s->cssid, s->ssid, s->schid) == s) {
> 
> I am assuming this is somehow similar to
>    old_s = channel_subsys.css[s->cssid]->sch_set[s->ssid]->sch[old_schid];
> 

That's right. A quick glance at the return statement(s) of css_find_subch
makes it very obvious. But css_find_subch does some null checks and may
differently for cssid == 0 (which does not matter here).

>> -    qemu_put_be32(f, s->curr_status.pmcw.intparm);
>> -    qemu_put_be16(f, s->curr_status.pmcw.flags);
>> -    qemu_put_be16(f, s->curr_status.pmcw.devno);
>> -    qemu_put_byte(f, s->curr_status.pmcw.lpm);
>> -    qemu_put_byte(f, s->curr_status.pmcw.pnom);
>> -    qemu_put_byte(f, s->curr_status.pmcw.lpum);
>> -    qemu_put_byte(f, s->curr_status.pmcw.pim);
>> -    qemu_put_be16(f, s->curr_status.pmcw.mbi);
>> -    qemu_put_byte(f, s->curr_status.pmcw.pom);
>> -    qemu_put_byte(f, s->curr_status.pmcw.pam);
> 
> I hope it somehow makes sense, I am having trouble following that you
> have fields named: pim, pam, pom, pnom, lpm, lpum, mda, mba ..... looks
> like hell for reviewing O:-)
> 
> And I thought that x86 was weird because it used all three letters
> acronyms
> 
> O:-)

nod

> 
> Later, Juan.
> 

Many thanks for the review and the r-b!

Regards,
Halil

  reply	other threads:[~2017-06-01  9:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 13:17 [Qemu-devel] [PATCH 1/1] s390x: vmstatify config migration for virtio-ccw Halil Pasic
2017-05-31 16:00 ` Dr. David Alan Gilbert
2017-05-31 16:22   ` Halil Pasic
2017-05-31 18:13 ` Juan Quintela
2017-06-01  9:45   ` Halil Pasic [this message]
2017-06-01 10:52 ` Cornelia Huck
2017-06-01 11:02   ` Halil Pasic
2017-06-01 11:19     ` Christian Borntraeger
2017-06-01 11:28       ` Halil Pasic
2017-06-01 11:36         ` Christian Borntraeger

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=00cb5dd9-7d21-a680-9d5e-401720e034c4@linux.vnet.ibm.com \
    --to=pasic@linux.vnet.ibm.com \
    --cc=bjsdjshi@linux.vnet.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dgilbert@redhat.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).