qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fei Li <fli@suse.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, dgilbert@redhat.com,
	famz@redhat.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH RFC v6 5/7] migration: fix the multifd code when receiving less channels
Date: Wed, 31 Oct 2018 06:18:58 +0800	[thread overview]
Message-ID: <20181030221858.GB2032@xz-x1> (raw)
In-Reply-To: <0273e52f-ba16-fef0-22bc-bb3103dbdab2@suse.com>

On Tue, Oct 30, 2018 at 06:05:18PM +0800, Fei Li wrote:

[...]

> > > @@ -1366,6 +1373,10 @@ bool multifd_recv_new_channel(QIOChannel *ioc)
> > >                          QEMU_THREAD_JOINABLE);
> > >       atomic_inc(&multifd_recv_state->count);
> > >       return multifd_recv_state->count == migrate_multifd_channels();
> > > +fail:
> > > +    qemu_fclose(mis->from_src_file);
> > > +    mis->from_src_file = NULL;
> > > +    return false;
> > Do we need this?
> > 
> > I'd suggest to put all cleanups into a single function.  For dest vm
> > I say it's process_incoming_migration_bh.
> > 
> > Regards,
> > 
> Not sure whether I understand correctly, if multifd_recv_new_channel()
> fails,
> that means migration_incoming_process() will not be called, then
> process_incoming_migration_co() and process_incoming_migration_bh()
> will not be called either. In that way, there is no cleanup.

Sorry the funtion name I wanted to paste is something like
migration_incoming_state_destroy()...  Anyway I still don't feel that
right to close the mis->from_src_file in a multifd special path.

For now, I'll either ignore the cleanup part (AFAIU the TLS failure
will also ignore it when migration_tls_channel_process_incoming fails)
and just print the extra error message, or you can also look into how
to cleanup the dest vm in a better way.  That could be someting like
calling migration_incoming_state_destroy() somewhere in
migration_channel_process_incoming() when failure happens but I'm not
sure.

Regards,

-- 
Peter Xu

  reply	other threads:[~2018-10-30 22:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 12:58 [Qemu-devel] [PATCH RFC v6 0/7] qemu_thread_create: propagate errors to callers to check Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 1/7] Fix segmentation fault when qemu_signal_init fails Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 2/7] qemu_init_vcpu: add a new Error parameter to propagate Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 3/7] qemu_thread_join: fix segmentation fault Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 4/7] migration: fix some segmentation faults when using multifd Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 5/7] migration: fix the multifd code when receiving less channels Fei Li
2018-10-30  6:05   ` Peter Xu
2018-10-30 10:05     ` Fei Li
2018-10-30 22:18       ` Peter Xu [this message]
2018-10-31 12:26         ` Fei Li
2018-10-31 13:50   ` Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 6/7] migration: fix some error handling Fei Li
2018-10-30 19:49   ` Dr. David Alan Gilbert
2018-10-31 11:25     ` Fei Li
2018-10-31 16:30       ` Dr. David Alan Gilbert
2018-11-01  5:20         ` Fei Li
2018-10-29 12:58 ` [Qemu-devel] [PATCH RFC v6 7/7] qemu_thread_create: propagate the error to callers to handle Fei Li

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=20181030221858.GB2032@xz-x1 \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=famz@redhat.com \
    --cc=fli@suse.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).