[libvirt] [PATCH 4/4] implement callback function for qemu driver
Daniel P. Berrange
berrange at redhat.com
Thu Nov 18 09:45:26 UTC 2010
On Mon, Nov 15, 2010 at 11:23:35AM +0800, Osier Yang wrote:
> * src/qemu/qemu_driver.c (add function qemuDomainIsUpdated)
> ---
> src/qemu/qemu_driver.c | 22 +++++++++++++++++++++-
> 1 files changed, 21 insertions(+), 1 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 5516090..fd61864 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -4734,6 +4734,26 @@ cleanup:
> return ret;
> }
>
> +static int qemuDomainIsUpdated(virDomainPtr dom)
> +{
> + struct qemud_driver *driver = dom->conn->privateData;
> + virDomainObjPtr obj;
> + int ret = -1;
> +
> + qemuDriverLock(driver);
> + obj = virDomainFindByUUID(&driver->domains, dom->uuid);
> + qemuDriverUnlock(driver);
> + if (!obj) {
> + qemuReportError(VIR_ERR_NO_DOMAIN, NULL);
> + goto cleanup;
> + }
> + ret = obj->updated;
> +
> +cleanup:
> + if (obj)
> + virDomainObjUnlock(obj);
> + return ret;
> +}
>
> static int qemudGetVersion(virConnectPtr conn, unsigned long *version) {
> struct qemud_driver *driver = conn->privateData;
> @@ -13209,7 +13229,7 @@ static virDriver qemuDriver = {
> qemuIsSecure, /* isSecure */
> qemuDomainIsActive, /* domainIsActive */
> qemuDomainIsPersistent, /* domainIsPersistent */
> - NULL, /* domainIsUpdated */
> + qemuDomainIsUpdated, /* domainIsUpdated */
> qemuCPUCompare, /* cpuCompare */
> qemuCPUBaseline, /* cpuBaseline */
> qemuDomainGetJobInfo, /* domainGetJobInfo */
ACK
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list