[PATCH v2 04/12] Remove redundant parameter to virBhyveProcessStart()

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

 



Signed-off-by: Ryan Moeller <ryan@xxxxxxxxxxxxx>
---
 src/bhyve/bhyve_driver.c  |  6 +++---
 src/bhyve/bhyve_process.c | 16 +++++++---------
 src/bhyve/bhyve_process.h |  1 -
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 760619a5a6..d591ff63e3 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -89,7 +89,7 @@ bhyveAutostartDomain(virDomainObjPtr vm, void *opaque)
     virObjectLock(vm);
     if (vm->autostart && !virDomainObjIsActive(vm)) {
         virResetLastError();
-        ret = virBhyveProcessStart(data->conn, data->driver, vm,
+        ret = virBhyveProcessStart(data->conn, vm,
                                    VIR_DOMAIN_RUNNING_BOOTED, 0);
         if (ret < 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -862,7 +862,7 @@ bhyveDomainCreateWithFlags(virDomainPtr dom,
         goto cleanup;
     }
 
-    ret = virBhyveProcessStart(dom->conn, privconn, vm,
+    ret = virBhyveProcessStart(dom->conn, vm,
                                VIR_DOMAIN_RUNNING_BOOTED,
                                start_flags);
 
@@ -921,7 +921,7 @@ bhyveDomainCreateXML(virConnectPtr conn,
         goto cleanup;
     def = NULL;
 
-    if (virBhyveProcessStart(conn, privconn, vm,
+    if (virBhyveProcessStart(conn, vm,
                              VIR_DOMAIN_RUNNING_BOOTED,
                              start_flags) < 0) {
         /* If domain is not persistent, remove its data */
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index bddd4e9461..9352baf172 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -113,7 +113,6 @@ bhyveProcessStopHook(virDomainObjPtr vm, virHookBhyveOpType op)
 
 int
 virBhyveProcessStart(virConnectPtr conn,
-                     bhyveConnPtr driver,
                      virDomainObjPtr vm,
                      virDomainRunningReason reason,
                      unsigned int flags)
@@ -126,12 +125,11 @@ virBhyveProcessStart(virConnectPtr conn,
     char ebuf[1024];
     virCommandPtr cmd = NULL;
     virCommandPtr load_cmd = NULL;
-    bhyveConnPtr privconn = conn->privateData;
+    bhyveConnPtr driver = conn->privateData;
     bhyveDomainObjPrivatePtr priv = vm->privateData;
     int ret = -1, rc;
 
     logfile = g_strdup_printf("%s/%s.log", BHYVE_LOG_DIR, vm->def->name);
-
     if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
                       S_IRUSR | S_IWUSR)) < 0) {
         virReportSystemError(errno,
@@ -140,19 +138,19 @@ virBhyveProcessStart(virConnectPtr conn,
         goto cleanup;
     }
 
-    VIR_FREE(privconn->pidfile);
-    if (!(privconn->pidfile = virPidFileBuildPath(BHYVE_STATE_DIR,
+    VIR_FREE(driver->pidfile);
+    if (!(driver->pidfile = virPidFileBuildPath(BHYVE_STATE_DIR,
                                                   vm->def->name))) {
         virReportSystemError(errno,
                              "%s", _("Failed to build pidfile path"));
         goto cleanup;
     }
 
-    if (unlink(privconn->pidfile) < 0 &&
+    if (unlink(driver->pidfile) < 0 &&
         errno != ENOENT) {
         virReportSystemError(errno,
                              _("Cannot remove state PID file %s"),
-                             privconn->pidfile);
+                             driver->pidfile);
         goto cleanup;
     }
 
@@ -170,7 +168,7 @@ virBhyveProcessStart(virConnectPtr conn,
     virCommandSetOutputFD(cmd, &logfd);
     virCommandSetErrorFD(cmd, &logfd);
     virCommandWriteArgLog(cmd, logfd);
-    virCommandSetPidFile(cmd, privconn->pidfile);
+    virCommandSetPidFile(cmd, driver->pidfile);
     virCommandDaemonize(cmd);
 
     if (vm->def->os.loader == NULL) {
@@ -215,7 +213,7 @@ virBhyveProcessStart(virConnectPtr conn,
     if (virCommandRun(cmd, NULL) < 0)
         goto cleanup;
 
-    if (virPidFileReadPath(privconn->pidfile, &vm->pid) < 0) {
+    if (virPidFileReadPath(driver->pidfile, &vm->pid) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Domain %s didn't show up"), vm->def->name);
         goto cleanup;
diff --git a/src/bhyve/bhyve_process.h b/src/bhyve/bhyve_process.h
index 4f62f6be4b..8419e44faa 100644
--- a/src/bhyve/bhyve_process.h
+++ b/src/bhyve/bhyve_process.h
@@ -24,7 +24,6 @@
 #include "bhyve_utils.h"
 
 int virBhyveProcessStart(virConnectPtr conn,
-                         bhyveConnPtr driver,
                          virDomainObjPtr vm,
                          virDomainRunningReason reason,
                          unsigned int flags);
-- 
2.23.0


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

  Powered by Linux