qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Fabiano Rosas <farosas@suse.de>, qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH 1/2] migration: Add a file_error argument to close_return_path_on_source()
Date: Fri, 2 Feb 2024 15:45:54 +0100	[thread overview]
Message-ID: <8e8d811d-9c72-428a-ac7f-3bac556d8585@redhat.com> (raw)
In-Reply-To: <875xz7hran.fsf@suse.de>

On 2/2/24 15:30, Fabiano Rosas wrote:
> Cédric Le Goater <clg@redhat.com> writes:
> 
>> close_return_path_on_source() retrieves the migration error from the
>> the QEMUFile '->to_dst_file' to know if a shutdown is required to exit
>> the return-path thread. However, in migrate_fd_cleanup(), '->to_dst_file'
>> is cleaned up before calling close_return_path_on_source() and the
>> shutdown is never performed, leaving the source and destination
>> waiting for an event to occur.
> 
> Isn't this just missing qemu_file_shutdown() at migrate_fd_cleanup?
> 
>      if (s->to_dst_file) {
>          ...
>          migration_ioc_unregister_yank_from_file(tmp);
> +       qemu_file_shutdown(tmp);
>          qemu_fclose(tmp);
>      }
> 

That would make the return-path thread exit indeed. It should not
be necessary when there are no errors though and this is done
outside of the close_return_path_on_source() helper. There could
be side effects.


I took into account Peter's comment and replaced the changes of
PATCH 1 with :

@@ -2372,8 +2372,7 @@ static bool close_return_path_on_source(
       * cause it to unblock if it's stuck waiting for the destination.
       */
      WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) {
-        if (ms->to_dst_file && ms->rp_state.from_dst_file &&
-            qemu_file_get_error(ms->to_dst_file)) {
+        if (migrate_has_error(ms) && ms->rp_state.from_dst_file) {
              qemu_file_shutdown(ms->rp_state.from_dst_file);
          }
      }

Nevertheless, we need to qemu_file_shutdown() correctly the socket
for this to work and the problem seems more complex than just moving
code as I did in PATCH 2.

Thanks,

C.




  reply	other threads:[~2024-02-02 14:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 18:48 [PATCH 0/2] migration: Fix return-path thread exit Cédric Le Goater
2024-02-01 18:48 ` [PATCH 1/2] migration: Add a file_error argument to close_return_path_on_source() Cédric Le Goater
2024-02-02 14:30   ` Fabiano Rosas
2024-02-02 14:45     ` Cédric Le Goater [this message]
2024-02-01 18:48 ` [PATCH 2/2] migration: Fix return-path thread exit Cédric Le Goater
2024-02-02 14:42   ` Fabiano Rosas
2024-02-02 14:51     ` Cédric Le Goater
2024-02-02 15:11       ` Fabiano Rosas
2024-02-05  3:37         ` Peter Xu
2024-02-05 10:17           ` Cédric Le Goater
2024-02-02  9:53 ` [PATCH 0/2] " Peter Xu
2024-02-02 13:04   ` Cédric Le Goater
2024-02-05 10:32   ` Daniel P. Berrangé
2024-02-06  2:42     ` Peter Xu

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=8e8d811d-9c72-428a-ac7f-3bac556d8585@redhat.com \
    --to=clg@redhat.com \
    --cc=farosas@suse.de \
    --cc=peterx@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).