[PATCH v2 3/4] Update unit test to support multiple memory backends

Michael Galaxy via Devel posted 4 patches 4 months, 2 weeks ago
There is a newer version of this series
[PATCH v2 3/4] Update unit test to support multiple memory backends
Posted by Michael Galaxy via Devel 4 months, 2 weeks ago
From: Michael Galaxy <mgalaxy@akamai.com>

Update the associated test case.

Signed-off-by: Michael Galaxy <mgalaxy@akamai.com>
---
 tests/testutilsqemu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index d70850cb5d..dd8db4835e 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -320,8 +320,9 @@ int qemuTestDriverInit(virQEMUDriver *driver)
     cfg->libDir = g_strdup("/var/lib/libvirt/qemu");
     VIR_FREE(cfg->channelTargetDir);
     cfg->channelTargetDir = g_strdup("/var/run/libvirt/qemu/channel");
-    VIR_FREE(cfg->memoryBackingDir);
-    cfg->memoryBackingDir = g_strdup("/var/lib/libvirt/qemu/ram");
+    g_free(cfg->memoryBackingDirs);
+    cfg->memoryBackingDirs = g_new0(char *, 1);
+    cfg->memoryBackingDirs[0] = g_strdup("/var/lib/libvirt/qemu/ram");
     VIR_FREE(cfg->nvramDir);
     cfg->nvramDir = g_strdup("/var/lib/libvirt/qemu/nvram");
     VIR_FREE(cfg->passtStateDir);
-- 
2.34.1
Re: [PATCH v2 3/4] Update unit test to support multiple memory backends
Posted by Martin Kletzander 2 months, 1 week ago
On Wed, Jun 05, 2024 at 04:37:37PM -0400, mgalaxy@akamai.com wrote:
>From: Michael Galaxy <mgalaxy@akamai.com>
>
>Update the associated test case.
>

This definitely needs to be part of the patch that changes this in qemu
driver code as otherwise the compilation would fail between these
patches and we require that the build (together with unit tests) passes
after each commit, mainly (but not only) due to possible future
bisections.

>Signed-off-by: Michael Galaxy <mgalaxy@akamai.com>
>---
> tests/testutilsqemu.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
>index d70850cb5d..dd8db4835e 100644
>--- a/tests/testutilsqemu.c
>+++ b/tests/testutilsqemu.c
>@@ -320,8 +320,9 @@ int qemuTestDriverInit(virQEMUDriver *driver)
>     cfg->libDir = g_strdup("/var/lib/libvirt/qemu");
>     VIR_FREE(cfg->channelTargetDir);
>     cfg->channelTargetDir = g_strdup("/var/run/libvirt/qemu/channel");
>-    VIR_FREE(cfg->memoryBackingDir);
>-    cfg->memoryBackingDir = g_strdup("/var/lib/libvirt/qemu/ram");
>+    g_free(cfg->memoryBackingDirs);
>+    cfg->memoryBackingDirs = g_new0(char *, 1);
>+    cfg->memoryBackingDirs[0] = g_strdup("/var/lib/libvirt/qemu/ram");
>     VIR_FREE(cfg->nvramDir);
>     cfg->nvramDir = g_strdup("/var/lib/libvirt/qemu/nvram");
>     VIR_FREE(cfg->passtStateDir);
>-- 
>2.34.1
>
Re: [PATCH v2 3/4] Update unit test to support multiple memory backends
Posted by Michael Galaxy via Devel 2 months, 1 week ago
Hi,

On 8/6/24 07:41, Martin Kletzander wrote:
> On Wed, Jun 05, 2024 at 04:37:37PM -0400, mgalaxy@akamai.com wrote:
>> From: Michael Galaxy <mgalaxy@akamai.com>
>>
>> Update the associated test case.
>>
>
> This definitely needs to be part of the patch that changes this in qemu
> driver code as otherwise the compilation would fail between these
> patches and we require that the build (together with unit tests) passes
> after each commit, mainly (but not only) due to possible future
> bisections.
>
Acknowledged.

- Michael