[PATCH v2 0/3] qemu: Add infrastructure to prevent accidental disk shrink via 'virDomainBlockResize' (part 1)

Peter Krempa via Devel posted 3 patches 4 days, 2 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1776240030.git.pkrempa@redhat.com
docs/manpages/virsh.rst          |  7 ++++++-
include/libvirt/libvirt-domain.h | 10 ++++++++--
src/libvirt-domain.c             |  5 +++++
src/qemu/qemu_driver.c           | 32 +++++++++++++++++++++++++++++++-
tools/virsh-domain.c             |  7 +++++++
5 files changed, 57 insertions(+), 4 deletions(-)
[PATCH v2 0/3] qemu: Add infrastructure to prevent accidental disk shrink via 'virDomainBlockResize' (part 1)
Posted by Peter Krempa via Devel 4 days, 2 hours ago
Shrinking a disk accidentally equals data loss and thus very bad time
for anyone mis-typing.

This series adds a new flag to virDomainBlockResize to prevent such a
thing if the user only intends to extend the disk.

v2:
 - extracted only the first part of the series adding the flag
   preventing shrink and exposing it

 - the second part dealing with detecting if the flag is supported will
   be posted later along with a better approach to probe flags


Peter Krempa (3):
  virDomainBlockResizeFlags: Convert to prefix-style docs
  API/qemu: Introduce 'VIR_DOMAIN_BLOCK_RESIZE_EXTEND' for
    'virDomainBlockResize'
  virsh: blockresize: Introduce '--extend' flag

 docs/manpages/virsh.rst          |  7 ++++++-
 include/libvirt/libvirt-domain.h | 10 ++++++++--
 src/libvirt-domain.c             |  5 +++++
 src/qemu/qemu_driver.c           | 32 +++++++++++++++++++++++++++++++-
 tools/virsh-domain.c             |  7 +++++++
 5 files changed, 57 insertions(+), 4 deletions(-)

-- 
2.53.0
Re: [PATCH v2 0/3] qemu: Add infrastructure to prevent accidental disk shrink via 'virDomainBlockResize' (part 1)
Posted by Michal Prívozník via Devel 4 days, 1 hour ago
On 4/15/26 10:04, Peter Krempa via Devel wrote:
> Shrinking a disk accidentally equals data loss and thus very bad time
> for anyone mis-typing.
> 
> This series adds a new flag to virDomainBlockResize to prevent such a
> thing if the user only intends to extend the disk.
> 
> v2:
>  - extracted only the first part of the series adding the flag
>    preventing shrink and exposing it
> 
>  - the second part dealing with detecting if the flag is supported will
>    be posted later along with a better approach to probe flags
> 
> 
> Peter Krempa (3):
>   virDomainBlockResizeFlags: Convert to prefix-style docs
>   API/qemu: Introduce 'VIR_DOMAIN_BLOCK_RESIZE_EXTEND' for
>     'virDomainBlockResize'
>   virsh: blockresize: Introduce '--extend' flag
> 
>  docs/manpages/virsh.rst          |  7 ++++++-
>  include/libvirt/libvirt-domain.h | 10 ++++++++--
>  src/libvirt-domain.c             |  5 +++++
>  src/qemu/qemu_driver.c           | 32 +++++++++++++++++++++++++++++++-
>  tools/virsh-domain.c             |  7 +++++++
>  5 files changed, 57 insertions(+), 4 deletions(-)
> 

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

Michal