[libvirt] Public API Change Advice
Eric Blake
eblake at redhat.com
Mon Jan 30 22:25:57 UTC 2012
On 01/30/2012 03:11 PM, Phantomcircuit wrote:
> I'd like to add a simple flag to virStorageVolWipe to use O_DIRECT.
>
> What's the proper way to add such a flag?
Best is to copy by example :) Here's a recent patch that added a new
flag to the public API, exposed the new flag in virsh, and implemented
that flag in the qemu driver:
commit 4e9953a426b44b40c5e0890abb73e0f90c454da5
Author: Eric Blake <eblake at redhat.com>
Date: Mon Jan 9 11:57:46 2012 -0700
snapshot: allow reuse of existing files in disk snapshot
When disk snapshots were first implemented, libvirt blindly refused
to allow an external snapshot destination that already exists, since
qemu will blindly overwrite the contents of that file during the
snapshot_blkdev monitor command, and we don't like a default of
data loss by default. But VDSM has a scenario where NFS permissions
are intentionally set so that the destination file can only be
created by the management machine, and not the machine where the
guest is running, so that libvirt will necessarily see the destination
file already existing; adding a flag will allow VDSM to force the file
reuse without libvirt complaining of possible data loss.
--
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/20120130/4442d777/attachment-0001.sig>
More information about the libvir-list
mailing list