From 85cbe869f94399cd26377fb1bbc8e20cb7917b2d Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 22 Apr 2015 18:27:05 +0200 Subject: [PATCH] parallels_sdk: Utilize parallelsDomObjFromDomain() Instead of each API copying the same lines of code, lets use the generic function designed just for that purpose. Signed-off-by: Michal Privoznik --- src/parallels/parallels_sdk.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c index 59ca62e432..d54f89473b 100644 --- a/src/parallels/parallels_sdk.c +++ b/src/parallels/parallels_sdk.c @@ -1838,11 +1838,8 @@ prlsdkDomainChangeState(virDomainPtr domain, virDomainObjPtr dom; int ret = -1; - dom = virDomainObjListFindByUUID(privconn->domains, domain->uuid); - if (dom == NULL) { - parallelsDomNotFoundError(domain); + if (!(dom = parallelsDomObjFromDomain(domain))) return -1; - } ret = prlsdkDomainChangeStateLocked(privconn, dom, chstate); virObjectUnlock(dom); -- GitLab