qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] migration/hostmem: Allow to fail early for postcopy on specific fs type
@ 2023-04-18 22:57 Peter Xu
  2023-04-18 22:57 ` [PATCH 1/3] hostmem: Detect and cache fs type for file hostmem Peter Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Xu @ 2023-04-18 22:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Paolo Bonzini, Juan Quintela,
	Leonardo Bras Soares Passos, peterx

Postcopy can fail in a weird way when guest mem is put onto a random file:

https://bugzilla.redhat.com/show_bug.cgi?id=2057267

It's because we only check userfault privilege on dest QEMU but don't check
memory types.  We do so only until the UFFDIO_REGISTER right after we
switch to postcopy live migration from precopy but it could be too late.

This series tries to make it fail early by checking ramblock fs type if
backed by a memory-backend-file.

Now when it happens it'll fail the dest QEMU from the start:

./qemu-system-x86_64 \
        -global migration.x-postcopy-ram=on \
        -incoming defer \
        -object memory-backend-file,id=mem,size=128M,mem-path=$memfile \
        -machine memory-backend=mem

qemu-system-x86_64: Host backend files need to be TMPFS or HUGETLBFS only
qemu-system-x86_64: Postcopy is not supported

It will also fail e.g. QMP migrate-set-capabilities properly.

Please have a look, thanks.

Peter Xu (3):
  hostmem: Detect and cache fs type for file hostmem
  vl.c: Create late backends before migration object
  migration/postcopy: Detect file system on dest host

 backends/hostmem-file.c  | 37 ++++++++++++++++++++++++++++++++++++-
 include/sysemu/hostmem.h |  1 +
 migration/postcopy-ram.c | 28 ++++++++++++++++++++++++----
 softmmu/vl.c             |  9 +++++++--
 4 files changed, 68 insertions(+), 7 deletions(-)

-- 
2.39.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-19 14:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 22:57 [PATCH 0/3] migration/hostmem: Allow to fail early for postcopy on specific fs type Peter Xu
2023-04-18 22:57 ` [PATCH 1/3] hostmem: Detect and cache fs type for file hostmem Peter Xu
2023-04-19  7:01   ` Daniel P. Berrangé
2023-04-19  7:28   ` David Hildenbrand
2023-04-19 14:46     ` Peter Xu
2023-04-18 22:57 ` [PATCH 2/3] vl.c: Create late backends before migration object Peter Xu
2023-04-18 22:57 ` [PATCH 3/3] migration/postcopy: Detect file system on dest host Peter Xu

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).