[libvirt] [PATCH 2/9] Define the internal driver API for vol wiping

Eric Blake eblake at redhat.com
Wed Mar 17 23:31:07 UTC 2010


On 03/15/2010 08:13 PM, David Allan wrote:
> @@ -791,6 +795,7 @@ struct _virStorageDriver {
>      virDrvStorageVolCreateXML volCreateXML;
>      virDrvStorageVolCreateXMLFrom volCreateXMLFrom;
>      virDrvStorageVolDelete volDelete;
> +    virDrvStorageVolWipe volWipe;
>      virDrvStorageVolGetInfo volGetInfo;
>      virDrvStorageVolGetXMLDesc volGetXMLDesc;
>      virDrvStorageVolGetPath volGetPath;

Any reason this was introduced in the middle of the struct, rather than
at the end?  Sticking stuff in the middle tends to be asking for
off-by-one shifts of all the remaining elements in the struct,
especially if you ever mix objects compiled across the time when the
element was added.  Whereas always sticking new entries at the end
allows you to maintain a measure of back-compatibility, where an older
object still fits in the first half of the struct, and given enough
version/sizing information, a newer server can correctly assume that
struct members beyond a given offset are effectively null when talking
to a client that was compiled against the older struct definition.

On the other hand, you probably aren't the first to make a modification
like this, so this is more an issue of me asking about the code to learn
about it than it is a request for you to make a change.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list