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

Re: [libvirt] [PATCH] qemu: Error prompt when saving a shutoff domain



于 2011年02月15日 17:52, Daniel Veillard 写道:
On Tue, Feb 15, 2011 at 04:26:37PM +0800, Osier Yang wrote:
* src/qemu/qemu_driver.c
---
  src/qemu/qemu_driver.c |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c581cfe..8570e67 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4647,6 +4647,12 @@ static int qemudDomainSave(virDomainPtr dom, const char *path)
          goto cleanup;
      }

+    if (!virDomainObjIsActive(vm)) {
+        qemuReportError(VIR_ERR_OPERATION_INVALID,
+                        "%s", _("domain is not running"));
+        goto cleanup;
+    }
+
      ret = qemudDomainSaveFlag(driver, dom, vm, path, compressed);

  cleanup:

  Seems similar to the previous fix on managed save, ACK

But I note that the internal routine qemudDomainSaveFlag() used by both
front end does that check too, that sounds redundant.

Yes, and actually checking in qemudDomainSaveFlag goto wrong label, (endjob, should be from copy-and-paste), in which security manager
trys to restore label, that's why the error happens.

Removed the checking in qemudDomainSaveFlag in v2 patch.

Thanks for the revewing,

Regards
Osier


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