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: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_conf.c | 20 -------------------- src/qemu/qemu_conf.h | 15 --------------- src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ src/qemu/qemu_domain.h | 13 +++++++++++++ 4 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index afff77b1f3..d981001600 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -94,26 +94,6 @@ qemuDriverUnlock(virQEMUDriverPtr driver) 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 # define DEFAULT_LOADER_NVRAM \ "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 26aa96f194..386e774653 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -297,21 +297,6 @@ struct _virQEMUDriver { 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); int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 10215ffa47..74d5186bc7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3091,6 +3091,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 qemuDomainDefNamespaceFree(void *nsdata) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f92f0dbc27..474c7b613a 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -531,6 +531,19 @@ struct _qemuDomainSaveCookie { 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); const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list