[PATCH] Use virDomainGetState in migration APIs

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

 



We are only interested in domain state so no need to call
virDomainGetInfo for that.
---
 src/libvirt.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index ff16c48..3d1b314 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -3513,10 +3513,10 @@ virDomainMigrateVersion1 (virDomainPtr domain,
     char *uri_out = NULL;
     char *cookie = NULL;
     int cookielen = 0, ret;
-    virDomainInfo info;
+    int state;
 
-    ret = virDomainGetInfo (domain, &info);
-    if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) {
+    ret = virDomainGetState(domain, &state, NULL, 0);
+    if (ret == 0 && state == VIR_DOMAIN_PAUSED) {
         flags |= VIR_MIGRATE_PAUSED;
     }
 
@@ -3601,7 +3601,7 @@ virDomainMigrateVersion2 (virDomainPtr domain,
     char *cookie = NULL;
     char *dom_xml = NULL;
     int cookielen = 0, ret;
-    virDomainInfo info;
+    int state;
     virErrorPtr orig_err = NULL;
     int cancelled;
 
@@ -3632,8 +3632,8 @@ virDomainMigrateVersion2 (virDomainPtr domain,
     if (!dom_xml)
         return NULL;
 
-    ret = virDomainGetInfo (domain, &info);
-    if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) {
+    ret = virDomainGetState(domain, &state, NULL, 0);
+    if (ret == 0 && state == VIR_DOMAIN_PAUSED) {
         flags |= VIR_MIGRATE_PAUSED;
     }
 
@@ -3732,7 +3732,7 @@ virDomainMigrateVersion3(virDomainPtr domain,
     int cookieinlen = 0;
     int cookieoutlen = 0;
     int ret;
-    virDomainInfo info;
+    int state;
     virErrorPtr orig_err = NULL;
     int cancelled;
 
@@ -3753,8 +3753,8 @@ virDomainMigrateVersion3(virDomainPtr domain,
     if (!dom_xml)
         goto done;
 
-    ret = virDomainGetInfo (domain, &info);
-    if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) {
+    ret = virDomainGetState(domain, &state, NULL, 0);
+    if (ret == 0 && state == VIR_DOMAIN_PAUSED) {
         flags |= VIR_MIGRATE_PAUSED;
     }
 
-- 
1.7.5.rc3

--
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]