From: Ilias Stamatis Date: Tue, 6 Aug 2019 15:56:23 +0000 (+0200) Subject: test_driver: implement virDomainReset X-Git-Tag: v5.7.0-rc1~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76c4de66ad940ce6fdab59750c8b86ba06fdc184;p=thirdparty%2Flibvirt.git test_driver: implement virDomainReset The qemu and vz implementations don't emit any signals when this API is called, so we can do the same here for now and succeed by doing nothing. Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- diff --git a/src/test/test_driver.c b/src/test/test_driver.c index d9a7f815d5..6bca4e277f 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2004,6 +2004,28 @@ static int testDomainReboot(virDomainPtr domain, } +static int +testDomainReset(virDomainPtr dom, + unsigned int flags) +{ + virDomainObjPtr vm; + int ret = -1; + + virCheckFlags(0, -1); + + if (!(vm = testDomObjFromDomain(dom))) + return -1; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + ret = 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static char * testDomainGetHostname(virDomainPtr domain, unsigned int flags) @@ -8878,6 +8900,7 @@ static virHypervisorDriver testHypervisorDriver = { .domainShutdown = testDomainShutdown, /* 0.1.1 */ .domainShutdownFlags = testDomainShutdownFlags, /* 0.9.10 */ .domainReboot = testDomainReboot, /* 0.1.1 */ + .domainReset = testDomainReset, /* 5.7.0 */ .domainDestroy = testDomainDestroy, /* 0.1.1 */ .domainDestroyFlags = testDomainDestroyFlags, /* 4.2.0 */ .domainGetOSType = testDomainGetOSType, /* 0.1.9 */