提交 cd3aebe9 编写于 作者: I Ilias Stamatis 提交者: Erik Skultety

test_driver: implement virDomainGetHostname

Always return "domain_name" + "host".
Signed-off-by: NIlias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 d193a711
...@@ -1910,6 +1910,30 @@ static int testDomainReboot(virDomainPtr domain, ...@@ -1910,6 +1910,30 @@ static int testDomainReboot(virDomainPtr domain,
return ret; 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:
virDomainObjEndAPI(&vm);
return ret;
}
static int testDomainGetInfo(virDomainPtr domain, static int testDomainGetInfo(virDomainPtr domain,
virDomainInfoPtr info) virDomainInfoPtr info)
{ {
...@@ -6950,6 +6974,7 @@ static virHypervisorDriver testHypervisorDriver = { ...@@ -6950,6 +6974,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */ .domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
.domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */ .domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
.domainSetMemory = testDomainSetMemory, /* 0.1.4 */ .domainSetMemory = testDomainSetMemory, /* 0.1.4 */
.domainGetHostname = testDomainGetHostname, /* 5.5.0 */
.domainGetInfo = testDomainGetInfo, /* 0.1.1 */ .domainGetInfo = testDomainGetInfo, /* 0.1.1 */
.domainGetState = testDomainGetState, /* 0.9.2 */ .domainGetState = testDomainGetState, /* 0.9.2 */
.domainGetTime = testDomainGetTime, /* 5.4.0 */ .domainGetTime = testDomainGetTime, /* 5.4.0 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册