All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Fabiano Rosas <farosas@suse.de>,
	qemu-devel@nongnu.org, berrange@redhat.com, armbru@redhat.com,
	Claudio Fontana <cfontana@suse.de>, Jim Fehlig <jfehlig@suse.com>,
	Prasad Pandit <pjp@fedoraproject.org>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [PATCH v3 02/16] migration: Fix file migration with fdset
Date: Sun, 23 Jun 2024 11:44:52 -0400	[thread overview]
Message-ID: <ZnhC9HT2RwBj5L3Y@x1n> (raw)
In-Reply-To: <addd7e3d-c56a-4e4d-abef-52243fe6120c@tls.msk.ru>

On Sat, Jun 22, 2024 at 07:21:52AM +0300, Michael Tokarev wrote:
> 17.06.2024 21:57, Fabiano Rosas wrote:
> > When the "file:" migration support was added we missed the special
> > case in the qemu_open_old implementation that allows for a particular
> > file name format to be used to refer to a set of file descriptors that
> > have been previously provided to QEMU via the add-fd QMP command.
> > 
> > When using this fdset feature, we should not truncate the migration
> > file because being given an fd means that the management layer is in
> > control of the file and will likely already have some data written to
> > it. This is further indicated by the presence of the 'offset'
> > argument, which indicates the start of the region where QEMU is
> > allowed to write.
> > 
> > Fix the issue by replacing the O_TRUNC flag on open by an ftruncate
> > call, which will take the offset into consideration.
> > 
> > Fixes: 385f510df5 ("migration: file URI offset")
> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> > Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>
> > Reviewed-by: Peter Xu <peterx@redhat.com>
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> > Signed-off-by: Fabiano Rosas <farosas@suse.de>
> > ---
> >   migration/file.c | 11 +++++++++--
> >   1 file changed, 9 insertions(+), 2 deletions(-)
> 
> Is it a stable material?

I suppose yes. Thanks.

-- 
Peter Xu



  reply	other threads:[~2024-06-23 15:45 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 [this message]
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

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=ZnhC9HT2RwBj5L3Y@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=mjt@tls.msk.ru \
    --cc=pjp@fedoraproject.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.