Skip to content

Commit 9ee90cf

Browse files
committed
Merge tag 'qtest-20250102-pull-request' of https://gitlab.com/farosas/qemu into staging
Qtest pull request - migration-test: fix UADK build, reinstate postcopy tests and other cleanups - a couple of memory leak fixes for bios-tables-test and virtio-iommu-test - drop dead code from fw_cfg-test # -----BEGIN PGP SIGNATURE----- # # iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmd3DSMQHGZhcm9zYXNA # c3VzZS5kZQAKCRDHmNx0G+wxnUy5EACPnvy3U2jen2Cc5Hke69byCQtMkDTAJHH5 # xlwTLoTEF25AXMjLyee9vM4MoDHl+EUaGd3zmmAu2/P5/zOHWrBh9VbkFKDDvJJS # XTVSZ0Iv9a0LDGKsv74Pk7LUZCEanr9a0qpfYTFPuwUh9yu7pd4QeYpbEdwzKzX6 # TMpJTYOE5gUTgP6X8Ir6u3po8DChfE9Eb+Z3LhRU7S+Xi3FoUWRFgRzuvXhXLkf3 # SPNEA27XCaqWQjG8SfQ9yhafrEz9OIGq39Q2unSJ8Df8riYurrdhxYrWNZ/6URQi # /sYoBJZ2IMBzLg4cVOWXXQwdFkmU+0LUYPOANy6MrYRXl1QJtWway3eHOj+ZlkIH # r2ulAJWAXqIQ3Ki6Dv3TYCg0/snF8arFzmdsaAbn0M8YYQB7XAlcqHus5axEMIVO # 0VG7rXctRyH2h7DFfKeW/G1aaK5ox+/0aJoVhjmFJSlYZ2DUx+htfsPlIJmwhRRF # i61VaOw7NsrHsW0fEgTRurQBVVuZ2/nJT8saJwvXpFiJu0X1GQ6lmKQNlWqm5h6C # JyLc096+vOG0Cqih7p+M3NvKTHNQZQzUPSLJU2UXItPDPv1oAmFrHpVlBQiUD37I # h/2R6vxZIY5ei2ECFITnl+LaV4MNjGExpeOEi020KSLEz9Y8nk+i5E+4oDUct93z # wAsWLadmxg== # =sLkH # -----END PGP SIGNATURE----- # gpg: Signature made Thu 02 Jan 2025 17:03:15 EST # gpg: using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D # gpg: issuer "[email protected]" # gpg: Good signature from "Fabiano Rosas <[email protected]>" [unknown] # gpg: aka "Fabiano Almeida Rosas <[email protected]>" [unknown] # gpg: WARNING: The key's User ID is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3 64CF C798 DC74 1BEC 319D * tag 'qtest-20250102-pull-request' of https://gitlab.com/farosas/qemu: qtest/fw-cfg: remove compiled out code tests/qtest/migration: Re-enable postcopy tests tests/migration: Drop arch_[source|target] tests/qtest/virtio-iommu-test: Don't pass uninitialized data into qtest_memwrite tests/qtest/bios-tables-test: Free tables at dump_aml_files tests/qtest/migration: Initialize buffer in probe_o_direct_support tests/qtest/migration: Do proper cleanup in the dirty_limit test tests/qtest/migration: Fix compile errors when CONFIG_UADK is set Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents 1ada452 + d9f2b09 commit 9ee90cf

File tree

7 files changed

+16
-69
lines changed

7 files changed

+16
-69
lines changed

tests/qtest/bios-tables-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ static void dump_aml_files(test_data *data, bool rebuild)
292292

293293
g_free(aml_file);
294294
}
295+
free_test_data(&exp_data);
295296
}
296297

297298
static bool create_tmp_asl(AcpiSdtTable *sdt)

tests/qtest/fw_cfg-test.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,6 @@ int main(int argc, char **argv)
243243
qtest_add_func("fw_cfg/ram_size", test_fw_cfg_ram_size);
244244
qtest_add_func("fw_cfg/nographic", test_fw_cfg_nographic);
245245
qtest_add_func("fw_cfg/nb_cpus", test_fw_cfg_nb_cpus);
246-
#if 0
247-
qtest_add_func("fw_cfg/machine_id", test_fw_cfg_machine_id);
248-
qtest_add_func("fw_cfg/kernel", test_fw_cfg_kernel);
249-
qtest_add_func("fw_cfg/initrd", test_fw_cfg_initrd);
250-
qtest_add_func("fw_cfg/boot_device", test_fw_cfg_boot_device);
251-
#endif
252246
qtest_add_func("fw_cfg/max_cpus", test_fw_cfg_max_cpus);
253247
qtest_add_func("fw_cfg/numa", test_fw_cfg_numa);
254248
qtest_add_func("fw_cfg/boot_menu", test_fw_cfg_boot_menu);

tests/qtest/migration/compression-tests.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -88,59 +88,6 @@ migrate_hook_start_precopy_tcp_multifd_uadk(QTestState *from,
8888
return migrate_hook_start_precopy_tcp_multifd_common(from, to, "uadk");
8989
}
9090

91-
static void *
92-
migrate_hook_start_xbzrle(QTestState *from,
93-
QTestState *to)
94-
{
95-
migrate_set_parameter_int(from, "xbzrle-cache-size", 33554432);
96-
97-
migrate_set_capability(from, "xbzrle", true);
98-
migrate_set_capability(to, "xbzrle", true);
99-
100-
return NULL;
101-
}
102-
103-
static void test_precopy_unix_xbzrle(void)
104-
{
105-
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
106-
MigrateCommon args = {
107-
.connect_uri = uri,
108-
.listen_uri = uri,
109-
.start_hook = migrate_hook_start_xbzrle,
110-
.iterations = 2,
111-
/*
112-
* XBZRLE needs pages to be modified when doing the 2nd+ round
113-
* iteration to have real data pushed to the stream.
114-
*/
115-
.live = true,
116-
};
117-
118-
test_precopy_common(&args);
119-
}
120-
121-
static void *
122-
migrate_hook_start_precopy_tcp_multifd_zlib(QTestState *from,
123-
QTestState *to)
124-
{
125-
/*
126-
* Overloading this test to also check that set_parameter does not error.
127-
* This is also done in the tests for the other compression methods.
128-
*/
129-
migrate_set_parameter_int(from, "multifd-zlib-level", 2);
130-
migrate_set_parameter_int(to, "multifd-zlib-level", 2);
131-
132-
return migrate_hook_start_precopy_tcp_multifd_common(from, to, "zlib");
133-
}
134-
135-
static void test_multifd_tcp_zlib(void)
136-
{
137-
MigrateCommon args = {
138-
.listen_uri = "defer",
139-
.start_hook = migrate_hook_start_precopy_tcp_multifd_zlib,
140-
};
141-
test_precopy_common(&args);
142-
}
143-
14491
static void test_multifd_tcp_uadk(void)
14592
{
14693
MigrateCommon args = {
@@ -151,7 +98,6 @@ static void test_multifd_tcp_uadk(void)
15198
}
15299
#endif /* CONFIG_UADK */
153100

154-
155101
static void *
156102
migrate_hook_start_xbzrle(QTestState *from,
157103
QTestState *to)

tests/qtest/migration/framework.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ static void cleanup(const char *filename)
197197
int migrate_start(QTestState **from, QTestState **to, const char *uri,
198198
MigrateStart *args)
199199
{
200-
g_autofree gchar *arch_source = NULL;
201-
g_autofree gchar *arch_target = NULL;
202200
/* options for source and target */
203201
g_autofree gchar *arch_opts = NULL;
204202
g_autofree gchar *cmd_source = NULL;
@@ -307,12 +305,11 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri,
307305
"-name source,debug-threads=on "
308306
"-m %s "
309307
"-serial file:%s/src_serial "
310-
"%s %s %s %s %s",
308+
"%s %s %s %s",
311309
kvm_opts ? kvm_opts : "",
312310
machine, machine_opts,
313311
memory_size, tmpfs,
314312
arch_opts ? arch_opts : "",
315-
arch_source ? arch_source : "",
316313
shmem_opts ? shmem_opts : "",
317314
args->opts_source ? args->opts_source : "",
318315
ignore_stderr);
@@ -329,12 +326,11 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri,
329326
"-m %s "
330327
"-serial file:%s/dest_serial "
331328
"-incoming %s "
332-
"%s %s %s %s %s",
329+
"%s %s %s %s",
333330
kvm_opts ? kvm_opts : "",
334331
machine, machine_opts,
335332
memory_size, tmpfs, uri,
336333
arch_opts ? arch_opts : "",
337-
arch_target ? arch_target : "",
338334
shmem_opts ? shmem_opts : "",
339335
args->opts_target ? args->opts_target : "",
340336
ignore_stderr);

tests/qtest/migration/migration-util.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
#include "migration/bootfile.h"
2323
#include "migration/migration-util.h"
2424

25+
#if defined(__linux__)
26+
#include <sys/ioctl.h>
27+
#include <sys/syscall.h>
28+
#endif
29+
2530
/* for uffd_version_check() */
2631
#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
2732
#include <sys/eventfd.h>
@@ -31,7 +36,6 @@
3136
/* For dirty ring test; so far only x86_64 is supported */
3237
#if defined(__linux__) && defined(HOST_X86_64)
3338
#include "linux/kvm.h"
34-
#include <sys/ioctl.h>
3539
#endif
3640

3741

@@ -284,6 +288,7 @@ bool probe_o_direct_support(const char *tmpfs)
284288

285289
buf = qemu_try_memalign(len, len);
286290
g_assert(buf);
291+
memset(buf, 0, len);
287292

288293
ret = pwrite(fd, buf, len, offset);
289294
unlink(filename);

tests/qtest/migration/precopy-tests.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,11 @@ static void test_dirty_limit(void)
877877
migrate_cancel(from);
878878
wait_for_migration_status(from, "cancelled", NULL);
879879

880+
/* destination always fails after cancel */
881+
migration_event_wait(to, "failed");
882+
qtest_set_expected_status(to, EXIT_FAILURE);
883+
qtest_quit(to);
884+
880885
/* Check if dirty limit throttle switched off, set timeout 1ms */
881886
do {
882887
throttle_us_per_full =

tests/qtest/virtio-iommu-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int send_map(QTestState *qts, QVirtioIOMMU *v_iommu,
105105
QVirtQueue *vq = v_iommu->vq;
106106
uint64_t ro_addr, wr_addr;
107107
uint32_t free_head;
108-
struct virtio_iommu_req_map req;
108+
struct virtio_iommu_req_map req = {};
109109
size_t ro_size = sizeof(req) - sizeof(struct virtio_iommu_req_tail);
110110
size_t wr_size = sizeof(struct virtio_iommu_req_tail);
111111
struct virtio_iommu_req_tail buffer;
@@ -147,7 +147,7 @@ static int send_unmap(QTestState *qts, QVirtioIOMMU *v_iommu,
147147
QVirtQueue *vq = v_iommu->vq;
148148
uint64_t ro_addr, wr_addr;
149149
uint32_t free_head;
150-
struct virtio_iommu_req_unmap req;
150+
struct virtio_iommu_req_unmap req = {};
151151
size_t ro_size = sizeof(req) - sizeof(struct virtio_iommu_req_tail);
152152
size_t wr_size = sizeof(struct virtio_iommu_req_tail);
153153
struct virtio_iommu_req_tail buffer;

0 commit comments

Comments
 (0)