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

Re: [libvirt] [PATCH 2/4] qemu: Refactor managed save functions to use domain lookup helpers



On 12/11/12 22:50, Eric Blake wrote:
On 12/11/2012 11:48 AM, Peter Krempa wrote:
---
  src/qemu/qemu_driver.c | 54 +++++++++++---------------------------------------
  1 file changed, 12 insertions(+), 42 deletions(-)

Nice reduction in size. However, you need a v2...


[...]


-cleanup:
-    if (vm)
-        virDomainObjUnlock(vm);
-    qemuDriverUnlock(driver);
-    return ret;
+    return vm->hasManagedSave;
  }

Ouch.  This leaves vm locked on exit.  It needs to look more like:

Removal of code is really addictive :) I got carried away and strived
for more lines :) V2 comming in soon.


if !(vm = qemuDomObjFromDomain(dom)))
     return -1;
ret = vm->hasManagedSave;
virDomainObjUnlock(vm);
retun ret;


Peter


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