[PATCH 0/6] qemu: Avoid use of regular file FDs with qemu's 'fd:' migration backend

Peter Krempa via Devel posted 6 patches 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1771343375.git.pkrempa@redhat.com
src/libvirt_private.syms  |   1 +
src/qemu/qemu_driver.c    | 254 +++++++++++++++++++-------------------
src/qemu/qemu_migration.c |   2 +-
src/qemu/qemu_monitor.c   |   6 +-
src/qemu/qemu_monitor.h   |   1 -
src/qemu/qemu_saveimage.c |  48 +++++--
src/qemu/qemu_saveimage.h |   6 +-
src/qemu/qemu_snapshot.c  |  12 +-
src/util/virfile.c        |   8 ++
src/util/virfile.h        |   1 +
10 files changed, 191 insertions(+), 148 deletions(-)
[PATCH 0/6] qemu: Avoid use of regular file FDs with qemu's 'fd:' migration backend
Posted by Peter Krempa via Devel 1 week, 6 days ago
When reverting a save image in the most naive case libvirt would still
try to use a regular file FD with the 'fd:' migration backend in qemu
which will no longer work as of qemu-11.0.

This patchet addresses it by using the filewrapper for all cases to pass
pipes to 'fd' instead.

In addition this patchset also adds a check that if 'sparse' save image
format is used which requires the 'file' backend in qemu that a regular
file FD is indeed passed to qemu.

Peter Krempa (6):
  qemuSaveImageOpen: Remove wrong ATTRIBUTE_NONNULL
  qemuMonitorMigrateToFdSet: Drop 'flags' argument
  virfile: Introduce 'virFileFDIsRegular'
  qemuSaveImageCreateFd: Handle case when 'virQEMUFileOpenAs' doesn't
    return a file fd for 'sparse' format
  qemu: driver: Merge 'qemuDomainRestoreInternal' and
    'qemuDomainObjRestore'
  qemu: saveimage: Use 'virFileWrapperFd' when loading non-sparse
    saveimage

 src/libvirt_private.syms  |   1 +
 src/qemu/qemu_driver.c    | 254 +++++++++++++++++++-------------------
 src/qemu/qemu_migration.c |   2 +-
 src/qemu/qemu_monitor.c   |   6 +-
 src/qemu/qemu_monitor.h   |   1 -
 src/qemu/qemu_saveimage.c |  48 +++++--
 src/qemu/qemu_saveimage.h |   6 +-
 src/qemu/qemu_snapshot.c  |  12 +-
 src/util/virfile.c        |   8 ++
 src/util/virfile.h        |   1 +
 10 files changed, 191 insertions(+), 148 deletions(-)

-- 
2.53.0
Re: [PATCH 0/6] qemu: Avoid use of regular file FDs with qemu's 'fd:' migration backend
Posted by Michal Prívozník via Devel 1 week, 4 days ago
On 2/17/26 16:52, Peter Krempa via Devel wrote:
> When reverting a save image in the most naive case libvirt would still
> try to use a regular file FD with the 'fd:' migration backend in qemu
> which will no longer work as of qemu-11.0.
> 
> This patchet addresses it by using the filewrapper for all cases to pass
> pipes to 'fd' instead.
> 
> In addition this patchset also adds a check that if 'sparse' save image
> format is used which requires the 'file' backend in qemu that a regular
> file FD is indeed passed to qemu.
> 
> Peter Krempa (6):
>   qemuSaveImageOpen: Remove wrong ATTRIBUTE_NONNULL
>   qemuMonitorMigrateToFdSet: Drop 'flags' argument
>   virfile: Introduce 'virFileFDIsRegular'
>   qemuSaveImageCreateFd: Handle case when 'virQEMUFileOpenAs' doesn't
>     return a file fd for 'sparse' format
>   qemu: driver: Merge 'qemuDomainRestoreInternal' and
>     'qemuDomainObjRestore'
>   qemu: saveimage: Use 'virFileWrapperFd' when loading non-sparse
>     saveimage
> 
>  src/libvirt_private.syms  |   1 +
>  src/qemu/qemu_driver.c    | 254 +++++++++++++++++++-------------------
>  src/qemu/qemu_migration.c |   2 +-
>  src/qemu/qemu_monitor.c   |   6 +-
>  src/qemu/qemu_monitor.h   |   1 -
>  src/qemu/qemu_saveimage.c |  48 +++++--
>  src/qemu/qemu_saveimage.h |   6 +-
>  src/qemu/qemu_snapshot.c  |  12 +-
>  src/util/virfile.c        |   8 ++
>  src/util/virfile.h        |   1 +
>  10 files changed, 191 insertions(+), 148 deletions(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal