[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v5] qemu: Remove the managed state file only if restoring succeeded



On 04/06/2011 08:31 PM, Osier Yang wrote:
>      managed_save = qemuDomainManagedSavePath(driver, vm);
> +
> +    if (!managed_save)
> +        goto cleanup;
> +
>      if ((managed_save) && (virFileExists(managed_save))) {

This second check for non-NULL managed_save is now redundant.

> +++ b/tools/virsh.pod
> @@ -546,7 +546,11 @@ I<on_reboot> parameter in the domain's XML definition.
> 
>  =item B<restore> I<state-file>
> 
> -Restores a domain from an B<virsh save> state file.  See I<save> for more info.
> +Restores a domain from an B<virsh save> state file. See I<save> for more info.

Sorry for not noticing sooner, but we could do some grammar cleanups.

Does this look like a reasonable followup?

diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index a84780b..0734a76 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -3430,7 +3430,7 @@ static int qemudDomainObjStart(virConnectPtr conn,
     if (!managed_save)
         goto cleanup;

-    if ((managed_save) && (virFileExists(managed_save))) {
+    if (virFileExists(managed_save)) {
         ret = qemuDomainObjRestore(conn, driver, vm, managed_save);

         if ((ret == 0) && (unlink(managed_save) < 0))
diff --git i/tools/virsh.pod w/tools/virsh.pod
index 6319373..9ce6905 100644
--- i/tools/virsh.pod
+++ w/tools/virsh.pod
@@ -546,11 +546,12 @@ I<on_reboot> parameter in the domain's XML definition.

 =item B<restore> I<state-file>

-Restores a domain from an B<virsh save> state file. See I<save> for
more info.
+Restores a domain from a B<virsh save> state file. See I<save> for more
info.

 B<Note>: To avoid corrupting file system contents within the domain, you
-should not reuse the saved state file to B<restore> unless you are
convinced
-with reverting the domain to the previous state.
+should not reuse the saved state file for a second B<restore> unless
+you have also reverted all storage volumes back to the same contents
+as when the state file was created.

 =item B<save> I<domain-id> I<state-file>



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

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]