qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>,
	Juan Quintela <quintela@redhat.com>,
	Amit Shah <amit.shah@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Is block_save_iterate() dead code? (was: migration: Fix return code of ram_save_iterate() )
Date: Fri, 16 Dec 2016 17:03:57 +0000	[thread overview]
Message-ID: <20161216170357.GD2642@work-vm> (raw)
In-Reply-To: <401600f0-8a1c-22c7-b9f3-7424426ec699@redhat.com>

* Thomas Huth (thuth@redhat.com) wrote:
> On 18.11.2016 09:13, Thomas Huth wrote:
> > On 17.11.2016 04:45, David Gibson wrote:
> >> On Mon, Nov 14, 2016 at 07:34:59PM +0100, Juan Quintela wrote:
> >>> Thomas Huth <thuth@redhat.com> wrote:
> >>>> qemu_savevm_state_iterate() expects the iterators to return 1
> >>>> when they are done, and 0 if there is still something left to do.
> >>>> However, ram_save_iterate() does not obey this rule and returns
> >>>> the number of saved pages instead. This causes a fatal hang with
> >>>> ppc64 guests when you run QEMU like this (also works with TCG):
> >>>>
> >>>>  qemu-img create -f qcow2  /tmp/test.qcow2 1M
> >>>>  qemu-system-ppc64 -nographic -nodefaults -m 256 \
> >>>>                    -hda /tmp/test.qcow2 -serial mon:stdio
> >>>>
> >>>> ... then switch to the monitor by pressing CTRL-a c and try to
> >>>> save a snapshot with "savevm test1" for example.
> >>>>
> >>>> After the first iteration, ram_save_iterate() always returns 0 here,
> >>>> so that qemu_savevm_state_iterate() hangs in an endless loop and you
> >>>> can only "kill -9" the QEMU process.
> >>>> Fix it by using proper return values in ram_save_iterate().
> >>>>
> >>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
> >>>
> >>> Reviewed-by: Juan Quintela <quintela@redhat.com>
> >>>
> >>> Applied.
> >>>
> >>> I don't know how we broked this so much.
> >>
> >> Note that block save iterate has the same bug...
> > 
> > I think you're right. Care to send a patch?
> 
> Looking at this issue again ... could it be that block_save_iterate() is
> currently just dead code?
> As far as I can see, the ->save_live_iterate() handlers are only called
> from qemu_savevm_state_iterate(), right? And qemu_savevm_state_iterate()
> only calls the handlers if se->ops->is_active(se->opaque) returns true.
> But block_is_active() seems to only return 0 during savevm, most likely
> because qemu_savevm_state() explicitly sets the "blk" and "shared"
> MigrationParams to zero.
> So to me, it looks like we could also just remove block_save_iterate()
> completely ... or did I miss something here?

Doesn't it get called by migrate -b ?

Dave

>  Thomas
> 
> 



--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2016-12-16 17:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04 13:10 [Qemu-devel] [PATCH for-2.8] migration: Fix return code of ram_save_iterate() Thomas Huth
2016-11-08  1:14 ` David Gibson
2016-11-08  6:57   ` Thomas Huth
2016-11-09  7:18 ` Amit Shah
2016-11-09  7:46   ` Thomas Huth
2016-11-09 13:08     ` David Gibson
2016-11-09 15:13     ` Dr. David Alan Gilbert
2016-11-09 15:28       ` Thomas Huth
2016-11-09 15:32         ` Dr. David Alan Gilbert
2016-11-14 18:34 ` Juan Quintela
2016-11-17  3:45   ` David Gibson
2016-11-18  8:13     ` Thomas Huth
2016-12-16 16:55       ` [Qemu-devel] Is block_save_iterate() dead code? (was: migration: Fix return code of ram_save_iterate() ) Thomas Huth
2016-12-16 17:03         ` Dr. David Alan Gilbert [this message]
2016-12-19 16:30           ` [Qemu-devel] Is block_save_iterate() dead code? Thomas Huth
2016-12-19 20:19             ` John Snow

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=20161216170357.GD2642@work-vm \
    --to=dgilbert@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@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).