virsh qemu-monitor-command block_resize not working

2021-07-14 Thread arjen-libvirt
Hi List,

some version info:
]# /usr/libexec/qemu-kvm -version
QEMU emulator version 4.2.0
(qemu-kvm-4.2.0-48.module+el8.4.0+534+4680a14e) Copyright (c) 2003-2019
Fabrice Bellard and the QEMU Project developers

]# virsh version
Compiled against library: libvirt 6.0.0
Using library: libvirt 6.0.0
Using API: QEMU 6.0.0
Running hypervisor: QEMU 4.2.0

information about block devices for one specific guest:
]# virsh qemu-monitor-command uat-win201202.uat.gugu.be --hmp info block
libvirt-2-format:
/data/kvm/storage/diskimages01/uat-win201202_disk1_C.qcow2 (qcow2)
Attached to:  /machine/peripheral/virtio-disk0/virtio-backend Cache
mode:   writeback

ide0-0-0: [not inserted]
Attached to:  ide0-0-0
Removable device: not locked, tray closed


But then, when I want to resize the block device, I just cannot seem to
find the correct device. I tried all of these:

virsh qemu-monitor-command uat-win201202.uat.gugu.be --hmp block_resize
libvirt-2-storage 48G
Error: Cannot find device=libvirt-2-storage nor node_name=

virsh qemu-monitor-command uat-win201202.uat.gugu.be --hmp block_resize
drive-libvirt-2-storage 48G
Error: Cannot find device=drive-libvirt-2-storage nor node_name=

virsh qemu-monitor-command uat-win201202.uat.gugu.be --hmp block_resize
virtio-disk0 48G
Error: Cannot find device=virtio-disk0 nor node_name=

virsh qemu-monitor-command uat-win201202.uat.gugu.be --hmp block_resize
drive-virtio-disk0 48G
Error: Cannot find device=drive-virtio-disk0 nor node_name=

In a previous qemu version this worked (EL 7). Can someone help me out?

Best regards,
Arjen Van Drie,
Antwerp



Re: virsh qemu-monitor-command block_resize not working

2021-07-14 Thread arjen-libvirt





On Wed, 14 Jul 2021 09:34:22 +0100
Daniel P. Berrangé  wrote:

> On Wed, Jul 14, 2021 at 10:10:35AM +0200, arjen-libv...@gugu.be wrote:
> > Hi List,
> > 

[sNap]

> > 
> > In a previous qemu version this worked (EL 7). Can someone help me
> > out?  
> 
> Libvirt has changed the way it configures disks with QEMU to use the
> modern -blockdev argument. I expect this impacts your usage, but I
> dont know what the correct naming should be.
> 
> Ignoring that though, why are you even using qemu-monitor-command in
> the first place ?  Libvirt directly supports live block resizing
> via the 'virsh blockresize' command

Hah, didn't know that live resizing was implemented in virsh. Great!

Thanks,
Arjen.