qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, berrange@redhat.com, armbru@redhat.com,
	Claudio Fontana <cfontana@suse.de>, Jim Fehlig <jfehlig@suse.com>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v3 16/16] tests/qtest/migration: Add a test for mapped-ram with passing of fds
Date: Fri, 21 Jun 2024 10:16:20 -0400	[thread overview]
Message-ID: <ZnWLNFwBBMrFtaKk@x1n> (raw)
In-Reply-To: <87y16yiifn.fsf@suse.de>

On Fri, Jun 21, 2024 at 09:33:48AM -0300, Fabiano Rosas wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > On Mon, Jun 17, 2024 at 03:57:31PM -0300, Fabiano Rosas wrote:
> >> Add a multifd test for mapped-ram with passing of fds into QEMU. This
> >> is how libvirt will consume the feature.
> >> 
> >> There are a couple of details to the fdset mechanism:
> >> 
> >> - multifd needs two distinct file descriptors (not duplicated with
> >>   dup()) so it can enable O_DIRECT only on the channels that do
> >>   aligned IO. The dup() system call creates file descriptors that
> >>   share status flags, of which O_DIRECT is one.
> >> 
> >> - the open() access mode flags used for the fds passed into QEMU need
> >>   to match the flags QEMU uses to open the file. Currently O_WRONLY
> >>   for src and O_RDONLY for dst.
> >> 
> >> Note that fdset code goes under _WIN32 because fd passing is not
> >> supported on Windows.
> >> 
> >> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> >> ---
> >> - dropped Peter's r-b
> >> 
> >> - stopped removing the fdset at the end of the tests. The migration
> >> code should always cleanup after itself.
> >
> > Ah, that looks also ok.
> 
> I made a mistake here. We still need to require that the management
> layer explicitly removes the fds they added by calling qmp_remove_fd().
> 
> The reason I thought it was ok to not remove the fds was that after your
> suggestion to use monitor_fdset_free_if_empty() in patch 7, I mistakenly
> put monitor_fdset_free() instead. So the qmp_remove_fd() was not finding
> any fdsets and I thought that was QEMU removing everything. Which is
> silly, because the whole purpose of the patch is to not do that.
> 
> I think I'll just fix this in the migration tree. It's just a revert to
> v2 of this patch and the correction to patch 7.

Ah OK.  I thought you were talking about when QEMU exit()s, which should
cleanup everything too.

Personally I guess I kind of ignored that remove-fd api anyway being there
or not, as it seems nobody understand why it needs to exist in the first
place..

-- 
Peter Xu



      reply	other threads:[~2024-06-21 14:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 18:57 [PATCH v3 00/16] migration/mapped-ram: Add direct-io support Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 01/16] migration: Drop reference to QIOChannel if file seeking fails Fabiano Rosas
2024-06-17 19:17   ` Peter Xu
2024-06-17 18:57 ` [PATCH v3 02/16] migration: Fix file migration with fdset Fabiano Rosas
2024-06-22  4:21   ` Michael Tokarev
2024-06-23 15:44     ` Peter Xu
2024-06-17 18:57 ` [PATCH v3 03/16] tests/qtest/migration: Fix file migration offset check Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 04/16] tests/qtest/migration: Add a precopy file test with fdset Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 05/16] monitor: Drop monitor_fdset_dup_fd_find/_remove() Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 06/16] monitor: Introduce monitor_fdset_*free Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 07/16] monitor: Stop removing non-duplicated fds Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 08/16] monitor: Simplify fdset and fd removal Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 09/16] monitor: Report errors from monitor_fdset_dup_fd_add Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 10/16] io: Stop using qemu_open_old in channel-file Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 11/16] migration: Add direct-io parameter Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 12/16] migration/multifd: Add direct-io support Fabiano Rosas
2024-06-17 19:19   ` Peter Xu
2024-06-17 18:57 ` [PATCH v3 13/16] tests/qtest/migration: Add tests for file migration with direct-io Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 14/16] monitor: fdset: Match against O_DIRECT Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 15/16] migration: Add documentation for fdset with multifd + file Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 16/16] tests/qtest/migration: Add a test for mapped-ram with passing of fds Fabiano Rosas
2024-06-17 19:27   ` Peter Xu
2024-06-21 12:33     ` Fabiano Rosas
2024-06-21 14:16       ` Peter Xu [this message]

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=ZnWLNFwBBMrFtaKk@x1n \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cfontana@suse.de \
    --cc=farosas@suse.de \
    --cc=jfehlig@suse.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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).