[libvirt] [PATCH 1/2] resize: add virStorageVolResize() API

Eric Blake eblake at redhat.com
Wed Jun 6 12:58:22 UTC 2012


On 06/06/2012 06:12 AM, Osier Yang wrote:
> On 2012年01月28日 08:28, Eric Blake wrote:
>> From: "Zeeshan Ali (Khattak)"<zeeshanak at gnome.org>
>>
>> Add a new function to allow changing of capacity of storage volumes.
>> Plan out several flags, even if not all of them will be implemented
>> up front.
>>

> 
> Late response, but it seems not good idea to expose the options
> which are actually not implemented underlying yet. One would get
> error like:
> 
> # virsh vol-resize /var/lib/libvirt/images/test.img 60  --shrink
> error: invalid argument: storageVolumeResize: unsupported flags (0x4)
> 
> With the magic number "0x4", one'd never known what it is. It can
> be improved roundabout, but it should be avoided in the beginning.

Improving the error message would indeed be nice, if you can find a way
to do it across the board for all APIs that call virCheckFlags().  But
your general objection to avoiding flag values that are not implemented
across all drivers is impossible - as we add new APIs and new flags to
existing APIs, we are stuck with the fact that not all hypervisors can
implement all those flags simultaneously (if even at all).  I see no
problem with defining a libvirt API with flags that some drivers cannot
implement yet, only with the quality of an error message when a flag is
unsupported.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120606/9fb4b5ff/attachment-0001.sig>


More information about the libvir-list mailing list