All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/25] qtest patches and misc header clean-ups
@ 2022-02-21 11:59 Thomas Huth
  2022-02-21 11:59 ` [PULL 01/25] tests/x86: Use 'pc' machine type for old hardware tests Thomas Huth
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

 Hi!

The following changes since commit e670f6d825d4dee248b311197fd4048469d6772b:

  Merge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220218' into staging (2022-02-20 15:05:41 +0000)

are available in the Git repository at:

  https://gitlab.com/thuth/qemu.git tags/pull-request-2022-02-21

for you to fetch changes up to 975592f5523fdf8708e4b53da937cf4805b1b79a:

  hw/tricore: Remove unused and incorrect header (2022-02-21 10:36:50 +0100)

----------------------------------------------------------------
* Improve virtio-net failover test
* Some small fixes for the qtests
* Misc header cleanups by Philippe

----------------------------------------------------------------
Dr. David Alan Gilbert (2):
      tests/x86: Use 'pc' machine type for old hardware tests
      tests/x86: Use 'pc' machine type for hotplug tests

Eric Auger (1):
      tests/qtest/vhost-user-test.c: Use vhostforce=on

Laurent Vivier (7):
      tests/qtest: failover: clean up pathname of tests
      tests/qtest: failover: use a macro for check_one_card()
      tests/qtest: failover: check the feature is correctly provided
      tests/qtest: failover: check missing guest feature
      tests/qtest: failover: check migration with failover off
      tests/qtest: failover: test migration if the guest doesn't support failover
      tests/qtest: failover: migration abort test with failover off

Michael S. Tsirkin (1):
      erst: drop cast to long long

Philippe Mathieu-Daudé (12):
      hw/tpm: Clean includes
      hw/remote: Add missing include
      hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header
      qtest: Add missing 'hw/qdev-core.h' include
      exec/ramblock: Add missing includes
      core/ptimers: Remove unnecessary 'sysemu/cpus.h' include
      target: Add missing "qemu/timer.h" include
      linux-user: Add missing "qemu/timer.h" include
      softmmu/runstate: Clean headers
      exec/exec-all: Move 'qemu/log.h' include in units requiring it
      hw/m68k/mcf: Add missing 'exec/hwaddr.h' header
      hw/tricore: Remove unused and incorrect header

Thomas Huth (2):
      tests/qtest/ide-test: Remove bad retry_isa test
      scripts: Remove the old switch-timer-api script

 bsd-user/signal.c                       |   1 +
 hw/acpi/memory_hotplug.c                |   1 -
 hw/arm/omap1.c                          |   1 +
 hw/core/ptimer.c                        |   1 -
 hw/display/omap_dss.c                   |   1 +
 hw/gpio/omap_gpio.c                     |   1 +
 hw/input/tsc210x.c                      |   1 +
 hw/remote/proxy-memory-listener.c       |   1 +
 hw/tpm/tpm_crb.c                        |   1 +
 hw/tpm/tpm_ppi.c                        |   4 +-
 hw/tpm/tpm_ppi.h                        |   4 +-
 include/exec/exec-all.h                 |   2 -
 include/exec/ramblock.h                 |   2 +
 include/hw/m68k/mcf.h                   |   1 +
 include/hw/tricore/triboard.h           |   1 -
 linux-user/i386/cpu_loop.c              |   1 +
 linux-user/ppc/cpu_loop.c               |   1 +
 monitor/misc.c                          |   1 +
 plugins/api.c                           |   1 +
 scripts/switch-timer-api                | 178 -------
 softmmu/qtest.c                         |   1 +
 softmmu/runstate.c                      |   3 +-
 target/alpha/helper.c                   |   2 +-
 target/arm/cpu.c                        |   1 +
 target/arm/helper.c                     |   2 +
 target/arm/m_helper.c                   |   1 +
 target/arm/mte_helper.c                 |   1 +
 target/avr/helper.c                     |   1 +
 target/cris/helper.c                    |   1 +
 target/hexagon/internal.h               |   2 +
 target/hexagon/translate.h              |   1 +
 target/hppa/cpu.c                       |   1 +
 target/hppa/helper.c                    |   2 +-
 target/hppa/mem_helper.c                |   1 +
 target/hppa/op_helper.c                 |   1 +
 target/i386/helper.c                    |   1 +
 target/i386/tcg/int_helper.c            |   1 +
 target/i386/tcg/misc_helper.c           |   1 +
 target/i386/tcg/sysemu/seg_helper.c     |   1 +
 target/i386/tcg/sysemu/svm_helper.c     |   1 +
 target/m68k/op_helper.c                 |   1 +
 target/microblaze/cpu.c                 |   1 +
 target/microblaze/mmu.c                 |   1 +
 target/microblaze/op_helper.c           |   1 +
 target/mips/tcg/exception.c             |   1 +
 target/mips/tcg/sysemu/special_helper.c |   1 +
 target/mips/tcg/translate.h             |   1 +
 target/openrisc/interrupt.c             |   1 +
 target/openrisc/mmu.c                   |   1 +
 target/ppc/excp_helper.c                |   1 +
 target/ppc/misc_helper.c                |   1 +
 target/riscv/csr.c                      |   1 +
 target/s390x/tcg/excp_helper.c          |   1 +
 target/s390x/tcg/mem_helper.c           |   1 +
 target/sparc/helper.c                   |   1 +
 target/sparc/ldst_helper.c              |   1 +
 target/sparc/mmu_helper.c               |   1 +
 target/tricore/helper.c                 |   2 +-
 target/xtensa/dbg_helper.c              |   1 +
 target/xtensa/exc_helper.c              |   1 +
 target/xtensa/fpu_helper.c              |   1 +
 target/xtensa/helper.c                  |   1 +
 target/xtensa/mmu_helper.c              |   1 +
 target/xtensa/win_helper.c              |   1 +
 tests/qtest/device-plug-test.c          |  20 +-
 tests/qtest/drive_del-test.c            |  35 +-
 tests/qtest/erst-test.c                 |   2 +-
 tests/qtest/fdc-test.c                  |   2 +-
 tests/qtest/hd-geo-test.c               |  16 +-
 tests/qtest/i440fx-test.c               |   2 +-
 tests/qtest/ide-test.c                  |  16 +-
 tests/qtest/ivshmem-test.c              |   7 +-
 tests/qtest/vhost-user-test.c           |   2 +-
 tests/qtest/virtio-net-failover.c       | 911 +++++++++++++++++++++++++-------
 74 files changed, 853 insertions(+), 416 deletions(-)
 delete mode 100755 scripts/switch-timer-api



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PULL 01/25] tests/x86: Use 'pc' machine type for old hardware tests
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 02/25] tests/x86: Use 'pc' machine type for hotplug tests Thomas Huth
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Dr. David Alan Gilbert, Michael S . Tsirkin

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

For tests that rely on old hardware, e.g. floppies or IDE drives,
explicitly select the 'pc' machine type.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220215162537.605030-2-dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fdc-test.c    |  2 +-
 tests/qtest/hd-geo-test.c | 12 +++++++++---
 tests/qtest/i440fx-test.c |  2 +-
 tests/qtest/ide-test.c    |  3 ++-
 4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c
index 8f6eee84a4..b0d40012e6 100644
--- a/tests/qtest/fdc-test.c
+++ b/tests/qtest/fdc-test.c
@@ -598,7 +598,7 @@ int main(int argc, char **argv)
     /* Run the tests */
     g_test_init(&argc, &argv, NULL);
 
-    qtest_start("-device floppy,id=floppy0");
+    qtest_start("-machine pc -device floppy,id=floppy0");
     qtest_irq_intercept_in(global_qtest, "ioapic");
     qtest_add_func("/fdc/cmos", test_cmos);
     qtest_add_func("/fdc/no_media_on_start", test_no_media_on_start);
diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c
index 771eaa741b..3554b5d500 100644
--- a/tests/qtest/hd-geo-test.c
+++ b/tests/qtest/hd-geo-test.c
@@ -178,9 +178,15 @@ static int append_arg(int argc, char *argv[], int argv_sz, char *arg)
 
 static int setup_common(char *argv[], int argv_sz)
 {
+    int new_argc;
     memset(cur_ide, 0, sizeof(cur_ide));
-    return append_arg(0, argv, argv_sz,
-                      g_strdup("-nodefaults"));
+    new_argc = append_arg(0, argv, argv_sz,
+                          g_strdup("-nodefaults"));
+    new_argc = append_arg(new_argc, argv, argv_sz,
+                          g_strdup("-machine"));
+    new_argc = append_arg(new_argc, argv, argv_sz,
+                          g_strdup("pc"));
+    return new_argc;
 }
 
 static void setup_mbr(int img_idx, MBRcontents mbr)
@@ -697,7 +703,7 @@ static void test_override(TestArgs *args, CHSResult expected[])
 
     joined_args = g_strjoinv(" ", args->argv);
 
-    qts = qtest_init(joined_args);
+    qts = qtest_initf("-machine pc %s", joined_args);
     fw_cfg = pc_fw_cfg_init(qts);
 
     read_bootdevices(fw_cfg, expected);
diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c
index 1f57d9684b..6d7d4d8d8f 100644
--- a/tests/qtest/i440fx-test.c
+++ b/tests/qtest/i440fx-test.c
@@ -35,7 +35,7 @@ static QPCIBus *test_start_get_bus(const TestData *s)
 {
     char *cmdline;
 
-    cmdline = g_strdup_printf("-smp %d", s->num_cpus);
+    cmdline = g_strdup_printf("-machine pc -smp %d", s->num_cpus);
     qtest_start(cmdline);
     g_free(cmdline);
     return qpci_new_pc(global_qtest, NULL);
diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c
index 3f8081e77d..84935578fb 100644
--- a/tests/qtest/ide-test.c
+++ b/tests/qtest/ide-test.c
@@ -128,10 +128,11 @@ static char debug_path[] = "/tmp/qtest-blkdebug.XXXXXX";
 static QTestState *ide_test_start(const char *cmdline_fmt, ...)
 {
     QTestState *qts;
+    g_autofree char *full_fmt = g_strdup_printf("-machine pc %s", cmdline_fmt);
     va_list ap;
 
     va_start(ap, cmdline_fmt);
-    qts = qtest_vinitf(cmdline_fmt, ap);
+    qts = qtest_vinitf(full_fmt, ap);
     va_end(ap);
 
     pc_alloc_init(&guest_malloc, qts, 0);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 02/25] tests/x86: Use 'pc' machine type for hotplug tests
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
  2022-02-21 11:59 ` [PULL 01/25] tests/x86: Use 'pc' machine type for old hardware tests Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 03/25] erst: drop cast to long long Thomas Huth
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Hotplug tests need a bridge setting up on q35, for now
keep them on 'pc'.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220215162537.605030-3-dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/device-plug-test.c | 20 +++++++++++++++++--
 tests/qtest/drive_del-test.c   | 35 +++++++++++++++++++++++++++++-----
 tests/qtest/hd-geo-test.c      |  4 ++--
 tests/qtest/ivshmem-test.c     |  7 ++++++-
 4 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index ad79bd4c14..404a92e132 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -63,7 +63,15 @@ static void wait_device_deleted_event(QTestState *qtest, const char *id)
 
 static void test_pci_unplug_request(void)
 {
-    QTestState *qtest = qtest_initf("-device virtio-mouse-pci,id=dev0");
+    const char *arch = qtest_get_arch();
+    const char *machine_addition = "";
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        machine_addition = "-machine pc";
+    }
+
+    QTestState *qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
+                                    machine_addition);
 
     /*
      * Request device removal. As the guest is not running, the request won't
@@ -79,8 +87,16 @@ static void test_pci_unplug_request(void)
 
 static void test_pci_unplug_json_request(void)
 {
+    const char *arch = qtest_get_arch();
+    const char *machine_addition = "";
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        machine_addition = "-machine pc";
+    }
+
     QTestState *qtest = qtest_initf(
-        "-device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'");
+        "%s -device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'",
+        machine_addition);
 
     /*
      * Request device removal. As the guest is not running, the request won't
diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c
index 8d08ee9995..0cc18dfa4a 100644
--- a/tests/qtest/drive_del-test.c
+++ b/tests/qtest/drive_del-test.c
@@ -235,14 +235,21 @@ static void test_drive_del_device_del(void)
 static void test_cli_device_del(void)
 {
     QTestState *qts;
+    const char *arch = qtest_get_arch();
+    const char *machine_addition = "";
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        machine_addition = "-machine pc";
+    }
 
     /*
      * -drive/-device and device_del.  Start with a drive used by a
      * device that unplugs after reset.
      */
-    qts = qtest_initf("-drive if=none,id=drive0,file=null-co://,"
+    qts = qtest_initf("%s -drive if=none,id=drive0,file=null-co://,"
                       "file.read-zeroes=on,format=raw"
                       " -device virtio-blk-%s,drive=drive0,id=dev0",
+                      machine_addition,
                       qvirtio_get_dev_type());
 
     device_del(qts, true);
@@ -266,13 +273,19 @@ static void test_empty_device_del(void)
 static void test_device_add_and_del(void)
 {
     QTestState *qts;
+    const char *arch = qtest_get_arch();
+    const char *machine_addition = "";
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        machine_addition = "-machine pc";
+    }
 
     /*
      * -drive/device_add and device_del.  Start with a drive used by a
      * device that unplugs after reset.
      */
-    qts = qtest_init("-drive if=none,id=drive0,file=null-co://,"
-                     "file.read-zeroes=on,format=raw");
+    qts = qtest_initf("%s -drive if=none,id=drive0,file=null-co://,"
+                     "file.read-zeroes=on,format=raw", machine_addition);
 
     device_add(qts);
     device_del(qts, true);
@@ -284,8 +297,14 @@ static void test_device_add_and_del(void)
 static void test_drive_add_device_add_and_del(void)
 {
     QTestState *qts;
+    const char *arch = qtest_get_arch();
+    const char *machine_addition = "";
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        machine_addition = "-machine pc";
+    }
 
-    qts = qtest_init("");
+    qts = qtest_init(machine_addition);
 
     /*
      * drive_add/device_add and device_del.  The drive is used by a
@@ -302,8 +321,14 @@ static void test_drive_add_device_add_and_del(void)
 static void test_blockdev_add_device_add_and_del(void)
 {
     QTestState *qts;
+    const char *arch = qtest_get_arch();
+    const char *machine_addition = "";
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        machine_addition = "-machine pc";
+    }
 
-    qts = qtest_init("");
+    qts = qtest_init(machine_addition);
 
     /*
      * blockdev_add/device_add and device_del.  The it drive is used by a
diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c
index 3554b5d500..64023c0574 100644
--- a/tests/qtest/hd-geo-test.c
+++ b/tests/qtest/hd-geo-test.c
@@ -839,7 +839,7 @@ static void test_override_scsi_hot_unplug(void)
 
     joined_args = g_strjoinv(" ", args->argv);
 
-    qts = qtest_init(joined_args);
+    qts = qtest_initf("-machine pc %s", joined_args);
     fw_cfg = pc_fw_cfg_init(qts);
 
     read_bootdevices(fw_cfg, expected);
@@ -899,7 +899,7 @@ static void test_override_virtio_hot_unplug(void)
 
     joined_args = g_strjoinv(" ", args->argv);
 
-    qts = qtest_init(joined_args);
+    qts = qtest_initf("-machine pc %s", joined_args);
     fw_cfg = pc_fw_cfg_init(qts);
 
     read_bootdevices(fw_cfg, expected);
diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c
index fe94dd3b96..4e8af42a9d 100644
--- a/tests/qtest/ivshmem-test.c
+++ b/tests/qtest/ivshmem-test.c
@@ -385,7 +385,12 @@ static void test_ivshmem_hotplug(void)
     QTestState *qts;
     const char *arch = qtest_get_arch();
 
-    qts = qtest_init("-object memory-backend-ram,size=1M,id=mb1");
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        qts = qtest_init("-object memory-backend-ram,size=1M,id=mb1"
+                         " -machine pc");
+    } else {
+        qts = qtest_init("-object memory-backend-ram,size=1M,id=mb1");
+    }
 
     qtest_qmp_device_add(qts, "ivshmem-plain", "iv1",
                          "{'addr': %s, 'memdev': 'mb1'}",
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 03/25] erst: drop cast to long long
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
  2022-02-21 11:59 ` [PULL 01/25] tests/x86: Use 'pc' machine type for old hardware tests Thomas Huth
  2022-02-21 11:59 ` [PULL 02/25] tests/x86: Use 'pc' machine type for hotplug tests Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 04/25] tests/qtest/vhost-user-test.c: Use vhostforce=on Thomas Huth
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Philippe Mathieu-Daudé, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

The way to print uint64_t is with PRIx64, not with
a cast to long long.

Message-Id: <20220206093547.1282513-1-mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/erst-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/erst-test.c b/tests/qtest/erst-test.c
index c6a0ae4013..f94cd8dd8e 100644
--- a/tests/qtest/erst-test.c
+++ b/tests/qtest/erst-test.c
@@ -75,7 +75,7 @@ static inline uint64_t in_reg64(ERSTState *s, unsigned reg)
     uint64_t res;
 
     res = qpci_io_readq(s->dev, s->reg_bar, reg);
-    g_test_message("*%s -> %016llx", name, (unsigned long long)res);
+    g_test_message("*%s -> %016" PRIx64, name, res);
 
     return res;
 }
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 04/25] tests/qtest/vhost-user-test.c: Use vhostforce=on
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (2 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 03/25] erst: drop cast to long long Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 05/25] tests/qtest/ide-test: Remove bad retry_isa test Thomas Huth
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Eric Auger

From: Eric Auger <eric.auger@redhat.com>

-netdev vhost-user,vhostforce is deprecated and vhostforce=on
should be used instead.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220210145254.157790-2-eric.auger@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/vhost-user-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index 2a4568cd7d..ee30f54796 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -42,7 +42,7 @@
 #define QEMU_CMD_MEMFD  " -m %d -object memory-backend-memfd,id=mem,size=%dM," \
                         " -numa node,memdev=mem"
 #define QEMU_CMD_CHR    " -chardev socket,id=%s,path=%s%s"
-#define QEMU_CMD_NETDEV " -netdev vhost-user,id=hs0,chardev=%s,vhostforce"
+#define QEMU_CMD_NETDEV " -netdev vhost-user,id=hs0,chardev=%s,vhostforce=on"
 
 #define HUGETLBFS_MAGIC       0x958458f6
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 05/25] tests/qtest/ide-test: Remove bad retry_isa test
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (3 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 04/25] tests/qtest/vhost-user-test.c: Use vhostforce=on Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 06/25] tests/qtest: failover: clean up pathname of tests Thomas Huth
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, John Snow

The retry_isa test is not doing what it was intended for: The
test_retry_flush() function ignores the machine parameter completely
and thus this test does not get run with the "isapc" machine.
Moreover, in the course of time, the test_retry_flush() has been
changed to depend on PCI-related functions, so this also cannot
be fixed by simply using the machine parameter now. The correct
fix would be to switch the whole test to libqos, but until someone
has time to do this, let's simply drop the retry_isa test for now.

Message-Id: <20220121120635.220644-1-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/ide-test.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c
index 84935578fb..19de3b4104 100644
--- a/tests/qtest/ide-test.c
+++ b/tests/qtest/ide-test.c
@@ -702,7 +702,7 @@ static void test_flush(void)
     free_pci_device(dev);
 }
 
-static void test_retry_flush(const char *machine)
+static void test_pci_retry_flush(void)
 {
     QTestState *qts;
     QPCIDevice *dev;
@@ -791,16 +791,6 @@ static void test_flush_empty_drive(void)
     ide_test_quit(qts);
 }
 
-static void test_pci_retry_flush(void)
-{
-    test_retry_flush("pc");
-}
-
-static void test_isa_retry_flush(void)
-{
-    test_retry_flush("isapc");
-}
-
 typedef struct Read10CDB {
     uint8_t opcode;
     uint8_t flags;
@@ -1051,7 +1041,6 @@ int main(int argc, char **argv)
     qtest_add_func("/ide/flush/nodev", test_flush_nodev);
     qtest_add_func("/ide/flush/empty_drive", test_flush_empty_drive);
     qtest_add_func("/ide/flush/retry_pci", test_pci_retry_flush);
-    qtest_add_func("/ide/flush/retry_isa", test_isa_retry_flush);
 
     qtest_add_func("/ide/cdrom/pio", test_cdrom_pio);
     qtest_add_func("/ide/cdrom/pio_large", test_cdrom_pio_large);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 06/25] tests/qtest: failover: clean up pathname of tests
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (4 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 05/25] tests/qtest/ide-test: Remove bad retry_isa test Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 07/25] tests/qtest: failover: use a macro for check_one_card() Thomas Huth
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

clearly indentify parameters, hotplug and migration tests

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-2-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 22ad54bb95..207c133012 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -1315,6 +1315,7 @@ int main(int argc, char **argv)
     g_assert_true(ret >= 0);
     close(ret);
 
+    /* parameters tests */
     qtest_add_func("failover-virtio-net/params/error/id", test_error_id);
     qtest_add_func("failover-virtio-net/params/error/pcie", test_error_pcie);
     qtest_add_func("failover-virtio-net/params/on", test_on);
@@ -1322,15 +1323,19 @@ int main(int argc, char **argv)
                    test_on_mismatch);
     qtest_add_func("failover-virtio-net/params/off", test_off);
     qtest_add_func("failover-virtio-net/params/enabled", test_enabled);
-    qtest_add_func("failover-virtio-net/hotplug_1", test_hotplug_1);
-    qtest_add_func("failover-virtio-net/hotplug_1_reverse",
+
+    /* hotplug tests */
+    qtest_add_func("failover-virtio-net/hotplug/1", test_hotplug_1);
+    qtest_add_func("failover-virtio-net/hotplug/1_reverse",
                    test_hotplug_1_reverse);
-    qtest_add_func("failover-virtio-net/hotplug_2", test_hotplug_2);
-    qtest_add_func("failover-virtio-net/hotplug_2_reverse",
+    qtest_add_func("failover-virtio-net/hotplug/2", test_hotplug_2);
+    qtest_add_func("failover-virtio-net/hotplug/2_reverse",
                    test_hotplug_2_reverse);
-    qtest_add_data_func("failover-virtio-net/migrate/out", tmpfile,
+
+    /* migration tests */
+    qtest_add_data_func("failover-virtio-net/migrate/on/out", tmpfile,
                         test_migrate_out);
-    qtest_add_data_func("failover-virtio-net/migrate/in", tmpfile,
+    qtest_add_data_func("failover-virtio-net/migrate/on/in", tmpfile,
                         test_migrate_in);
     qtest_add_data_func("failover-virtio-net/migrate/abort/wait-unplug",
                         tmpfile, test_migrate_abort_wait_unplug);
@@ -1340,9 +1345,9 @@ int main(int argc, char **argv)
         qtest_add_data_func("failover-virtio-net/migrate/abort/timeout",
                             tmpfile, test_migrate_abort_timeout);
     }
-    qtest_add_data_func("failover-virtio-net/multi/out",
+    qtest_add_data_func("failover-virtio-net/migrate/multi/out",
                         tmpfile, test_multi_out);
-    qtest_add_data_func("failover-virtio-net/multi/in",
+    qtest_add_data_func("failover-virtio-net/migrate/multi/in",
                    tmpfile, test_multi_in);
 
     ret = g_test_run();
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 07/25] tests/qtest: failover: use a macro for check_one_card()
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (5 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 06/25] tests/qtest: failover: clean up pathname of tests Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 08/25] tests/qtest: failover: check the feature is correctly provided Thomas Huth
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

This allows g_assert() to correctly report the line number of the error
in the test case.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-3-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 47 ++++++++++++++-----------------
 1 file changed, 21 insertions(+), 26 deletions(-)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 207c133012..070e53de12 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -224,32 +224,27 @@ static char *get_mac(QTestState *qts, const char *name)
     return mac;
 }
 
-static void check_one_card(QTestState *qts, bool present,
-                           const char *id, const char *mac)
-{
-    QDict *device;
-    QDict *bus;
-    char *addr;
-
-    bus = get_bus(qts, 0);
-    device = find_device(bus, id);
-    if (present) {
-        char *path;
-
-        g_assert_nonnull(device);
-        qobject_unref(device);
-
-        path = g_strdup_printf("/machine/peripheral/%s", id);
-        addr = get_mac(qts, path);
-        g_free(path);
-        g_assert_cmpstr(mac, ==, addr);
-        g_free(addr);
-    } else {
-       g_assert_null(device);
-    }
-
-    qobject_unref(bus);
-}
+#define check_one_card(qts, present, id, mac)                   \
+do {                                                            \
+    QDict *device;                                              \
+    QDict *bus;                                                 \
+    char *addr;                                                 \
+    bus = get_bus(qts, 0);                                      \
+    device = find_device(bus, id);                              \
+    if (present) {                                              \
+        char *path;                                             \
+        g_assert_nonnull(device);                               \
+        qobject_unref(device);                                  \
+        path = g_strdup_printf("/machine/peripheral/%s", id);   \
+        addr = get_mac(qts, path);                              \
+        g_free(path);                                           \
+        g_assert_cmpstr(mac, ==, addr);                         \
+        g_free(addr);                                           \
+    } else {                                                    \
+       g_assert_null(device);                                   \
+    }                                                           \
+    qobject_unref(bus);                                         \
+} while (0)
 
 static void test_on(void)
 {
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 08/25] tests/qtest: failover: check the feature is correctly provided
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (6 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 07/25] tests/qtest: failover: use a macro for check_one_card() Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 09/25] tests/qtest: failover: check missing guest feature Thomas Huth
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

Check QEMU provides the VIRTIO_NET_F_STANDBY if failover is on,
and doesn't if failover is off

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-4-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 139 ++++++++++++++++++------------
 1 file changed, 86 insertions(+), 53 deletions(-)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 070e53de12..4236796368 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -18,6 +18,8 @@
 #include "libqos/virtio-pci.h"
 #include "hw/pci/pci.h"
 
+#define VIRTIO_NET_F_STANDBY    62
+
 #define ACPI_PCIHP_ADDR_ICH9    0x0cc0
 #define PCI_EJ_BASE             0x0008
 #define PCI_SEL_BASE            0x0010
@@ -246,6 +248,65 @@ do {                                                            \
     qobject_unref(bus);                                         \
 } while (0)
 
+static QDict *get_failover_negociated_event(QTestState *qts)
+{
+    QDict *resp;
+    QDict *data;
+
+    resp = qtest_qmp_eventwait_ref(qts, "FAILOVER_NEGOTIATED");
+    g_assert(qdict_haskey(resp, "data"));
+
+    data = qdict_get_qdict(resp, "data");
+    g_assert(qdict_haskey(data, "device-id"));
+    qobject_ref(data);
+    qobject_unref(resp);
+
+    return data;
+}
+
+static QVirtioPCIDevice *start_virtio_net_internal(QTestState *qts,
+                                                   int bus, int slot,
+                                                   uint64_t *features)
+{
+    QVirtioPCIDevice *dev;
+    QPCIAddress addr;
+
+    addr.devfn = QPCI_DEVFN((bus << 5) + slot, 0);
+    dev = virtio_pci_new(pcibus, &addr);
+    g_assert_nonnull(dev);
+    qvirtio_pci_device_enable(dev);
+    qvirtio_start_device(&dev->vdev);
+    *features &= qvirtio_get_features(&dev->vdev);
+    qvirtio_set_features(&dev->vdev, *features);
+    qvirtio_set_driver_ok(&dev->vdev);
+    return dev;
+}
+
+static QVirtioPCIDevice *start_virtio_net(QTestState *qts, int bus, int slot,
+                                          const char *id, bool failover)
+{
+    QVirtioPCIDevice *dev;
+    uint64_t features;
+
+    features = ~(QVIRTIO_F_BAD_FEATURE |
+                 (1ull << VIRTIO_RING_F_INDIRECT_DESC) |
+                 (1ull << VIRTIO_RING_F_EVENT_IDX));
+
+    dev = start_virtio_net_internal(qts, bus, slot, &features);
+
+    g_assert(!!(features & (1ull << VIRTIO_NET_F_STANDBY)) == failover);
+
+    if (failover) {
+        QDict *resp;
+
+        resp = get_failover_negociated_event(qts);
+        g_assert_cmpstr(qdict_get_str(resp, "device-id"), ==, id);
+        qobject_unref(resp);
+    }
+
+    return dev;
+}
+
 static void test_on(void)
 {
     QTestState *qts;
@@ -254,6 +315,7 @@ static void test_on(void)
                         "-netdev user,id=hs0 "
                         "-device virtio-net,bus=root0,id=standby0,"
                         "failover=on,netdev=hs0,mac="MAC_STANDBY0" "
+                        "-netdev user,id=hs1 "
                         "-device virtio-net,bus=root1,id=primary0,"
                         "failover_pair_id=standby0,netdev=hs1,mac="MAC_PRIMARY0,
                         2);
@@ -267,6 +329,7 @@ static void test_on(void)
 static void test_on_mismatch(void)
 {
     QTestState *qts;
+    QVirtioPCIDevice *vdev;
 
     qts = machine_start(BASE_MACHINE
                      "-netdev user,id=hs0 "
@@ -280,12 +343,19 @@ static void test_on_mismatch(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
 
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    qos_object_destroy((QOSGraphObject *)vdev);
     machine_stop(qts);
 }
 
 static void test_off(void)
 {
     QTestState *qts;
+    QVirtioPCIDevice *vdev;
 
     qts = machine_start(BASE_MACHINE
                      "-netdev user,id=hs0 "
@@ -299,50 +369,13 @@ static void test_off(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
 
-    machine_stop(qts);
-}
+    vdev = start_virtio_net(qts, 1, 0, "standby0", false);
 
-static QDict *get_failover_negociated_event(QTestState *qts)
-{
-    QDict *resp;
-    QDict *data;
-
-    resp = qtest_qmp_eventwait_ref(qts, "FAILOVER_NEGOTIATED");
-    g_assert(qdict_haskey(resp, "data"));
-
-    data = qdict_get_qdict(resp, "data");
-    g_assert(qdict_haskey(data, "device-id"));
-    qobject_ref(data);
-    qobject_unref(resp);
-
-    return data;
-}
-
-static QVirtioPCIDevice *start_virtio_net(QTestState *qts, int bus, int slot,
-                             const char *id)
-{
-    QVirtioPCIDevice *dev;
-    uint64_t features;
-    QPCIAddress addr;
-    QDict *resp;
-
-    addr.devfn = QPCI_DEVFN((bus << 5) + slot, 0);
-    dev = virtio_pci_new(pcibus, &addr);
-    g_assert_nonnull(dev);
-    qvirtio_pci_device_enable(dev);
-    qvirtio_start_device(&dev->vdev);
-    features = qvirtio_get_features(&dev->vdev);
-    features = features & ~(QVIRTIO_F_BAD_FEATURE |
-                            (1ull << VIRTIO_RING_F_INDIRECT_DESC) |
-                            (1ull << VIRTIO_RING_F_EVENT_IDX));
-    qvirtio_set_features(&dev->vdev, features);
-    qvirtio_set_driver_ok(&dev->vdev);
-
-    resp = get_failover_negociated_event(qts);
-    g_assert_cmpstr(qdict_get_str(resp, "device-id"), ==, id);
-    qobject_unref(resp);
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
 
-    return dev;
+    qos_object_destroy((QOSGraphObject *)vdev);
+    machine_stop(qts);
 }
 
 static void test_enabled(void)
@@ -362,7 +395,7 @@ static void test_enabled(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
@@ -385,7 +418,7 @@ static void test_hotplug_1(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
@@ -427,7 +460,7 @@ static void test_hotplug_1_reverse(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
@@ -458,7 +491,7 @@ static void test_hotplug_2(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
@@ -514,7 +547,7 @@ static void test_hotplug_2_reverse(void)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
@@ -579,7 +612,7 @@ static void test_migrate_out(gconstpointer opaque)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
@@ -775,7 +808,7 @@ static void test_migrate_abort_wait_unplug(gconstpointer opaque)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
@@ -865,7 +898,7 @@ static void test_migrate_abort_active(gconstpointer opaque)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
@@ -959,7 +992,7 @@ static void test_migrate_abort_timeout(gconstpointer opaque)
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
 
-    vdev = start_virtio_net(qts, 1, 0, "standby0");
+    vdev = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, false, "primary0", MAC_PRIMARY0);
@@ -1070,7 +1103,7 @@ static void test_multi_out(gconstpointer opaque)
     check_one_card(qts, false, "standby1", MAC_STANDBY1);
     check_one_card(qts, false, "primary1", MAC_PRIMARY1);
 
-    vdev0 = start_virtio_net(qts, 1, 0, "standby0");
+    vdev0 = start_virtio_net(qts, 1, 0, "standby0", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
@@ -1101,7 +1134,7 @@ static void test_multi_out(gconstpointer opaque)
     check_one_card(qts, true, "standby1", MAC_STANDBY1);
     check_one_card(qts, false, "primary1", MAC_PRIMARY1);
 
-    vdev1 = start_virtio_net(qts, 3, 0, "standby1");
+    vdev1 = start_virtio_net(qts, 3, 0, "standby1", true);
 
     check_one_card(qts, true, "standby0", MAC_STANDBY0);
     check_one_card(qts, true, "primary0", MAC_PRIMARY0);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 09/25] tests/qtest: failover: check missing guest feature
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (7 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 08/25] tests/qtest: failover: check the feature is correctly provided Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 10/25] tests/qtest: failover: check migration with failover off Thomas Huth
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

If QEMU provides the VIRTIO_NET_F_STANDBY feature but the guest doesn't
the primary device must be kept hidden

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-5-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 33 +++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 4236796368..cbd8585fa8 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -404,6 +404,38 @@ static void test_enabled(void)
     machine_stop(qts);
 }
 
+static void test_guest_off(void)
+{
+    QTestState *qts;
+    QVirtioPCIDevice *vdev;
+    uint64_t features;
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-device virtio-net,bus=root0,id=standby0,"
+                     "failover=on,netdev=hs0,mac="MAC_STANDBY0" "
+                     "-netdev user,id=hs1 "
+                     "-device virtio-net,bus=root1,id=primary0,"
+                     "failover_pair_id=standby0,netdev=hs1,mac="MAC_PRIMARY0" ",
+                     2);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    features = ~(QVIRTIO_F_BAD_FEATURE |
+                 (1ull << VIRTIO_RING_F_INDIRECT_DESC) |
+                 (1ull << VIRTIO_RING_F_EVENT_IDX) |
+                 (1ull << VIRTIO_NET_F_STANDBY));
+
+    vdev = start_virtio_net_internal(qts, 1, 0, &features);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qos_object_destroy((QOSGraphObject *)vdev);
+    machine_stop(qts);
+}
+
 static void test_hotplug_1(void)
 {
     QTestState *qts;
@@ -1351,6 +1383,7 @@ int main(int argc, char **argv)
                    test_on_mismatch);
     qtest_add_func("failover-virtio-net/params/off", test_off);
     qtest_add_func("failover-virtio-net/params/enabled", test_enabled);
+    qtest_add_func("failover-virtio-net/params/guest_off", test_guest_off);
 
     /* hotplug tests */
     qtest_add_func("failover-virtio-net/hotplug/1", test_hotplug_1);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 10/25] tests/qtest: failover: check migration with failover off
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (8 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 09/25] tests/qtest: failover: check missing guest feature Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 11/25] tests/qtest: failover: test migration if the guest doesn't support failover Thomas Huth
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

If failover is off, the primary device is not plugged and
the migration is done only with the standby device.

On destination, the primary device must not be plugged.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-6-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 133 ++++++++++++++++++++++++++++++
 1 file changed, 133 insertions(+)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index cbd8585fa8..c99599bdcc 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -815,6 +815,135 @@ static void test_migrate_in(gconstpointer opaque)
     machine_stop(qts);
 }
 
+static void test_off_migrate_out(gconstpointer opaque)
+{
+    QTestState *qts;
+    QDict *resp, *args, *ret;
+    g_autofree gchar *uri = g_strdup_printf("exec: cat > %s", (gchar *)opaque);
+    const gchar *status;
+    QVirtioPCIDevice *vdev;
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-netdev user,id=hs1 ",
+                     2);
+
+    check_one_card(qts, false, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "standby0",
+                         "{'bus': 'root0',"
+                         "'failover': 'off',"
+                         "'netdev': 'hs0',"
+                         "'mac': '"MAC_STANDBY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "primary0",
+                         "{'bus': 'root1',"
+                         "'failover_pair_id': 'standby0',"
+                         "'netdev': 'hs1',"
+                         "'rombar': 0,"
+                         "'romfile': '',"
+                         "'mac': '"MAC_PRIMARY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    vdev = start_virtio_net(qts, 1, 0, "standby0", false);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    args = qdict_from_jsonf_nofail("{}");
+    g_assert_nonnull(args);
+    qdict_put_str(args, "uri", uri);
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate', 'arguments': %p}", args);
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    while (true) {
+        ret = migrate_status(qts);
+
+        status = qdict_get_str(ret, "status");
+        if (strcmp(status, "completed") == 0) {
+            qobject_unref(ret);
+            break;
+        }
+        g_assert_cmpstr(status, !=, "failed");
+        g_assert_cmpstr(status, !=, "cancelling");
+        g_assert_cmpstr(status, !=, "cancelled");
+        qobject_unref(ret);
+    }
+
+    qtest_qmp_eventwait(qts, "STOP");
+
+    qos_object_destroy((QOSGraphObject *)vdev);
+    machine_stop(qts);
+}
+
+static void test_off_migrate_in(gconstpointer opaque)
+{
+    QTestState *qts;
+    QDict *resp, *args, *ret;
+    g_autofree gchar *uri = g_strdup_printf("exec: cat %s", (gchar *)opaque);
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-netdev user,id=hs1 "
+                     "-incoming defer ",
+                     2);
+
+    check_one_card(qts, false, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "standby0",
+                         "{'bus': 'root0',"
+                         "'failover': 'off',"
+                         "'netdev': 'hs0',"
+                         "'mac': '"MAC_STANDBY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "primary0",
+                         "{'bus': 'root1',"
+                         "'failover_pair_id': 'standby0',"
+                         "'netdev': 'hs1',"
+                         "'rombar': 0,"
+                         "'romfile': '',"
+                         "'mac': '"MAC_PRIMARY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    args = qdict_from_jsonf_nofail("{}");
+    g_assert_nonnull(args);
+    qdict_put_str(args, "uri", uri);
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate-incoming', 'arguments': %p}",
+                     args);
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    resp = get_migration_event(qts);
+    g_assert_cmpstr(qdict_get_str(resp, "status"), ==, "setup");
+    qobject_unref(resp);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_eventwait(qts, "RESUME");
+
+    ret = migrate_status(qts);
+    g_assert_cmpstr(qdict_get_str(ret, "status"), ==, "completed");
+    qobject_unref(ret);
+
+    machine_stop(qts);
+}
+
 static void test_migrate_abort_wait_unplug(gconstpointer opaque)
 {
     QTestState *qts;
@@ -1398,6 +1527,10 @@ int main(int argc, char **argv)
                         test_migrate_out);
     qtest_add_data_func("failover-virtio-net/migrate/on/in", tmpfile,
                         test_migrate_in);
+    qtest_add_data_func("failover-virtio-net/migrate/off/out", tmpfile,
+                        test_off_migrate_out);
+    qtest_add_data_func("failover-virtio-net/migrate/off/in", tmpfile,
+                        test_off_migrate_in);
     qtest_add_data_func("failover-virtio-net/migrate/abort/wait-unplug",
                         tmpfile, test_migrate_abort_wait_unplug);
     qtest_add_data_func("failover-virtio-net/migrate/abort/active", tmpfile,
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 11/25] tests/qtest: failover: test migration if the guest doesn't support failover
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (9 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 10/25] tests/qtest: failover: check migration with failover off Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 12/25] tests/qtest: failover: migration abort test with failover off Thomas Huth
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

The primary device is not plugged and the migration is done only with
the standby device

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-7-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 142 ++++++++++++++++++++++++++++++
 1 file changed, 142 insertions(+)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index c99599bdcc..54a0a03241 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -944,6 +944,144 @@ static void test_off_migrate_in(gconstpointer opaque)
     machine_stop(qts);
 }
 
+static void test_guest_off_migrate_out(gconstpointer opaque)
+{
+    QTestState *qts;
+    QDict *resp, *args, *ret;
+    g_autofree gchar *uri = g_strdup_printf("exec: cat > %s", (gchar *)opaque);
+    const gchar *status;
+    QVirtioPCIDevice *vdev;
+    uint64_t features;
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-netdev user,id=hs1 ",
+                     2);
+
+    check_one_card(qts, false, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "standby0",
+                         "{'bus': 'root0',"
+                         "'failover': 'on',"
+                         "'netdev': 'hs0',"
+                         "'mac': '"MAC_STANDBY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "primary0",
+                         "{'bus': 'root1',"
+                         "'failover_pair_id': 'standby0',"
+                         "'netdev': 'hs1',"
+                         "'rombar': 0,"
+                         "'romfile': '',"
+                         "'mac': '"MAC_PRIMARY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    features = ~(QVIRTIO_F_BAD_FEATURE |
+                 (1ull << VIRTIO_RING_F_INDIRECT_DESC) |
+                 (1ull << VIRTIO_RING_F_EVENT_IDX) |
+                 (1ull << VIRTIO_NET_F_STANDBY));
+
+    vdev = start_virtio_net_internal(qts, 1, 0, &features);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    args = qdict_from_jsonf_nofail("{}");
+    g_assert_nonnull(args);
+    qdict_put_str(args, "uri", uri);
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate', 'arguments': %p}", args);
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    while (true) {
+        ret = migrate_status(qts);
+
+        status = qdict_get_str(ret, "status");
+        if (strcmp(status, "completed") == 0) {
+            qobject_unref(ret);
+            break;
+        }
+        g_assert_cmpstr(status, !=, "failed");
+        g_assert_cmpstr(status, !=, "cancelling");
+        g_assert_cmpstr(status, !=, "cancelled");
+        qobject_unref(ret);
+    }
+
+    qtest_qmp_eventwait(qts, "STOP");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qos_object_destroy((QOSGraphObject *)vdev);
+    machine_stop(qts);
+}
+
+static void test_guest_off_migrate_in(gconstpointer opaque)
+{
+    QTestState *qts;
+    QDict *resp, *args, *ret;
+    g_autofree gchar *uri = g_strdup_printf("exec: cat %s", (gchar *)opaque);
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-netdev user,id=hs1 "
+                     "-incoming defer ",
+                     2);
+
+    check_one_card(qts, false, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "standby0",
+                         "{'bus': 'root0',"
+                         "'failover': 'on',"
+                         "'netdev': 'hs0',"
+                         "'mac': '"MAC_STANDBY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "primary0",
+                         "{'bus': 'root1',"
+                         "'failover_pair_id': 'standby0',"
+                         "'netdev': 'hs1',"
+                         "'rombar': 0,"
+                         "'romfile': '',"
+                         "'mac': '"MAC_PRIMARY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    args = qdict_from_jsonf_nofail("{}");
+    g_assert_nonnull(args);
+    qdict_put_str(args, "uri", uri);
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate-incoming', 'arguments': %p}",
+                     args);
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    resp = get_migration_event(qts);
+    g_assert_cmpstr(qdict_get_str(resp, "status"), ==, "setup");
+    qobject_unref(resp);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_eventwait(qts, "RESUME");
+
+    ret = migrate_status(qts);
+    g_assert_cmpstr(qdict_get_str(ret, "status"), ==, "completed");
+    qobject_unref(ret);
+
+    machine_stop(qts);
+}
+
 static void test_migrate_abort_wait_unplug(gconstpointer opaque)
 {
     QTestState *qts;
@@ -1531,6 +1669,10 @@ int main(int argc, char **argv)
                         test_off_migrate_out);
     qtest_add_data_func("failover-virtio-net/migrate/off/in", tmpfile,
                         test_off_migrate_in);
+    qtest_add_data_func("failover-virtio-net/migrate/guest_off/out", tmpfile,
+                        test_guest_off_migrate_out);
+    qtest_add_data_func("failover-virtio-net/migrate/guest_off/in", tmpfile,
+                        test_guest_off_migrate_in);
     qtest_add_data_func("failover-virtio-net/migrate/abort/wait-unplug",
                         tmpfile, test_migrate_abort_wait_unplug);
     qtest_add_data_func("failover-virtio-net/migrate/abort/active", tmpfile,
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 12/25] tests/qtest: failover: migration abort test with failover off
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (10 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 11/25] tests/qtest: failover: test migration if the guest doesn't support failover Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 13/25] scripts: Remove the old switch-timer-api script Thomas Huth
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Peter Maydell

From: Laurent Vivier <lvivier@redhat.com>

Test abort during active migration when failover is disabled from QEMU
or from guest side.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-8-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/virtio-net-failover.c | 180 ++++++++++++++++++++++++++++++
 1 file changed, 180 insertions(+)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 54a0a03241..80292eecf6 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -1082,6 +1082,97 @@ static void test_guest_off_migrate_in(gconstpointer opaque)
     machine_stop(qts);
 }
 
+static void test_migrate_guest_off_abort(gconstpointer opaque)
+{
+    QTestState *qts;
+    QDict *resp, *args, *ret;
+    g_autofree gchar *uri = g_strdup_printf("exec: cat > %s", (gchar *)opaque);
+    const gchar *status;
+    QVirtioPCIDevice *vdev;
+    uint64_t features;
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-netdev user,id=hs1 ",
+                     2);
+
+    check_one_card(qts, false, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "standby0",
+                         "{'bus': 'root0',"
+                         "'failover': 'on',"
+                         "'netdev': 'hs0',"
+                         "'mac': '"MAC_STANDBY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "primary0",
+                         "{'bus': 'root1',"
+                         "'failover_pair_id': 'standby0',"
+                         "'netdev': 'hs1',"
+                         "'rombar': 0,"
+                         "'romfile': '',"
+                         "'mac': '"MAC_PRIMARY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    features = ~(QVIRTIO_F_BAD_FEATURE |
+                 (1ull << VIRTIO_RING_F_INDIRECT_DESC) |
+                 (1ull << VIRTIO_RING_F_EVENT_IDX) |
+                 (1ull << VIRTIO_NET_F_STANDBY));
+
+    vdev = start_virtio_net_internal(qts, 1, 0, &features);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    args = qdict_from_jsonf_nofail("{}");
+    g_assert_nonnull(args);
+    qdict_put_str(args, "uri", uri);
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate', 'arguments': %p}", args);
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    while (true) {
+        ret = migrate_status(qts);
+
+        status = qdict_get_str(ret, "status");
+        if (strcmp(status, "active") == 0) {
+            qobject_unref(ret);
+            break;
+        }
+        g_assert_cmpstr(status, !=, "failed");
+        qobject_unref(ret);
+    }
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate_cancel' }");
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    while (true) {
+        ret = migrate_status(qts);
+
+        status = qdict_get_str(ret, "status");
+        if (strcmp(status, "cancelled") == 0) {
+            qobject_unref(ret);
+            break;
+        }
+        g_assert_cmpstr(status, !=, "failed");
+        g_assert_cmpstr(status, !=, "active");
+        qobject_unref(ret);
+    }
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qos_object_destroy((QOSGraphObject *)vdev);
+    machine_stop(qts);
+}
+
 static void test_migrate_abort_wait_unplug(gconstpointer opaque)
 {
     QTestState *qts;
@@ -1265,6 +1356,91 @@ static void test_migrate_abort_active(gconstpointer opaque)
     machine_stop(qts);
 }
 
+static void test_migrate_off_abort(gconstpointer opaque)
+{
+    QTestState *qts;
+    QDict *resp, *args, *ret;
+    g_autofree gchar *uri = g_strdup_printf("exec: cat > %s", (gchar *)opaque);
+    const gchar *status;
+    QVirtioPCIDevice *vdev;
+
+    qts = machine_start(BASE_MACHINE
+                     "-netdev user,id=hs0 "
+                     "-netdev user,id=hs1 ",
+                     2);
+
+    check_one_card(qts, false, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "standby0",
+                         "{'bus': 'root0',"
+                         "'failover': 'off',"
+                         "'netdev': 'hs0',"
+                         "'mac': '"MAC_STANDBY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    vdev = start_virtio_net(qts, 1, 0, "standby0", false);
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+
+    qtest_qmp_device_add(qts, "virtio-net", "primary0",
+                         "{'bus': 'root1',"
+                         "'failover_pair_id': 'standby0',"
+                         "'netdev': 'hs1',"
+                         "'rombar': 0,"
+                         "'romfile': '',"
+                         "'mac': '"MAC_PRIMARY0"'}");
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    args = qdict_from_jsonf_nofail("{}");
+    g_assert_nonnull(args);
+    qdict_put_str(args, "uri", uri);
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate', 'arguments': %p}", args);
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    while (true) {
+        ret = migrate_status(qts);
+
+        status = qdict_get_str(ret, "status");
+        if (strcmp(status, "active") == 0) {
+            qobject_unref(ret);
+            break;
+        }
+        g_assert_cmpstr(status, !=, "failed");
+        qobject_unref(ret);
+    }
+
+    resp = qtest_qmp(qts, "{ 'execute': 'migrate_cancel' }");
+    g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
+    while (true) {
+        ret = migrate_status(qts);
+
+        status = qdict_get_str(ret, "status");
+        if (strcmp(status, "cancelled") == 0) {
+            qobject_unref(ret);
+            break;
+        }
+        g_assert_cmpstr(status, !=, "failed");
+        g_assert_cmpstr(status, !=, "active");
+        qobject_unref(ret);
+    }
+
+    check_one_card(qts, true, "standby0", MAC_STANDBY0);
+    check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+
+    qos_object_destroy((QOSGraphObject *)vdev);
+    machine_stop(qts);
+}
+
 static void test_migrate_abort_timeout(gconstpointer opaque)
 {
     QTestState *qts;
@@ -1669,10 +1845,14 @@ int main(int argc, char **argv)
                         test_off_migrate_out);
     qtest_add_data_func("failover-virtio-net/migrate/off/in", tmpfile,
                         test_off_migrate_in);
+    qtest_add_data_func("failover-virtio-net/migrate/off/abort", tmpfile,
+                        test_migrate_off_abort);
     qtest_add_data_func("failover-virtio-net/migrate/guest_off/out", tmpfile,
                         test_guest_off_migrate_out);
     qtest_add_data_func("failover-virtio-net/migrate/guest_off/in", tmpfile,
                         test_guest_off_migrate_in);
+    qtest_add_data_func("failover-virtio-net/migrate/guest_off/abort", tmpfile,
+                        test_migrate_guest_off_abort);
     qtest_add_data_func("failover-virtio-net/migrate/abort/wait-unplug",
                         tmpfile, test_migrate_abort_wait_unplug);
     qtest_add_data_func("failover-virtio-net/migrate/abort/active", tmpfile,
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 13/25] scripts: Remove the old switch-timer-api script
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (11 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 12/25] tests/qtest: failover: migration abort test with failover off Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 14/25] hw/tpm: Clean includes Thomas Huth
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

This script has been useful for the timer API rewrite in 2013, but
it is of no use anymore today. Let's remove it now.

Message-Id: <20220124102001.35930-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/switch-timer-api | 178 ---------------------------------------
 1 file changed, 178 deletions(-)
 delete mode 100755 scripts/switch-timer-api

diff --git a/scripts/switch-timer-api b/scripts/switch-timer-api
deleted file mode 100755
index 41736d11dd..0000000000
--- a/scripts/switch-timer-api
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use Getopt::Long;
-use FindBin;
-
-my @legacy = qw(qemu_clock_ptr qemu_get_clock_ns qemu_get_clock_ms qemu_register_clock_reset_notifier qemu_unregister_clock_reset_notifier qemu_new_timer qemu_free_timer qemu_del_timer qemu_mod_timer_ns qemu_mod_timer qemu_run_timers qemu_new_timer_ns qemu_new_timer_us qemu_new_timer_ms);
-my $legacyre = '\b('.join('|', @legacy).')\b';
-my $option_git;
-my $option_dryrun;
-my $option_quiet;
-my $option_rtc;
-my $suffix=".tmp.$$";
-my @files;
-my $getfiles = 'git grep -l -E \'\b((host|rt|vm|rtc)_clock\b|qemu_\w*timer)\' | egrep \'\.[ch]$\' | egrep -v \'qemu-timer\.c$|include/qemu/timer\.h$\'';
-
-sub Syntax
-{
-    print STDERR <<STOP;
-Usage: $FindBin::Script [options] FILE ...
-
-Translate each FILE to the new QEMU timer API. If no files
-are passed, a reasonable guess is taken.
-
-Options:
-  -q, --quiet     Do not show warnings etc
-  -d, --dry-run   Do a dry run
-  -g, --git       Generate a git commit for each change
-  -r, --rtc       Only fix up rtc usage
-  -h, --help      Print this message
-
-STOP
-return;
-}
-
-sub ParseOptions
-{
-    if (!GetOptions (
-	     "dry-run|d" => \$option_dryrun,
-             "git|g" => \$option_git,
-	     "quiet|q" => \$option_quiet,
-	     "rtc|r" => \$option_rtc,
-             "help|h" => sub { Syntax(); exit(0); }
-        ))
-    {
-        Syntax();
-        die "Bad options";
-    }
-
-    if ($#ARGV >=0)
-    {
-	@files = @ARGV;
-    }
-    else
-    {
-	@files = split(/\s+/, `$getfiles`);
-    }
-
-    foreach my $file (@files)
-    {
-	die "Cannot find $file" unless (-f $file && -r $file);
-    }
-}
-
-sub DoWarn
-{
-    my $text = shift @_;
-    my $line = shift @_;
-    return if ($option_quiet);
-    chomp ($line);
-    print STDERR "$text\n";
-    print STDERR "$line\n\n";
-}
-
-sub Process
-{
-    my $ifn = shift @_;
-    my $ofn = $ifn.$suffix;
-
-    my $intext;
-    my $outtext;
-    my $linenum = 0;
-
-    open my $input, "<", $ifn || die "Cannot open $ifn for read: $!";
-
-    while (<$input>)
-    {
-	my $line = $_;
-	$intext .= $line;
-	$linenum++;
-
-	# fix the specific uses
-	unless ($option_rtc)
-	{
-	    $line =~ s/\bqemu_new_timer(_[num]s)\s*\((vm_|rt_|host_)clock\b/timer_new$1(XXX_$2clock/g;
-	    $line =~ s/\bqemu_new_timer\s*\((vm_|rt_|host_)clock\b/timer_new(XXX_$1clock/g;
-	    $line =~ s/\bqemu_get_clock(_[num]s)\s*\((vm_|rt_|host_)clock\b/qemu_clock_get$1(XXX_$2clock/g;
-	}
-
-	# rtc is different
-	$line =~ s/\bqemu_new_timer(_[num]s)\s*\(rtc_clock\b/timer_new$1(rtc_clock/g;
-	$line =~ s/\bqemu_new_timer\s*\(rtc_clock\b/timer_new(rtc_clock/g;
-	$line =~ s/\bqemu_get_clock(_[num]s)\s*\(rtc_clock\b/qemu_clock_get$1(rtc_clock/g;
-	$line =~ s/\bqemu_register_clock_reset_notifier\s*\(rtc_clock\b/qemu_register_clock_reset_notifier(qemu_clock_ptr(rtc_clock)/g;
-
-	unless ($option_rtc)
-	{
-	    # fix up comments
-	    $line =~ s/\b(vm_|rt_|host_)clock\b/XXX_$1clock/g if ($line =~ m,^[/ ]+\*,);
-
-	    # spurious fprintf error reporting
-	    $line =~ s/: qemu_new_timer_ns failed/: timer_new_ns failed/g;
-
-	    # these have just changed name
-	    $line =~ s/\bqemu_mod_timer\b/timer_mod/g;
-	    $line =~ s/\bqemu_mod_timer_(ns|us|ms)\b/timer_mod_$1/g;
-	    $line =~ s/\bqemu_free_timer\b/timer_free/g;
-	    $line =~ s/\bqemu_del_timer\b/timer_del/g;
-	}
-
-	# fix up rtc_clock
-	$line =~ s/QEMUClock \*rtc_clock;/QEMUClockType rtc_clock;/g;
-	$line =~ s/\brtc_clock = (vm_|rt_|host_)clock\b/rtc_clock = XXX_$1clock/g;
-
-	unless ($option_rtc)
-	{
-	    # replace any more general uses
-	    $line =~ s/\b(vm_|rt_|host_)clock\b/qemu_clock_ptr(XXX_$1clock)/g;
-	}
-
-	# fix up the place holders
-	$line =~ s/\bXXX_vm_clock\b/QEMU_CLOCK_VIRTUAL/g;
-	$line =~ s/\bXXX_rt_clock\b/QEMU_CLOCK_REALTIME/g;
-	$line =~ s/\bXXX_host_clock\b/QEMU_CLOCK_HOST/g;
-
-	unless ($option_rtc)
-	{
-	    DoWarn("$ifn:$linenum WARNING: timer $1 not fixed up", $line) if ($line =~ /\b((vm_|rt_|host_)clock)\b/);
-	    DoWarn("$ifn:$linenum WARNING: function $1 not fixed up", $line) if ($line =~ /\b(qemu_new_timer\w+)\b/);
-	    DoWarn("$ifn:$linenum WARNING: legacy function $1 remains", $line) if ($line =~ /$legacyre/o);
-	}
-
-	$outtext .= $line;
-    }
-
-    close $input;
-
-    if ($intext ne $outtext)
-    {
-	print STDERR "Patching $ifn\n" unless ($option_quiet);
-	unless ($option_dryrun)
-	{
-	    open my $output, ">", $ofn || die "Cannot open $ofn for write: $!";
-	    print $output $outtext;
-	    close $output;
-	    rename ($ofn, $ifn) || die "Cannot rename temp file to $ifn: $!";
-	    return 1;
-	}
-    }
-    return 0;
-}
-
-sub DoCommit
-{
-    my $file = shift @_;
-    open (my $git, "| git commit -F - $file") || die "Cannot run git commit on $file: $!";
-    print $git "timers api: use new timer api in $file\n\nConvert $file to use new timer API.\nThis is an automated commit made by scripts/switch-timer-api\n";
-    close ($git);
-}
-
-ParseOptions;
-
-foreach my $file (@files)
-{
-    my $changed = Process ($file);
-    DoCommit($file) if ($changed && $option_git);
-}
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 14/25] hw/tpm: Clean includes
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (12 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 13/25] scripts: Remove the old switch-timer-api script Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 15/25] hw/remote: Add missing include Thomas Huth
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

"tpm_ppi.h" only requires to include "exec/memory.h" to get
the MemoryRegion declaration.

tpm_ppi.c requires "hw/qdev-core.h" to use the DEVICE() macro,
tpm_crb.c is the only source file requiring "exec/address-spaces.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-2-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/tpm/tpm_crb.c | 1 +
 hw/tpm/tpm_ppi.c | 4 ++--
 hw/tpm/tpm_ppi.h | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index 58ebd1469c..aa9c00aad3 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -18,6 +18,7 @@
 
 #include "qemu/module.h"
 #include "qapi/error.h"
+#include "exec/address-spaces.h"
 #include "hw/qdev-properties.h"
 #include "hw/pci/pci_ids.h"
 #include "hw/acpi/tpm.h"
diff --git a/hw/tpm/tpm_ppi.c b/hw/tpm/tpm_ppi.c
index 274e9aa4b0..6dbb9f41e4 100644
--- a/hw/tpm/tpm_ppi.c
+++ b/hw/tpm/tpm_ppi.c
@@ -14,9 +14,9 @@
 #include "qemu/osdep.h"
 
 #include "qapi/error.h"
-#include "cpu.h"
 #include "sysemu/memory_mapping.h"
 #include "migration/vmstate.h"
+#include "hw/qdev-core.h"
 #include "hw/acpi/tpm.h"
 #include "tpm_ppi.h"
 #include "trace.h"
@@ -44,7 +44,7 @@ void tpm_ppi_reset(TPMPPI *tpmppi)
     }
 }
 
-void tpm_ppi_init(TPMPPI *tpmppi, struct MemoryRegion *m,
+void tpm_ppi_init(TPMPPI *tpmppi, MemoryRegion *m,
                   hwaddr addr, Object *obj)
 {
     tpmppi->buf = qemu_memalign(qemu_real_host_page_size,
diff --git a/hw/tpm/tpm_ppi.h b/hw/tpm/tpm_ppi.h
index 6f773c25a0..bf5d4a300f 100644
--- a/hw/tpm/tpm_ppi.h
+++ b/hw/tpm/tpm_ppi.h
@@ -12,7 +12,7 @@
 #ifndef TPM_TPM_PPI_H
 #define TPM_TPM_PPI_H
 
-#include "exec/address-spaces.h"
+#include "exec/memory.h"
 
 typedef struct TPMPPI {
     MemoryRegion ram;
@@ -29,7 +29,7 @@ typedef struct TPMPPI {
  * Register the TPM PPI memory region at @addr on the given address
  * space for the object @obj.
  **/
-void tpm_ppi_init(TPMPPI *tpmppi, struct MemoryRegion *m,
+void tpm_ppi_init(TPMPPI *tpmppi, MemoryRegion *m,
                   hwaddr addr, Object *obj);
 
 /**
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 15/25] hw/remote: Add missing include
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (13 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 14/25] hw/tpm: Clean includes Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 11:59 ` [PULL 16/25] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header Thomas Huth
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Jagannathan Raman,
	Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Currently "qemu/error-report.h" is implicitly included, however
if headers in include/ get refactored, we get:

  hw/remote/proxy-memory-listener.c: In function ‘proxy_memory_listener_commit’:
  hw/remote/proxy-memory-listener.c:183:9: error: implicit declaration of function ‘error_report’; did you mean ‘error_report_err’? [-Werror=implicit-function-declaration]
    183 |         error_report("Number of fds is more than %d", REMOTE_MAX_FDS);
        |         ^~~~~~~~~~~~
        |         error_report_err

Add the missing "qemu/error-report.h" header to avoid that.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-3-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/remote/proxy-memory-listener.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/remote/proxy-memory-listener.c b/hw/remote/proxy-memory-listener.c
index 882c9b4854..0e893f3189 100644
--- a/hw/remote/proxy-memory-listener.c
+++ b/hw/remote/proxy-memory-listener.c
@@ -16,6 +16,7 @@
 #include "exec/cpu-common.h"
 #include "exec/ram_addr.h"
 #include "qapi/error.h"
+#include "qemu/error-report.h"
 #include "hw/remote/mpqemu-link.h"
 #include "hw/remote/proxy-memory-listener.h"
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 16/25] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (14 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 15/25] hw/remote: Add missing include Thomas Huth
@ 2022-02-21 11:59 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 17/25] qtest: Add missing 'hw/qdev-core.h' include Thomas Huth
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé,
	Igor Mammedov

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20220207082756.82600-4-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/acpi/memory_hotplug.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index a581a2183b..0a7e89a13e 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include "hw/acpi/memory_hotplug.h"
-#include "hw/acpi/pc-hotplug.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/qdev-core.h"
 #include "migration/vmstate.h"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 17/25] qtest: Add missing 'hw/qdev-core.h' include
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (15 preceding siblings ...)
  2022-02-21 11:59 ` [PULL 16/25] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 18/25] exec/ramblock: Add missing includes Thomas Huth
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Add "hw/qdev-core.h" to avoid when refactoring include/:

  softmmu/qtest.c:404:9: error: use of undeclared identifier 'NamedGPIOList'
        NamedGPIOList *ngl;
        ^

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-5-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 softmmu/qtest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index 72751e1fd8..8b7cb6aa8e 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -19,6 +19,7 @@
 #include "chardev/char-fe.h"
 #include "exec/ioport.h"
 #include "exec/memory.h"
+#include "hw/qdev-core.h"
 #include "hw/irq.h"
 #include "qemu/accel.h"
 #include "sysemu/cpu-timers.h"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 18/25] exec/ramblock: Add missing includes
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (16 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 17/25] qtest: Add missing 'hw/qdev-core.h' include Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 19/25] core/ptimers: Remove unnecessary 'sysemu/cpus.h' include Thomas Huth
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

"exec/ramblock.h" requires "qemu/rcu.h" for the definition of
rcu_head, and "exec/ramlist.h" for the definition of RAMBlockNotifier.
Add them to avoid when when refactoring include/:

  include/exec/ramblock.h:26:21: error: field has incomplete type 'struct rcu_head'
    struct rcu_head rcu;
                    ^

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-6-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/exec/ramblock.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/exec/ramblock.h b/include/exec/ramblock.h
index 664701b759..6cbedf9e0c 100644
--- a/include/exec/ramblock.h
+++ b/include/exec/ramblock.h
@@ -21,6 +21,8 @@
 
 #ifndef CONFIG_USER_ONLY
 #include "cpu-common.h"
+#include "qemu/rcu.h"
+#include "exec/ramlist.h"
 
 struct RAMBlock {
     struct rcu_head rcu;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 19/25] core/ptimers: Remove unnecessary 'sysemu/cpus.h' include
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (17 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 18/25] exec/ramblock: Add missing includes Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 20/25] target: Add missing "qemu/timer.h" include Thomas Huth
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-7-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/core/ptimer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
index 6ba19fd965..eb5ba1aff7 100644
--- a/hw/core/ptimer.c
+++ b/hw/core/ptimer.c
@@ -14,7 +14,6 @@
 #include "sysemu/cpu-timers.h"
 #include "sysemu/qtest.h"
 #include "block/aio.h"
-#include "sysemu/cpus.h"
 #include "hw/clock.h"
 
 #define DELTA_ADJUST     1
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 20/25] target: Add missing "qemu/timer.h" include
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (18 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 19/25] core/ptimers: Remove unnecessary 'sysemu/cpus.h' include Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 21/25] linux-user: " Thomas Huth
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Alistair Francis, Richard Henderson,
	Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

timer_new_ns(), cpu_get_host_ticks() and NANOSECONDS_PER_SECOND are
declared in "qemu/timer.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20220207082756.82600-8-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/arm/cpu.c      | 1 +
 target/arm/helper.c   | 1 +
 target/hppa/cpu.c     | 1 +
 target/riscv/csr.c    | 1 +
 target/sparc/helper.c | 1 +
 5 files changed, 5 insertions(+)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 5a9c02a256..525974b936 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/qemu-print.h"
+#include "qemu/timer.h"
 #include "qemu-common.h"
 #include "target/arm/idau.h"
 #include "qemu/module.h"
diff --git a/target/arm/helper.c b/target/arm/helper.c
index b5f80988c9..795b35532f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -15,6 +15,7 @@
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
 #include "qemu/main-loop.h"
+#include "qemu/timer.h"
 #include "qemu/bitops.h"
 #include "qemu/crc32c.h"
 #include "qemu/qemu-print.h"
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 37b763fca0..5f46ba801e 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/qemu-print.h"
+#include "qemu/timer.h"
 #include "cpu.h"
 #include "qemu/module.h"
 #include "exec/exec-all.h"
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index fe2c8dd40e..a938760a3f 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/log.h"
+#include "qemu/timer.h"
 #include "cpu.h"
 #include "qemu/main-loop.h"
 #include "exec/exec-all.h"
diff --git a/target/sparc/helper.c b/target/sparc/helper.c
index c7bcaa3a20..c4358bba84 100644
--- a/target/sparc/helper.c
+++ b/target/sparc/helper.c
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
+#include "qemu/timer.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 21/25] linux-user: Add missing "qemu/timer.h" include
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (19 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 20/25] target: Add missing "qemu/timer.h" include Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 22/25] softmmu/runstate: Clean headers Thomas Huth
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

"qemu/timer.h" declares cpu_get_host_ticks().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-9-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 linux-user/i386/cpu_loop.c | 1 +
 linux-user/ppc/cpu_loop.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c
index 29dfd7cd0c..90bffc1956 100644
--- a/linux-user/i386/cpu_loop.c
+++ b/linux-user/i386/cpu_loop.c
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu.h"
+#include "qemu/timer.h"
 #include "user-internals.h"
 #include "cpu_loop-common.h"
 #include "signal-common.h"
diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c
index 38097b02ff..c5d809916f 100644
--- a/linux-user/ppc/cpu_loop.c
+++ b/linux-user/ppc/cpu_loop.c
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu.h"
+#include "qemu/timer.h"
 #include "user-internals.h"
 #include "cpu_loop-common.h"
 #include "signal-common.h"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 22/25] softmmu/runstate: Clean headers
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (20 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 21/25] linux-user: " Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 23/25] exec/exec-all: Move 'qemu/log.h' include in units requiring it Thomas Huth
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé,
	Paolo Bonzini

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Add the missing 'qemu/log.h' header and remove the
unused 'exec/exec-all.h' one.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220207075426.81934-14-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 softmmu/runstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 10d9b7365a..3cb2758b33 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -30,7 +30,6 @@
 #include "crypto/cipher.h"
 #include "crypto/init.h"
 #include "exec/cpu-common.h"
-#include "exec/exec-all.h"
 #include "exec/gdbstub.h"
 #include "hw/boards.h"
 #include "migration/misc.h"
@@ -44,6 +43,7 @@
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/job.h"
+#include "qemu/log.h"
 #include "qemu/module.h"
 #include "qemu/plugin.h"
 #include "qemu/sockets.h"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 23/25] exec/exec-all: Move 'qemu/log.h' include in units requiring it
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (21 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 22/25] softmmu/runstate: Clean headers Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 24/25] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header Thomas Huth
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Many files use "qemu/log.h" declarations but neglect to include
it (they inherit it via "exec/exec-all.h"). "exec/exec-all.h" is
a core component and shouldn't be used that way. Move the
"qemu/log.h" inclusion locally to each unit requiring it.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220207082756.82600-10-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 bsd-user/signal.c                       | 1 +
 hw/arm/omap1.c                          | 1 +
 hw/display/omap_dss.c                   | 1 +
 hw/gpio/omap_gpio.c                     | 1 +
 hw/input/tsc210x.c                      | 1 +
 include/exec/exec-all.h                 | 2 --
 monitor/misc.c                          | 1 +
 plugins/api.c                           | 1 +
 softmmu/runstate.c                      | 1 +
 target/alpha/helper.c                   | 2 +-
 target/arm/helper.c                     | 1 +
 target/arm/m_helper.c                   | 1 +
 target/arm/mte_helper.c                 | 1 +
 target/avr/helper.c                     | 1 +
 target/cris/helper.c                    | 1 +
 target/hexagon/internal.h               | 2 ++
 target/hexagon/translate.h              | 1 +
 target/hppa/helper.c                    | 2 +-
 target/hppa/mem_helper.c                | 1 +
 target/hppa/op_helper.c                 | 1 +
 target/i386/helper.c                    | 1 +
 target/i386/tcg/int_helper.c            | 1 +
 target/i386/tcg/misc_helper.c           | 1 +
 target/i386/tcg/sysemu/seg_helper.c     | 1 +
 target/i386/tcg/sysemu/svm_helper.c     | 1 +
 target/m68k/op_helper.c                 | 1 +
 target/microblaze/cpu.c                 | 1 +
 target/microblaze/mmu.c                 | 1 +
 target/microblaze/op_helper.c           | 1 +
 target/mips/tcg/exception.c             | 1 +
 target/mips/tcg/sysemu/special_helper.c | 1 +
 target/mips/tcg/translate.h             | 1 +
 target/openrisc/interrupt.c             | 1 +
 target/openrisc/mmu.c                   | 1 +
 target/ppc/excp_helper.c                | 1 +
 target/ppc/misc_helper.c                | 1 +
 target/s390x/tcg/excp_helper.c          | 1 +
 target/s390x/tcg/mem_helper.c           | 1 +
 target/sparc/ldst_helper.c              | 1 +
 target/sparc/mmu_helper.c               | 1 +
 target/tricore/helper.c                 | 2 +-
 target/xtensa/dbg_helper.c              | 1 +
 target/xtensa/exc_helper.c              | 1 +
 target/xtensa/fpu_helper.c              | 1 +
 target/xtensa/helper.c                  | 1 +
 target/xtensa/mmu_helper.c              | 1 +
 target/xtensa/win_helper.c              | 1 +
 47 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index 0bc6d2edbd..8a36b696d8 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu.h"
 #include "signal-common.h"
 #include "trace.h"
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 9852c2a07e..f693faa43e 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 #include "qapi/error.h"
diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c
index 21fde58a26..8c0e9ee700 100644
--- a/hw/display/omap_dss.c
+++ b/hw/display/omap_dss.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "hw/hw.h"
 #include "hw/irq.h"
 #include "ui/console.h"
diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
index e25084b40c..bd0841d57f 100644
--- a/hw/gpio/omap_gpio.c
+++ b/hw/gpio/omap_gpio.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
 #include "hw/arm/omap.h"
diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c
index 182d3725fc..b0d5c2dd74 100644
--- a/hw/input/tsc210x.c
+++ b/hw/input/tsc210x.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "hw/hw.h"
 #include "audio/audio.h"
 #include "qemu/timer.h"
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 35d8e93976..227e10ba56 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -40,8 +40,6 @@ typedef ram_addr_t tb_page_addr_t;
 #define TB_PAGE_ADDR_FMT RAM_ADDR_FMT
 #endif
 
-#include "qemu/log.h"
-
 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns);
 void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb,
                           target_ulong *data);
diff --git a/monitor/misc.c b/monitor/misc.c
index a3a6e47844..b1839cb8ee 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -41,6 +41,7 @@
 #include "disas/disas.h"
 #include "sysemu/balloon.h"
 #include "qemu/timer.h"
+#include "qemu/log.h"
 #include "sysemu/hw_accel.h"
 #include "sysemu/runstate.h"
 #include "authz/list.h"
diff --git a/plugins/api.c b/plugins/api.c
index 91e0c7074c..7bf71b189d 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -36,6 +36,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/plugin.h"
+#include "qemu/log.h"
 #include "tcg/tcg.h"
 #include "exec/exec-all.h"
 #include "exec/ram_addr.h"
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 3cb2758b33..e0d869b21a 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -42,6 +42,7 @@
 #include "qapi/qapi-events-run-state.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
+#include "qemu/log.h"
 #include "qemu/job.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index b7e7f73b15..dcaa2d03ad 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -18,7 +18,7 @@
  */
 
 #include "qemu/osdep.h"
-
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "fpu/softfloat-types.h"
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 795b35532f..7bf50fdd76 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -8,6 +8,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "qemu/log.h"
 #include "target/arm/idau.h"
 #include "trace.h"
 #include "cpu.h"
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
index b11e927df1..648a3b3fc1 100644
--- a/target/arm/m_helper.c
+++ b/target/arm/m_helper.c
@@ -19,6 +19,7 @@
 #include "qemu/bitops.h"
 #include "qemu/crc32c.h"
 #include "qemu/qemu-print.h"
+#include "qemu/log.h"
 #include "exec/exec-all.h"
 #include <zlib.h> /* For crc32 */
 #include "semihosting/semihost.h"
diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c
index e09b7e46a2..d11a8c70d0 100644
--- a/target/arm/mte_helper.c
+++ b/target/arm/mte_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "internals.h"
 #include "exec/exec-all.h"
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 981c29da45..c27f702901 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "hw/core/tcg-cpu-ops.h"
 #include "exec/exec-all.h"
diff --git a/target/cris/helper.c b/target/cris/helper.c
index a0d6ecdcd3..91e4aeb178 100644
--- a/target/cris/helper.c
+++ b/target/cris/helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "hw/core/tcg-cpu-ops.h"
 #include "mmu.h"
diff --git a/target/hexagon/internal.h b/target/hexagon/internal.h
index 82ac3042ab..b1bfadc3f5 100644
--- a/target/hexagon/internal.h
+++ b/target/hexagon/internal.h
@@ -18,6 +18,8 @@
 #ifndef HEXAGON_INTERNAL_H
 #define HEXAGON_INTERNAL_H
 
+#include "qemu/log.h"
+
 /*
  * Change HEX_DEBUG to 1 to turn on debugging output
  */
diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h
index fccfb94340..a245172827 100644
--- a/target/hexagon/translate.h
+++ b/target/hexagon/translate.h
@@ -19,6 +19,7 @@
 #define HEXAGON_TRANSLATE_H
 
 #include "qemu/bitmap.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/translator.h"
 #include "tcg/tcg-op.h"
diff --git a/target/hppa/helper.c b/target/hppa/helper.c
index 1ccff5765a..e2758d8df3 100644
--- a/target/hppa/helper.c
+++ b/target/hppa/helper.c
@@ -18,7 +18,7 @@
  */
 
 #include "qemu/osdep.h"
-
+#include "qemu/log.h"
 #include "cpu.h"
 #include "fpu/softfloat.h"
 #include "exec/exec-all.h"
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index bf07445cd1..5046cc8f9d 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c
index b0dec4ebf4..2810361be0 100644
--- a/target/hppa/op_helper.c
+++ b/target/hppa/op_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
diff --git a/target/i386/helper.c b/target/i386/helper.c
index 533b29cb91..0639aea11b 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -27,6 +27,7 @@
 #include "sysemu/hw_accel.h"
 #include "monitor/monitor.h"
 #endif
+#include "qemu/log.h"
 
 void cpu_sync_bndcs_hflags(CPUX86State *env)
 {
diff --git a/target/i386/tcg/int_helper.c b/target/i386/tcg/int_helper.c
index 87fa7280ee..599ac968b0 100644
--- a/target/i386/tcg/int_helper.c
+++ b/target/i386/tcg/int_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "qemu/host-utils.h"
diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c
index 5769db5ace..24a0eaa3d5 100644
--- a/target/i386/tcg/misc_helper.c
+++ b/target/i386/tcg/misc_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/seg_helper.c
index 824b9a5a26..2c9bd007ad 100644
--- a/target/i386/tcg/sysemu/seg_helper.c
+++ b/target/i386/tcg/sysemu/seg_helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index 6d39611eb6..2b6f450af9 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
index acbd473515..8decc61240 100644
--- a/target/m68k/op_helper.c
+++ b/target/m68k/op_helper.c
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
index b9c888b87e..aed200dcff 100644
--- a/target/microblaze/cpu.c
+++ b/target/microblaze/cpu.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/module.h"
diff --git a/target/microblaze/mmu.c b/target/microblaze/mmu.c
index cc40f275ea..75651979a9 100644
--- a/target/microblaze/mmu.c
+++ b/target/microblaze/mmu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 
diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c
index 58d633584d..5b745d0928 100644
--- a/target/microblaze/op_helper.c
+++ b/target/microblaze/op_helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
diff --git a/target/mips/tcg/exception.c b/target/mips/tcg/exception.c
index 7b3026b105..0b21e0872b 100644
--- a/target/mips/tcg/exception.c
+++ b/target/mips/tcg/exception.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "internal.h"
 #include "exec/helper-proto.h"
diff --git a/target/mips/tcg/sysemu/special_helper.c b/target/mips/tcg/sysemu/special_helper.c
index 2a2afb49e8..f4f8fe8afc 100644
--- a/target/mips/tcg/sysemu/special_helper.c
+++ b/target/mips/tcg/sysemu/special_helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h
index ae01515efe..9997fe2f3c 100644
--- a/target/mips/tcg/translate.h
+++ b/target/mips/tcg/translate.h
@@ -8,6 +8,7 @@
 #ifndef TARGET_MIPS_TRANSLATE_H
 #define TARGET_MIPS_TRANSLATE_H
 
+#include "qemu/log.h"
 #include "exec/translator.h"
 
 #define MIPS_DEBUG_DISAS 0
diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c
index 19223e3f25..e5724f5371 100644
--- a/target/openrisc/interrupt.c
+++ b/target/openrisc/interrupt.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c
index e561ef245b..d7e1320998 100644
--- a/target/openrisc/mmu.c
+++ b/target/openrisc/mmu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index f44b9da2a5..6538c56ab0 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -18,6 +18,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu/main-loop.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "internal.h"
diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c
index 29e73a6ffd..06aa716cab 100644
--- a/target/ppc/misc_helper.c
+++ b/target/ppc/misc_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c
index 4e7648f301..be6c966cfa 100644
--- a/target/s390x/tcg/excp_helper.c
+++ b/target/s390x/tcg/excp_helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "s390x-internal.h"
 #include "exec/helper-proto.h"
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 406578d105..b5523ef3c7 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "s390x-internal.h"
 #include "tcg_s390x.h"
diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index a3e1cf9b6e..ec4fae78c3 100644
--- a/target/sparc/ldst_helper.c
+++ b/target/sparc/ldst_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "tcg/tcg.h"
 #include "exec/helper-proto.h"
diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
index f2668389b0..346a6dfa35 100644
--- a/target/sparc/mmu_helper.c
+++ b/target/sparc/mmu_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "qemu/qemu-print.h"
diff --git a/target/tricore/helper.c b/target/tricore/helper.c
index c5e997f321..1db32808e8 100644
--- a/target/tricore/helper.c
+++ b/target/tricore/helper.c
@@ -16,7 +16,7 @@
  */
 
 #include "qemu/osdep.h"
-
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "fpu/softfloat-helpers.h"
diff --git a/target/xtensa/dbg_helper.c b/target/xtensa/dbg_helper.c
index be1f81107b..ce2a820c60 100644
--- a/target/xtensa/dbg_helper.c
+++ b/target/xtensa/dbg_helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
diff --git a/target/xtensa/exc_helper.c b/target/xtensa/exc_helper.c
index 9bc7f50d35..d4823a65cd 100644
--- a/target/xtensa/exc_helper.c
+++ b/target/xtensa/exc_helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
diff --git a/target/xtensa/fpu_helper.c b/target/xtensa/fpu_helper.c
index ba3c29d19d..d2a10cc797 100644
--- a/target/xtensa/fpu_helper.c
+++ b/target/xtensa/fpu_helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 29d216ec1b..e0a9caab4b 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c
index 57e319a1af..fa66e8e867 100644
--- a/target/xtensa/mmu_helper.c
+++ b/target/xtensa/mmu_helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "qemu/qemu-print.h"
 #include "qemu/units.h"
diff --git a/target/xtensa/win_helper.c b/target/xtensa/win_helper.c
index f6f96a64c3..5a1555360a 100644
--- a/target/xtensa/win_helper.c
+++ b/target/xtensa/win_helper.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "qemu/main-loop.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 24/25] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (22 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 23/25] exec/exec-all: Move 'qemu/log.h' include in units requiring it Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:00 ` [PULL 25/25] hw/tricore: Remove unused and incorrect header Thomas Huth
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

hwaddr type is defined in "exec/hwaddr.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220209215446.58402-3-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/hw/m68k/mcf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/hw/m68k/mcf.h b/include/hw/m68k/mcf.h
index decf17ce42..8cbd587bbf 100644
--- a/include/hw/m68k/mcf.h
+++ b/include/hw/m68k/mcf.h
@@ -2,6 +2,7 @@
 #define HW_MCF_H
 /* Motorola ColdFire device prototypes.  */
 
+#include "exec/hwaddr.h"
 #include "target/m68k/cpu-qom.h"
 
 /* mcf_uart.c */
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PULL 25/25] hw/tricore: Remove unused and incorrect header
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (23 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 24/25] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header Thomas Huth
@ 2022-02-21 12:00 ` Thomas Huth
  2022-02-21 12:21 ` [PULL 00/25] qtest patches and misc header clean-ups Philippe Mathieu-Daudé
  2022-02-22 20:16 ` Peter Maydell
  26 siblings, 0 replies; 28+ messages in thread
From: Thomas Huth @ 2022-02-21 12:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

TriCore boards certainly don't need the ARM loader API :)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220214183144.27402-4-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/hw/tricore/triboard.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/hw/tricore/triboard.h b/include/hw/tricore/triboard.h
index f3844be447..094c8bd563 100644
--- a/include/hw/tricore/triboard.h
+++ b/include/hw/tricore/triboard.h
@@ -21,7 +21,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/boards.h"
-#include "hw/arm/boot.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 #include "qom/object.h"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PULL 00/25] qtest patches and misc header clean-ups
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (24 preceding siblings ...)
  2022-02-21 12:00 ` [PULL 25/25] hw/tricore: Remove unused and incorrect header Thomas Huth
@ 2022-02-21 12:21 ` Philippe Mathieu-Daudé
  2022-02-22 20:16 ` Peter Maydell
  26 siblings, 0 replies; 28+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-02-21 12:21 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Peter Maydell, qemu-devel

On 21/2/22 12:59, Thomas Huth wrote:

> ----------------------------------------------------------------
> * Improve virtio-net failover test
> * Some small fixes for the qtests
> * Misc header cleanups by Philippe
> 
> ----------------------------------------------------------------

> Philippe Mathieu-Daudé (12):
>        hw/tpm: Clean includes
>        hw/remote: Add missing include
>        hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header
>        qtest: Add missing 'hw/qdev-core.h' include
>        exec/ramblock: Add missing includes
>        core/ptimers: Remove unnecessary 'sysemu/cpus.h' include
>        target: Add missing "qemu/timer.h" include
>        linux-user: Add missing "qemu/timer.h" include
>        softmmu/runstate: Clean headers
>        exec/exec-all: Move 'qemu/log.h' include in units requiring it
>        hw/m68k/mcf: Add missing 'exec/hwaddr.h' header
>        hw/tricore: Remove unused and incorrect header

Thanks for picking these!


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PULL 00/25] qtest patches and misc header clean-ups
  2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
                   ` (25 preceding siblings ...)
  2022-02-21 12:21 ` [PULL 00/25] qtest patches and misc header clean-ups Philippe Mathieu-Daudé
@ 2022-02-22 20:16 ` Peter Maydell
  26 siblings, 0 replies; 28+ messages in thread
From: Peter Maydell @ 2022-02-22 20:16 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel

On Mon, 21 Feb 2022 at 12:00, Thomas Huth <thuth@redhat.com> wrote:
>
>  Hi!
>
> The following changes since commit e670f6d825d4dee248b311197fd4048469d6772b:
>
>   Merge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220218' into staging (2022-02-20 15:05:41 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/thuth/qemu.git tags/pull-request-2022-02-21
>
> for you to fetch changes up to 975592f5523fdf8708e4b53da937cf4805b1b79a:
>
>   hw/tricore: Remove unused and incorrect header (2022-02-21 10:36:50 +0100)
>
> ----------------------------------------------------------------
> * Improve virtio-net failover test
> * Some small fixes for the qtests
> * Misc header cleanups by Philippe



Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2022-02-22 20:18 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 11:59 [PULL 00/25] qtest patches and misc header clean-ups Thomas Huth
2022-02-21 11:59 ` [PULL 01/25] tests/x86: Use 'pc' machine type for old hardware tests Thomas Huth
2022-02-21 11:59 ` [PULL 02/25] tests/x86: Use 'pc' machine type for hotplug tests Thomas Huth
2022-02-21 11:59 ` [PULL 03/25] erst: drop cast to long long Thomas Huth
2022-02-21 11:59 ` [PULL 04/25] tests/qtest/vhost-user-test.c: Use vhostforce=on Thomas Huth
2022-02-21 11:59 ` [PULL 05/25] tests/qtest/ide-test: Remove bad retry_isa test Thomas Huth
2022-02-21 11:59 ` [PULL 06/25] tests/qtest: failover: clean up pathname of tests Thomas Huth
2022-02-21 11:59 ` [PULL 07/25] tests/qtest: failover: use a macro for check_one_card() Thomas Huth
2022-02-21 11:59 ` [PULL 08/25] tests/qtest: failover: check the feature is correctly provided Thomas Huth
2022-02-21 11:59 ` [PULL 09/25] tests/qtest: failover: check missing guest feature Thomas Huth
2022-02-21 11:59 ` [PULL 10/25] tests/qtest: failover: check migration with failover off Thomas Huth
2022-02-21 11:59 ` [PULL 11/25] tests/qtest: failover: test migration if the guest doesn't support failover Thomas Huth
2022-02-21 11:59 ` [PULL 12/25] tests/qtest: failover: migration abort test with failover off Thomas Huth
2022-02-21 11:59 ` [PULL 13/25] scripts: Remove the old switch-timer-api script Thomas Huth
2022-02-21 11:59 ` [PULL 14/25] hw/tpm: Clean includes Thomas Huth
2022-02-21 11:59 ` [PULL 15/25] hw/remote: Add missing include Thomas Huth
2022-02-21 11:59 ` [PULL 16/25] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header Thomas Huth
2022-02-21 12:00 ` [PULL 17/25] qtest: Add missing 'hw/qdev-core.h' include Thomas Huth
2022-02-21 12:00 ` [PULL 18/25] exec/ramblock: Add missing includes Thomas Huth
2022-02-21 12:00 ` [PULL 19/25] core/ptimers: Remove unnecessary 'sysemu/cpus.h' include Thomas Huth
2022-02-21 12:00 ` [PULL 20/25] target: Add missing "qemu/timer.h" include Thomas Huth
2022-02-21 12:00 ` [PULL 21/25] linux-user: " Thomas Huth
2022-02-21 12:00 ` [PULL 22/25] softmmu/runstate: Clean headers Thomas Huth
2022-02-21 12:00 ` [PULL 23/25] exec/exec-all: Move 'qemu/log.h' include in units requiring it Thomas Huth
2022-02-21 12:00 ` [PULL 24/25] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header Thomas Huth
2022-02-21 12:00 ` [PULL 25/25] hw/tricore: Remove unused and incorrect header Thomas Huth
2022-02-21 12:21 ` [PULL 00/25] qtest patches and misc header clean-ups Philippe Mathieu-Daudé
2022-02-22 20:16 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.