diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index afff77b1f3d17be03801bf766f20c122e73009f1..d98100160092c1829a4d165fbd04f5e6904b80d1 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 5debd7eb00d08b9f07530b15e5c1aec1336f3598..d638f1012d7afa8a3e56aecea89504d2cc771820 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -288,21 +288,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 f77575109377280a441ebca7f005efb35fa254fc..45a22fe648f4cff655bc1c276161349b7a179921 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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 qemuDomainDefNamespaceFree(void *nsdata) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 7223547e78cd0a849e1cf922a8a2f20babc9c75b..3b94f5a97c7462e69766181aabc9bade5805e8fb 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -529,6 +529,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,