[PATCH 4/4] parallels_sdk: Utilize parallelsDomObjFromDomain()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <mprivozn@xxxxxxxxxx>
---
 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 59ca62e..d54f894 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);
-- 
2.0.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]