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

qemu: Move qemuDomainXmlNsDef(Free) from qemu_conf.(ch)

qemu_conf.c deals with the configuration file. Better fit for the
structure and freeing function will be qemu_domain.c where the rest of
the namespace parsing/formatting stuff resides.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 99759126
...@@ -94,26 +94,6 @@ qemuDriverUnlock(virQEMUDriverPtr driver) ...@@ -94,26 +94,6 @@ qemuDriverUnlock(virQEMUDriverPtr driver)
virMutexUnlock(&driver->lock); virMutexUnlock(&driver->lock);
} }
void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def)
{
size_t i;
if (!def)
return;
for (i = 0; i < def->num_args; i++)
VIR_FREE(def->args[i]);
for (i = 0; i < def->num_env; i++) {
VIR_FREE(def->env_name[i]);
VIR_FREE(def->env_value[i]);
}
VIR_FREE(def->args);
VIR_FREE(def->env_name);
VIR_FREE(def->env_value);
VIR_FREE(def);
}
#ifndef DEFAULT_LOADER_NVRAM #ifndef DEFAULT_LOADER_NVRAM
# define DEFAULT_LOADER_NVRAM \ # define DEFAULT_LOADER_NVRAM \
"/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \
......
...@@ -288,21 +288,6 @@ struct _virQEMUDriver { ...@@ -288,21 +288,6 @@ struct _virQEMUDriver {
virHashAtomicPtr migrationErrors; virHashAtomicPtr migrationErrors;
}; };
typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef;
typedef qemuDomainXmlNsDef *qemuDomainXmlNsDefPtr;
struct _qemuDomainXmlNsDef {
size_t num_args;
char **args;
unsigned int num_env;
char **env_name;
char **env_value;
};
void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def);
virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged); virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged);
int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
......
...@@ -3087,6 +3087,27 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { ...@@ -3087,6 +3087,27 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
}; };
static void
qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def)
{
size_t i;
if (!def)
return;
for (i = 0; i < def->num_args; i++)
VIR_FREE(def->args[i]);
for (i = 0; i < def->num_env; i++) {
VIR_FREE(def->env_name[i]);
VIR_FREE(def->env_value[i]);
}
VIR_FREE(def->args);
VIR_FREE(def->env_name);
VIR_FREE(def->env_value);
VIR_FREE(def);
}
static void static void
qemuDomainDefNamespaceFree(void *nsdata) qemuDomainDefNamespaceFree(void *nsdata)
{ {
......
...@@ -529,6 +529,19 @@ struct _qemuDomainSaveCookie { ...@@ -529,6 +529,19 @@ struct _qemuDomainSaveCookie {
virCPUDefPtr cpu; virCPUDefPtr cpu;
}; };
typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef;
typedef qemuDomainXmlNsDef *qemuDomainXmlNsDefPtr;
struct _qemuDomainXmlNsDef {
size_t num_args;
char **args;
unsigned int num_env;
char **env_name;
char **env_value;
};
qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm); qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm);
const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册