From dc9fdd23f9087bb7035f24df30d1f508222402e6 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Sat, 22 Feb 2020 01:38:42 -0500 Subject: [PATCH] bhyve: remove redundant parameter to virBhyveProcessStart() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ryan Moeller Signed-off-by: Ján Tomko Reviewed-by: Ján Tomko --- src/bhyve/bhyve_driver.c | 6 +++--- src/bhyve/bhyve_process.c | 18 ++++++++---------- src/bhyve/bhyve_process.h | 1 - 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 365a3777a0..7b8e4808f9 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, @@ -861,7 +861,7 @@ bhyveDomainCreateWithFlags(virDomainPtr dom, goto cleanup; } - ret = virBhyveProcessStart(dom->conn, privconn, vm, + ret = virBhyveProcessStart(dom->conn, vm, VIR_DOMAIN_RUNNING_BOOTED, start_flags); @@ -920,7 +920,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 8cc8711f96..f05be849d4 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -94,7 +94,6 @@ virBhyveFormatDevMapFile(const char *vm_name, char **fn_out) int virBhyveProcessStart(virConnectPtr conn, - bhyveConnPtr driver, virDomainObjPtr vm, virDomainRunningReason reason, unsigned int flags) @@ -107,12 +106,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, @@ -121,19 +119,19 @@ virBhyveProcessStart(virConnectPtr conn, goto cleanup; } - VIR_FREE(privconn->pidfile); - if (!(privconn->pidfile = virPidFileBuildPath(BHYVE_STATE_DIR, - vm->def->name))) { + 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; } @@ -147,7 +145,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) { @@ -189,7 +187,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);