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(a)redhat.com>
---
src/qemu/qemu_command.c | 4 ++--
src/qemu/qemu_domain.c | 9 +++++----
src/qemu/qemu_domain.h | 5 +++--
src/qemu/qemu_hotplug.c | 4 ++--
src/qemu/qemu_process.c | 7 +++----
src/qemu/qemu_process.h | 3 +--
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c20d033aea5a..f36b02b76b35 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3222,7 +3222,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;
}
@@ -7116,7 +7116,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 cd891fd58f52..9a2ce910a5c8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1736,10 +1736,11 @@ qemuDomainSecretPrepare(virQEMUDriver *driver,
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;
@@ -1760,7 +1761,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *driver,
/**
* qemuGetMemoryBackingPath:
- * @driver: the qemu driver
+ * @priv: domain private data
* @def: domain definition
* @alias: memory object alias
* @memPath: constructed path
@@ -1771,7 +1772,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *driver,
* -1 otherwise (with error reported).
*/
int
-qemuGetMemoryBackingPath(virQEMUDriver *driver,
+qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv,
const virDomainDef *def,
const char *alias,
char **memPath)
@@ -1785,7 +1786,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 9d897b761e3a..355a9e1cb21e 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -936,11 +936,12 @@ void qemuDomainCleanupStorageSourceFD(virStorageSource *src);
void qemuDomainStartupCleanup(virDomainObj *vm);
-int qemuGetMemoryBackingDomainPath(virQEMUDriver *driver,
+
+int qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
const virDomainDef *def,
char **path);
-int qemuGetMemoryBackingPath(virQEMUDriver *driver,
+int 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 2dcb627dbdc0..09a37caf85c3 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2404,7 +2404,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)
@@ -4761,7 +4761,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.1