[prev in list] [next in list] [prev in thread] [next in thread]
List: libvir-list
Subject: Re: [libvirt] [PATCH] test_driver: implement virDomainGetHostname
From: Ilias Stamatis <stamatis.iliass () gmail ! com>
Date: 2019-05-31 15:38:44
Message-ID: CAAfjAQPfbbbFtGftUx55_PY+9y0N6+Gt+Vu=Ea6iYkVUHsgL6g () mail ! gmail ! com
[Download RAW message or body]
On Fri, May 31, 2019 at 4:31 PM Ilias Stamatis
<stamatis.iliass@gmail.com> wrote:
>
> Always return "domain_name" + "host".
>
> Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
> ---
> src/test/test_driver.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 2f58a1da95..aad7bb6036 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -1910,6 +1910,27 @@ static int testDomainReboot(virDomainPtr domain,
> return ret;
> }
>
> +static char *
> +testDomainGetHostname(virDomainPtr domain,
> + unsigned int flags)
> +{
> + char *ret = NULL;
> + virDomainObjPtr vm = NULL;
> +
> + virCheckFlags(0, NULL);
> +
> + if (!(vm = testDomObjFromDomain(domain)))
> + goto cleanup;
> +
> + if (virDomainObjCheckActive(vm) < 0)
> + goto cleanup;
> +
> + ignore_value(virAsprintf(&ret, "%shost", domain->name));
> +
> + cleanup:
Oops, missing "virDomainObjEndAPI(&vm);" here.
> + return ret;
> +}
> +
> static int testDomainGetInfo(virDomainPtr domain,
> virDomainInfoPtr info)
> {
> @@ -6950,6 +6971,7 @@ static virHypervisorDriver testHypervisorDriver = {
> .domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
> .domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
> .domainSetMemory = testDomainSetMemory, /* 0.1.4 */
> + .domainGetHostname = testDomainGetHostname, /* 5.5.0 */
> .domainGetInfo = testDomainGetInfo, /* 0.1.1 */
> .domainGetState = testDomainGetState, /* 0.9.2 */
> .domainGetTime = testDomainGetTime, /* 5.4.0 */
> --
> 2.21.0
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic