On 13.12.2012 14:23, Peter Krempa wrote:
On 12/13/12 12:40, Michal Privoznik wrote:
> Many internal qemu APIs must find domain object from passed
> virDomainPtr. And with function Peter's introduced, we can use it
> instead of copying multiple lines among code.
> ---
> src/qemu/qemu_driver.c | 470
> +++++-------------------------------------------
> 1 files changed, 47 insertions(+), 423 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 74e442b..8ace5c2 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
[...]
> @@ -3280,22 +3174,13 @@ cleanup:
> static int
> qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
> {
> - virQEMUDriverPtr driver = dom->conn->privateData;
> virDomainObjPtr vm = NULL;
> int ret = -1;
>
> virCheckFlags(0, -1);
>
> - qemuDriverLock(driver);
> - vm = virDomainFindByUUID(&driver->domains, dom->uuid);
> - qemuDriverUnlock(driver);
> - if (!vm) {
> - char uuidstr[VIR_UUID_STRING_BUFLEN];
> - virUUIDFormat(dom->uuid, uuidstr);
> - virReportError(VIR_ERR_NO_DOMAIN,
> - _("no domain with matching uuid '%s'"),
uuidstr);
> + if (!(vm = qemuDomObjFromDomain(dom)))
> goto cleanup;
> - }
>
> ret = vm->hasManagedSave;
Again, this hunk is already changed upstream.
>
ACK if you rebase this on the current upstream head and thus get rid of
the hunk above.
Peter
Thanks, pushed now!
Michal