qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, Jianjun Duan <duanj@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PULL 02/15] migration: extend VMStateInfo
Date: Wed, 1 Feb 2017 11:18:14 +0100	[thread overview]
Message-ID: <20170201111814.45c9e204.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <20170127182035.GC5919@work-vm>

On Fri, 27 Jan 2017 18:20:36 +0000
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:

> * Cornelia Huck (cornelia.huck@de.ibm.com) wrote:
> > On Wed, 25 Jan 2017 14:44:20 +0000
> > "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> > 
> > > * Cornelia Huck (cornelia.huck@de.ibm.com) wrote:
> > > > On Wed, 25 Jan 2017 13:22:55 +0000
> > > > "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> > > > 
> > > > > * Cornelia Huck (cornelia.huck@de.ibm.com) wrote:
> > > > > > On Wed, 25 Jan 2017 12:00:53 +0000
> > > > > > "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> > 
> > > > > > > OK, so it looks like that's a failure path, adding a return -ENOMEM would seem to make
> > > > > > > sense there.
> > > > > > 
> > > > > > Just saw this. I don't think we want -ENOMEM, as that would change the
> > > > > > actual state being saved, no?
> > > > > 
> > > > > But isn't that the intention of this function?
> > > > > 
> > > > >     buf = g_try_malloc0(len);
> > > > >     if (!buf) {
> > > > >         /* Storing FLIC_FAILED into the count field here will cause the
> > > > >          * target system to fail when attempting to load irqs from the
> > > > >          * migration state */
> > > > >         error_report("flic: couldn't allocate memory");
> > > > >         qemu_put_be64(f, FLIC_FAILED);
> > > > >         return;
> > > > >     }
> > > > > 
> > > > > What should happen on the destination - should the migration fail?
> > > > > If we want the migration to fail then we should now return an error
> > > > > status rather than 0, and then we see a failed migration on the source
> > > > > as well.
> > > > 
> > > > Yes. There's also another error case below where we should return an
> > > > error instead of putting FLIC_FAILED, then.
> > > > 
> > > > The problem is that this is rather hard to test: So I'd prefer to fix
> > > > the compile for now and introduce error return codes in a separate
> > > > patch.
> > > 
> > > OK, that's fair.
> > 
> > I've coded something up and tried to test it with error injection to
> > trigger the failed case, but I can't really see an improvement :(
> > 
> > Before: source logs error, target fails to load the flic with 'invalid
> > argument'
> > 
> > After: source logs error, target fails to load the flic with 'could not
> > allocate memory'
> > 
> > The migration code does not seem to do anything with the return code of
> > put methods for now, so that's not too surprising. Is anything in the
> > works?
> 
> OK, I hadn't remembered that wasn't wired up.
> 
> > For now, I'd prefer to keep the old behaviour as 'invalid argument'
> > seems like a more obvious error on the target.
> 
> Yes, agreed.
> 
> If you feel like, then I'd just change the return -ENOMEM but still
> send the FLIC_FAILED.  That way the destination still fails
> as before, and the destination will fail nicely when we wire up the
> error checks.

Yes, having both FLIC_FAILED and a nonzero return code looks like the
best approach for now.

  reply	other threads:[~2017-02-01 10:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 18:47 [Qemu-devel] [PULL 00/15] migration queue Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 01/15] MAINTAINERS: Add myself as a migration submaintainer Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 02/15] migration: extend VMStateInfo Dr. David Alan Gilbert (git)
2017-01-25 11:46   ` Fam Zheng
2017-01-25 12:00     ` Dr. David Alan Gilbert
2017-01-25 12:07       ` Cornelia Huck
2017-01-25 12:12       ` Fam Zheng
2017-01-25 12:19       ` Cornelia Huck
2017-01-25 13:22         ` Dr. David Alan Gilbert
2017-01-25 14:20           ` Cornelia Huck
2017-01-25 14:44             ` Dr. David Alan Gilbert
2017-01-26 12:14               ` Cornelia Huck
2017-01-27 18:20                 ` Dr. David Alan Gilbert
2017-02-01 10:18                   ` Cornelia Huck [this message]
2017-01-24 18:47 ` [Qemu-devel] [PULL 03/15] migration: migrate QTAILQ Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 04/15] tests/migration: Add test for QTAILQ migration Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 05/15] migration: add error_report Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 06/15] block/vvfat: Remove the undesirable comment Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 07/15] migration: Add a new option to enable only-migratable Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 08/15] migration: Allow "device add" options to only add migratable devices Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 09/15] migration: disallow migrate_add_blocker during migration Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 10/15] migration: Fail migration blocker for --only-migratable Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 11/15] migration: re-active images while migration been canceled after inactive them Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 12/15] migration: Change name of live migration thread Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 13/15] PCI/migration merge vmstate_pci_device and vmstate_pcie_device Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 14/15] migration: transform remaining DPRINTF into trace_ Dr. David Alan Gilbert (git)
2017-01-24 18:47 ` [Qemu-devel] [PULL 15/15] migration/tracing: Add tracing on save Dr. David Alan Gilbert (git)
2017-01-25 10:41 ` [Qemu-devel] [PULL 00/15] migration queue Peter Maydell

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=20170201111814.45c9e204.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=dgilbert@redhat.com \
    --cc=duanj@linux.vnet.ibm.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).