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

Re: [libvirt] [PATCH] Don't overwrite error message during VM cleanup



On 11/01/2011 10:28 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange redhat com>

If an LXC VM fails to start, quite a few cleanup paths will
result in the original error message being overwritten. Some
other cleanup paths also forgot to actually terminate the VM.

* src/lxc/lxc_driver.c: Ensure VM is terminated on startup
   failure and preserve original error
---
  src/lxc/lxc_driver.c |   29 +++++++++++++++++++++--------
  1 files changed, 21 insertions(+), 8 deletions(-)

  cleanup:
+    if (rc != 0&&  !err)
+        err = virSaveLastError();
+    VIR_WARN("Cleanup %s" , err&&  err->message ? err->message : NULL);

Use "(null)", not NULL, here (printf("%s",NULL) isn't portable).

ACK with that fixed.

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


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