migration/hostmem: Allow to fail early for postcopy on specific fs type
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 7 repliesIn review
- v13 patches 3 repliesSuperseded
Changes in v2 from the cover letter
- Replace the hostmem patch to use qemu_fd_getfs() instead [David]
- Define enum instead of using string for fs type [Dan]
- One more patch added to deliver error to QMP response (rather than keeping some of it in STDERR), so the response should contain richer information and looks prettier.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | util/mmap-alloc: qemu_fd_getfs()include/ util/ | +35 | 2 replies | |
| 2/4 | vl.c: Create late backends before migration objectsoftmmu/ | +7 | 2 replies | |
| 3/4 | migration/postcopy: Detect file system on dest hostmigration/ | +30 | 1 reply | |
| 4/4 | migration: Allow postcopy_ram_supported_by_host() to report errmigration/ migration/ migration/ +1 more | +42 | 2 replies |
Reviews trailers per patch
3 of 4 patches have a Reviewed-by or Acked-by.
| Patch | David Hildenbrand | Juan Quintela |
|---|---|---|
| 1/4 | R-b | R-b |
| 2/4 | R-b | R-b |
| 3/4 | R-b | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/4] migration/hostmem: Allow to fail early for postcopy on specific fs type
v2:
- Replace the hostmem patch to use qemu_fd_getfs() instead [David]
- Define enum instead of using string for fs type [Dan]
- One more patch added to deliver error to QMP response (rather than keeping some of it in STDERR), so the response should contain richer information and looks prettier.
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=memqemu-system-x86_64: Postcopy is not supported: Host backend files need to be TMPFS or HUGETLBFS only
It will also fail e.g. QMP migrate-set-capabilities properly:
{ "execute": "migrate-set-capabilities" , "arguments": { "capabilities": [ { "capability": "postcopy-ram", "state": true } ] } } {"error": {"class": "GenericError", "desc": "Postcopy is not supported: Host backend files need to be TMPFS or HUGETLBFS only"}}
Please have a look, thanks.
Peter Xu (4):
util/mmap-alloc: qemu_fd_getfs()
vl.c: Create late backends before migration object migration/postcopy: Detect file system on dest host
migration: Allow postcopy_ram_supported_by_host() to report err
include/qemu/mmap-alloc.h | 7 +++ migration/migration.c | 9 ++-- migration/postcopy-ram.c | 89 +++++++++++++++++++++++++++------------ migration/postcopy-ram.h | 3 +- migration/savevm.c | 3 +- softmmu/vl.c | 9 +++- util/mmap-alloc.c | 28 ++++++++++++ 7 files changed, 111 insertions(+), 37 deletions(-)
Signature · 1 line
2.39.1