From 99759126f7a7aae8fed40e9aba575a970bdd6415 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 14 Jun 2019 14:18:37 +0200 Subject: [PATCH] qemu: Rename qemuDomainCmdlineDefPtr to qemuDomainXmlNsDefPtr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The data injected via the namespace may contain also other things than commandline passthrough definitions. Rename it to make it more universal. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_command.c | 14 +++++++------- src/qemu/qemu_conf.c | 2 +- src/qemu/qemu_conf.h | 8 ++++---- src/qemu/qemu_domain.c | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1d1b2d20e5..b767a1e15f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10854,14 +10854,14 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL); if (def->namespaceData) { - qemuDomainCmdlineDefPtr qemucmd; + qemuDomainXmlNsDefPtr qemuxmlns; - qemucmd = def->namespaceData; - for (i = 0; i < qemucmd->num_args; i++) - virCommandAddArg(cmd, qemucmd->args[i]); - for (i = 0; i < qemucmd->num_env; i++) - virCommandAddEnvPair(cmd, qemucmd->env_name[i], - NULLSTR_EMPTY(qemucmd->env_value[i])); + qemuxmlns = def->namespaceData; + for (i = 0; i < qemuxmlns->num_args; i++) + virCommandAddArg(cmd, qemuxmlns->args[i]); + for (i = 0; i < qemuxmlns->num_env; i++) + virCommandAddEnvPair(cmd, qemuxmlns->env_name[i], + NULLSTR_EMPTY(qemuxmlns->env_value[i])); } if (qemuBuildSeccompSandboxCommandLine(cmd, cfg, qemuCaps) < 0) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index daea11dacb..afff77b1f3 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -94,7 +94,7 @@ qemuDriverUnlock(virQEMUDriverPtr driver) virMutexUnlock(&driver->lock); } -void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def) +void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def) { size_t i; diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 7ed3674086..5debd7eb00 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -288,9 +288,9 @@ struct _virQEMUDriver { virHashAtomicPtr migrationErrors; }; -typedef struct _qemuDomainCmdlineDef qemuDomainCmdlineDef; -typedef qemuDomainCmdlineDef *qemuDomainCmdlineDefPtr; -struct _qemuDomainCmdlineDef { +typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef; +typedef qemuDomainXmlNsDef *qemuDomainXmlNsDefPtr; +struct _qemuDomainXmlNsDef { size_t num_args; char **args; @@ -301,7 +301,7 @@ struct _qemuDomainCmdlineDef { -void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def); +void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def); virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 5b5263ab66..f775751093 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3090,9 +3090,9 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { static void qemuDomainDefNamespaceFree(void *nsdata) { - qemuDomainCmdlineDefPtr cmd = nsdata; + qemuDomainXmlNsDefPtr cmd = nsdata; - qemuDomainCmdlineDefFree(cmd); + qemuDomainXmlNsDefFree(cmd); } static int @@ -3101,7 +3101,7 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, xmlXPathContextPtr ctxt, void **data) { - qemuDomainCmdlineDefPtr cmd = NULL; + qemuDomainXmlNsDefPtr cmd = NULL; bool uses_qemu_ns = false; xmlNodePtr *nodes = NULL; int n; @@ -3201,7 +3201,7 @@ static int qemuDomainDefNamespaceFormatXML(virBufferPtr buf, void *nsdata) { - qemuDomainCmdlineDefPtr cmd = nsdata; + qemuDomainXmlNsDefPtr cmd = nsdata; size_t i; if (!cmd->num_args && !cmd->num_env) @@ -8217,8 +8217,8 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HOOK, logCtxt); if (obj->def->namespaceData) { - qemuDomainCmdlineDefPtr qemucmd = obj->def->namespaceData; - if (qemucmd->num_args || qemucmd->num_env) + qemuDomainXmlNsDefPtr qemuxmlns = obj->def->namespaceData; + if (qemuxmlns->num_args || qemuxmlns->num_env) qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_ARGV, logCtxt); }