This way it does not use driver, since it will be later reworked and the following patches cleaner, hopefully. Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx> --- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 7 ++++--- src/qemu/qemu_domain.h | 4 ++-- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 7 +++---- src/qemu/qemu_process.h | 3 +-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1b992d8eed7a..5d24439a6ff6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3421,7 +3421,7 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps, } else { /* We can have both pagesize and mem source. If that's the case, * prefer hugepages as those are more specific. */ - if (qemuGetMemoryBackingPath(priv->driver, def, mem->info.alias, &memPath) < 0) + if (qemuGetMemoryBackingPath(priv, def, mem->info.alias, &memPath) < 0) return -1; } @@ -7315,7 +7315,7 @@ qemuBuildMemPathStr(const virDomainDef *def, return -1; prealloc = true; } else if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) { - if (qemuGetMemoryBackingPath(priv->driver, def, "ram", &mem_path) < 0) + if (qemuGetMemoryBackingPath(priv, def, "ram", &mem_path) < 0) return -1; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 550ab5046f00..e3db3ee903c0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -13146,10 +13146,11 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConfig *cfg, int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, +qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path) { + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); const char *root = driver->embeddedRoot; g_autofree char *shortName = NULL; @@ -13181,7 +13182,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, * -1 otherwise (with error reported). */ int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath) @@ -13195,7 +13196,7 @@ qemuGetMemoryBackingPath(virQEMUDriver *driver, return -1; } - if (qemuGetMemoryBackingDomainPath(driver, def, &domainPath) < 0) + if (qemuGetMemoryBackingDomainPath(priv, def, &domainPath) < 0) return -1; *memPath = g_strdup_printf("%s/%s", domainPath, alias); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6681246c2338..6cc4c14f74d3 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1170,11 +1170,11 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConfig *cfg, virStorageSource *src); int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, +qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path); int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 75b97cf7367b..4ada4179dd7f 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2354,7 +2354,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, qemuDomainObjExitMonitor(vm); if (objAdded && mem) - ignore_value(qemuProcessDestroyMemoryBackingPath(driver, vm, mem)); + ignore_value(qemuProcessDestroyMemoryBackingPath(vm, mem)); virErrorRestore(&orig_err); if (!mem) @@ -4649,7 +4649,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriver *driver, if (qemuDomainNamespaceTeardownMemory(vm, mem) < 0) VIR_WARN("Unable to remove memory device from /dev"); - if (qemuProcessDestroyMemoryBackingPath(driver, vm, mem) < 0) + if (qemuProcessDestroyMemoryBackingPath(vm, mem) < 0) VIR_WARN("Unable to destroy memory backing path"); qemuDomainReleaseMemoryDeviceSlot(vm, mem); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2e4ee9e30502..1d3a905dd854 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4095,7 +4095,7 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *driver, if (!build || shouldBuildMB) { g_autofree char *path = NULL; - if (qemuGetMemoryBackingDomainPath(driver, vm->def, &path) < 0) + if (qemuGetMemoryBackingDomainPath(QEMU_DOMAIN_PRIVATE(vm), vm->def, &path) < 0) return -1; if (qemuProcessBuildDestroyMemoryPathsImpl(driver, vm, @@ -4108,13 +4108,12 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *driver, int -qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, - virDomainObj *vm, +qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, virDomainMemoryDef *mem) { g_autofree char *path = NULL; - if (qemuGetMemoryBackingPath(driver, vm->def, mem->info.alias, &path) < 0) + if (qemuGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm), vm->def, mem->info.alias, &path) < 0) return -1; if (unlink(path) < 0 && diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 2324aeb7bdff..878c522d8255 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -43,8 +43,7 @@ int qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *driver, virDomainMemoryDef *mem, bool build); -int qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, - virDomainObj *vm, +int qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, virDomainMemoryDef *mem); void qemuProcessReconnectAll(virQEMUDriver *driver); -- 2.46.0