ok, I see, thank you very much for your kindly reply, the answer is very clear and useful for me. Thanks a lot!<br><br><div class="gmail_quote">2012/5/29 Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 05/29/2012 03:40 AM, Rujie Xu wrote:<br>
> Hello everyone,<br>
>     I am trying to find a way to store an internal disk snapshot and<br>
> supposed to restore later.<br>
><br>
>     Here is the problems I met:<br>
>     1) when I use SnapshotCreateXML() to create a disk_only snapshot while<br>
> the domain is inactive, there is an error happened:<br>
>      disk snapshot of inactive domains not implemented yet.<br>
>      I am wondering is there and way I can save the disk_only snapshot when<br>
> the domain is inactive right now?<br>
<br>
</div>That code still has to be written.  It's on my todo list.<br>
<br>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=817226" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=817226</a><br>
<br>
That said, if you _don't_ use the disk_only flag and the domain is<br>
offline, then the end result right now is that you get internal<br>
snapshots for free (since a system checkpoint of an offline domain _is_<br>
the disk snapshot, and since system checkpoint currently uses internal<br>
snapshots only).<br>
<div class="im"><br>
><br>
>      2) also use snapshotCreateXML() to create a disk_only snapshot while<br>
> the domain is active, and use the xml to set the <disk name="hda"<br>
> snapshot="internal"> there is also an error happened:<br>
>      unsupported configuration: active qemu domains require external disk<br>
> snapshot; disk hda requested internal<br>
<br>
</div>Correct.  Qemu does not support the creation of internal disk snapshots<br>
except by the 'savevm' command which takes a system checkpoint snapshot<br>
(that is, unless qemu gives us a way to do disk-only internal snapshots<br>
of a running VM, you are stuck on this front).<br>
<div class="im"><br>
><br>
>      3) when I use snapshotCreateXML() to create a disk_only snapshot using<br>
> external file, it could be done, but when I try to use revertToSnapshot()<br>
> to revert this snapshot there is another error happened:<br>
>       revert to external snapshot not supported yet.<br>
<br>
</div>Correct, that's another API that I haven't yet coded; and you're the<br>
second person to ask about it this week:<br>
<a href="https://www.redhat.com/archives/libvirt-users/2012-May/msg00122.html" target="_blank">https://www.redhat.com/archives/libvirt-users/2012-May/msg00122.html</a><br>
<div class="im"><br>
><br>
> Is there anyone can help me about this, or we just can't use libvirt to<br>
> managed the disk snapshot right now?<br>
<br>
</div>Help in contributing code would be very welcome.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Eric Blake   <a href="mailto:eblake@redhat.com">eblake@redhat.com</a>    <a href="tel:%2B1-919-301-3266" value="+19193013266">+1-919-301-3266</a><br>
Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Roger Xu<br>