[libvirt] [PATCH 0/6] Support online block resizing

Daniel P. Berrange berrange at redhat.com
Thu Sep 1 13:14:23 UTC 2011

On Wed, Aug 31, 2011 at 09:31:58PM +0800, Osier Yang wrote:
> Upstream QEMU introduced online block resizing to resize the
> block device when domain is running since commit 6d4a2b3a4795.
> It simply reuses existing "bdrv_truncate" method which is used
> by "qemu-img" to resize the images. This means it supports to
> resize all the format that "qemu-img resize" supports. E.g.
> qcow2, raw, qed, qcow, etc. (NB, it doesn't support to shrink
> size of qcow2 image, and QEMU reports "An undefined error
> has ocurred" in this case).
> For block device of virtio bus, the guest can update the device
> size automatically, needs kernel support, since kernel-2.6.32-117:
>   http://patchwork.usersys.redhat.com/patch/33040/
> For block device of SCSI bus, one needs to execute command like
> below in the guest (linux) to update the size:
>   % echo > /sys/class/scsi_device/0:0:0:0/device/rescan
> For block device of IDE bus, seems there is no way to let guest
> update the size after resizing.

Your API proprosal looks reasonable, but unfortunately the QEMU
command 'block_resize' is either broken, or incomplete since it
does not have a way to notify the guest that a block device has
been resized, independantly of actually resizing the host file.
This is required in order for guest disk resize to work on LVM,
SCSI, iSCSI, etc block devices, since QEMU cannot itself do a
resize of the block devices. The resize has to be done either
by libvirt using host commands, or by the SAN administrator on
the remote storage appliance.

IMHO, we should not commit to the libvirt API design, until we
can get confirmation from QEMU about whether they will fix the
block_resize command to work for block devices, or add a new
command for just notifying guests of external block device

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

More information about the libvir-list mailing list