[PATCH 07/15] openvzDriver: Adapt to virDomain{Resume, Suspend}Flags

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

 



So far, there are no flags to implement, so just call the
corresponding function with 0 passed as @flags.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/openvz/openvz_driver.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index b27ac4c..54b7c64 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -577,12 +577,17 @@ static void openvzSetProgramSentinal(const char **prog, const char *key)
     }
 }
 
-static int openvzDomainSuspend(virDomainPtr dom) {
+static int
+openvzDomainSuspendFlags(virDomainPtr dom,
+                         unsigned int flags)
+{
     struct openvz_driver *driver = dom->conn->privateData;
     virDomainObjPtr vm;
     const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINEL, "--suspend", NULL};
     int ret = -1;
 
+    virCheckFlags(0, -1);
+
     openvzDriverLock(driver);
     vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
     openvzDriverUnlock(driver);
@@ -615,12 +620,23 @@ cleanup:
     return ret;
 }
 
-static int openvzDomainResume(virDomainPtr dom) {
+static int
+openvzDomainSuspend(virDomainPtr dom)
+{
+    return openvzDomainSuspendFlags(dom, 0);
+}
+
+static int
+openvzDomainResumeFlags(virDomainPtr dom,
+                        unsigned int flags)
+{
   struct openvz_driver *driver = dom->conn->privateData;
   virDomainObjPtr vm;
   const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINEL, "--resume", NULL};
   int ret = -1;
 
+  virCheckFlags(0, -1);
+
   openvzDriverLock(driver);
   vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
   openvzDriverUnlock(driver);
@@ -654,6 +670,12 @@ cleanup:
 }
 
 static int
+openvzDomainResume(virDomainPtr dom)
+{
+    return openvzDomainResumeFlags(dom, 0);
+}
+
+static int
 openvzDomainShutdownFlags(virDomainPtr dom,
                           unsigned int flags) {
     struct openvz_driver *driver = dom->conn->privateData;
@@ -2210,7 +2232,9 @@ static virDriver openvzDriver = {
     .domainLookupByUUID = openvzDomainLookupByUUID, /* 0.3.1 */
     .domainLookupByName = openvzDomainLookupByName, /* 0.3.1 */
     .domainSuspend = openvzDomainSuspend, /* 0.8.3 */
+    .domainSuspendFlags = openvzDomainSuspendFlags, /* 1.2.2 */
     .domainResume = openvzDomainResume, /* 0.8.3 */
+    .domainResumeFlags = openvzDomainResumeFlags, /* 1.2.2 */
     .domainShutdown = openvzDomainShutdown, /* 0.3.1 */
     .domainShutdownFlags = openvzDomainShutdownFlags, /* 0.9.10 */
     .domainReboot = openvzDomainReboot, /* 0.3.1 */
-- 
1.8.5.2

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