提交 99759126 编写于 作者: P Peter Krempa

qemu: Rename qemuDomainCmdlineDefPtr to qemuDomainXmlNsDefPtr

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 7e8a1a6e
...@@ -10854,14 +10854,14 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, ...@@ -10854,14 +10854,14 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL); virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL);
if (def->namespaceData) { if (def->namespaceData) {
qemuDomainCmdlineDefPtr qemucmd; qemuDomainXmlNsDefPtr qemuxmlns;
qemucmd = def->namespaceData; qemuxmlns = def->namespaceData;
for (i = 0; i < qemucmd->num_args; i++) for (i = 0; i < qemuxmlns->num_args; i++)
virCommandAddArg(cmd, qemucmd->args[i]); virCommandAddArg(cmd, qemuxmlns->args[i]);
for (i = 0; i < qemucmd->num_env; i++) for (i = 0; i < qemuxmlns->num_env; i++)
virCommandAddEnvPair(cmd, qemucmd->env_name[i], virCommandAddEnvPair(cmd, qemuxmlns->env_name[i],
NULLSTR_EMPTY(qemucmd->env_value[i])); NULLSTR_EMPTY(qemuxmlns->env_value[i]));
} }
if (qemuBuildSeccompSandboxCommandLine(cmd, cfg, qemuCaps) < 0) if (qemuBuildSeccompSandboxCommandLine(cmd, cfg, qemuCaps) < 0)
......
...@@ -94,7 +94,7 @@ qemuDriverUnlock(virQEMUDriverPtr driver) ...@@ -94,7 +94,7 @@ qemuDriverUnlock(virQEMUDriverPtr driver)
virMutexUnlock(&driver->lock); virMutexUnlock(&driver->lock);
} }
void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def) void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def)
{ {
size_t i; size_t i;
......
...@@ -288,9 +288,9 @@ struct _virQEMUDriver { ...@@ -288,9 +288,9 @@ struct _virQEMUDriver {
virHashAtomicPtr migrationErrors; virHashAtomicPtr migrationErrors;
}; };
typedef struct _qemuDomainCmdlineDef qemuDomainCmdlineDef; typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef;
typedef qemuDomainCmdlineDef *qemuDomainCmdlineDefPtr; typedef qemuDomainXmlNsDef *qemuDomainXmlNsDefPtr;
struct _qemuDomainCmdlineDef { struct _qemuDomainXmlNsDef {
size_t num_args; size_t num_args;
char **args; char **args;
...@@ -301,7 +301,7 @@ struct _qemuDomainCmdlineDef { ...@@ -301,7 +301,7 @@ struct _qemuDomainCmdlineDef {
void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def); void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def);
virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged); virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged);
......
...@@ -3090,9 +3090,9 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { ...@@ -3090,9 +3090,9 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
static void static void
qemuDomainDefNamespaceFree(void *nsdata) qemuDomainDefNamespaceFree(void *nsdata)
{ {
qemuDomainCmdlineDefPtr cmd = nsdata; qemuDomainXmlNsDefPtr cmd = nsdata;
qemuDomainCmdlineDefFree(cmd); qemuDomainXmlNsDefFree(cmd);
} }
static int static int
...@@ -3101,7 +3101,7 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, ...@@ -3101,7 +3101,7 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
xmlXPathContextPtr ctxt, xmlXPathContextPtr ctxt,
void **data) void **data)
{ {
qemuDomainCmdlineDefPtr cmd = NULL; qemuDomainXmlNsDefPtr cmd = NULL;
bool uses_qemu_ns = false; bool uses_qemu_ns = false;
xmlNodePtr *nodes = NULL; xmlNodePtr *nodes = NULL;
int n; int n;
...@@ -3201,7 +3201,7 @@ static int ...@@ -3201,7 +3201,7 @@ static int
qemuDomainDefNamespaceFormatXML(virBufferPtr buf, qemuDomainDefNamespaceFormatXML(virBufferPtr buf,
void *nsdata) void *nsdata)
{ {
qemuDomainCmdlineDefPtr cmd = nsdata; qemuDomainXmlNsDefPtr cmd = nsdata;
size_t i; size_t i;
if (!cmd->num_args && !cmd->num_env) if (!cmd->num_args && !cmd->num_env)
...@@ -8217,8 +8217,8 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, ...@@ -8217,8 +8217,8 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver,
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HOOK, logCtxt); qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HOOK, logCtxt);
if (obj->def->namespaceData) { if (obj->def->namespaceData) {
qemuDomainCmdlineDefPtr qemucmd = obj->def->namespaceData; qemuDomainXmlNsDefPtr qemuxmlns = obj->def->namespaceData;
if (qemucmd->num_args || qemucmd->num_env) if (qemuxmlns->num_args || qemuxmlns->num_env)
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_ARGV, logCtxt); qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_ARGV, logCtxt);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册