On 08/23/2011 09:12 AM, Stefan Hajnoczi wrote:
Hmm...so there is no abstraction. I still need to understand what
the
underlying snapshot implementation does and what its limitations are.
We're still trying to get to that point. A while ago, I posted an RFC
for adding virStorageVolSnapshot* APIs, which would be the ideal place
to expose storage-volume independent wrappers around snapshot
management. The idea is still that we can use APIs like that (instead
of low-level access to the snapshot image file) to stream snapshot data
from a remote host back to the client. We also need a new API that lets
you quickly access all of the storage volumes associated with a domain
(my patch to add 'virsh domblklist' is a start at getting at all the
storage volume names, but not quite as good as getting the actual
virStorageVolPtr objects).
This is what I meant when I asked about aiming for something more
high-level where the user doesn't need to be an expert in snapshots to
use this API. In order to access the snapshot I need to use an
out-of-band (ssh?) mechanism to get to the libvirt host and know how
to access the external snapshot image file. If that image file is
using an image format then I need to use libguestfs, qemu-io/qemu-img,
or custom code to access the format.
For now, yes. But hopefully the work I'm doing is providing enough
framework to later add the additions that can indeed expose libvirt APIs
rather than low-level tool knowledge to get at the snapshots.
I think we simply cannot expose all this complexity to users. Each
application would have to support the many different cases. Libvirt
needs to tie this stuff together and present an interface that
applications can use without worrying how to actually get at the
snapshot data.
I don't see any problem with exposing the lower layers as a start, then
adding higher layers as we go. There are different classes of users,
and both layers are useful in the right context. But at the same time,
I agree with you that what I have done so far is just a start, and by no
means the end of snapshot-related libvirt work.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org