All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haozhong Zhang <haozhong.zhang@intel.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, Igor Mammedov <imammedo@redhat.com>,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Haozhong Zhang <haozhong.zhang@intel.com>
Subject: [Qemu-devel] [PATCH v2 2/3] tests/bios-tables-test: allow setting extra machine options
Date: Wed, 28 Feb 2018 12:02:59 +0800	[thread overview]
Message-ID: <20180228040300.8914-3-haozhong.zhang@intel.com> (raw)
In-Reply-To: <20180228040300.8914-1-haozhong.zhang@intel.com>

Some test cases may require extra machine options than the those
used in the current test_acpi_ones(), e.g., nvdimm test cases require
the machine option 'nvdimm=on'.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
 tests/bios-tables-test.c | 45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 65b271a173..d45181aa51 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -654,17 +654,22 @@ static void test_smbios_structs(test_data *data)
     }
 }
 
-static void test_acpi_one(const char *params, test_data *data)
+static void test_acpi_one(const char *extra_machine_opts,
+                          const char *params, test_data *data)
 {
     char *args;
 
     /* Disable kernel irqchip to be able to override apic irq0. */
-    args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off "
+    args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off",
+                           data->machine, "kvm:tcg");
+    if (extra_machine_opts) {
+        args = g_strdup_printf("%s,%s", args, extra_machine_opts);
+    }
+    args = g_strdup_printf("%s "
                            "-net none -display none %s "
                            "-drive id=hd0,if=none,file=%s,format=raw "
                            "-device ide-hd,drive=hd0 ",
-                           data->machine, "kvm:tcg",
-                           params ? params : "", disk);
+                           args, params ? params : "", disk);
 
     qtest_start(args);
 
@@ -711,7 +716,7 @@ static void test_acpi_piix4_tcg(void)
     data.machine = MACHINE_PC;
     data.required_struct_types = base_required_struct_types;
     data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
-    test_acpi_one(NULL, &data);
+    test_acpi_one(NULL, NULL, &data);
     free_test_data(&data);
 }
 
@@ -724,7 +729,7 @@ static void test_acpi_piix4_tcg_bridge(void)
     data.variant = ".bridge";
     data.required_struct_types = base_required_struct_types;
     data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
-    test_acpi_one("-device pci-bridge,chassis_nr=1", &data);
+    test_acpi_one(NULL, "-device pci-bridge,chassis_nr=1", &data);
     free_test_data(&data);
 }
 
@@ -736,7 +741,7 @@ static void test_acpi_q35_tcg(void)
     data.machine = MACHINE_Q35;
     data.required_struct_types = base_required_struct_types;
     data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
-    test_acpi_one(NULL, &data);
+    test_acpi_one(NULL, NULL, &data);
     free_test_data(&data);
 }
 
@@ -749,7 +754,7 @@ static void test_acpi_q35_tcg_bridge(void)
     data.variant = ".bridge";
     data.required_struct_types = base_required_struct_types;
     data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
-    test_acpi_one("-device pci-bridge,chassis_nr=1",
+    test_acpi_one(NULL, "-device pci-bridge,chassis_nr=1",
                   &data);
     free_test_data(&data);
 }
@@ -761,7 +766,8 @@ static void test_acpi_piix4_tcg_cphp(void)
     memset(&data, 0, sizeof(data));
     data.machine = MACHINE_PC;
     data.variant = ".cphp";
-    test_acpi_one("-smp 2,cores=3,sockets=2,maxcpus=6"
+    test_acpi_one(NULL,
+                  "-smp 2,cores=3,sockets=2,maxcpus=6"
                   " -numa node -numa node"
                   " -numa dist,src=0,dst=1,val=21",
                   &data);
@@ -775,7 +781,8 @@ static void test_acpi_q35_tcg_cphp(void)
     memset(&data, 0, sizeof(data));
     data.machine = MACHINE_Q35;
     data.variant = ".cphp";
-    test_acpi_one(" -smp 2,cores=3,sockets=2,maxcpus=6"
+    test_acpi_one(NULL,
+                  " -smp 2,cores=3,sockets=2,maxcpus=6"
                   " -numa node -numa node"
                   " -numa dist,src=0,dst=1,val=21",
                   &data);
@@ -795,7 +802,8 @@ static void test_acpi_q35_tcg_ipmi(void)
     data.variant = ".ipmibt";
     data.required_struct_types = ipmi_required_struct_types;
     data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types);
-    test_acpi_one("-device ipmi-bmc-sim,id=bmc0"
+    test_acpi_one(NULL,
+                  "-device ipmi-bmc-sim,id=bmc0"
                   " -device isa-ipmi-bt,bmc=bmc0",
                   &data);
     free_test_data(&data);
@@ -813,7 +821,8 @@ static void test_acpi_piix4_tcg_ipmi(void)
     data.variant = ".ipmikcs";
     data.required_struct_types = ipmi_required_struct_types;
     data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types);
-    test_acpi_one("-device ipmi-bmc-sim,id=bmc0"
+    test_acpi_one(NULL,
+                  "-device ipmi-bmc-sim,id=bmc0"
                   " -device isa-ipmi-kcs,irq=0,bmc=bmc0",
                   &data);
     free_test_data(&data);
@@ -826,7 +835,8 @@ static void test_acpi_q35_tcg_memhp(void)
     memset(&data, 0, sizeof(data));
     data.machine = MACHINE_Q35;
     data.variant = ".memhp";
-    test_acpi_one(" -m 128,slots=3,maxmem=1G"
+    test_acpi_one(NULL,
+                  " -m 128,slots=3,maxmem=1G"
                   " -numa node -numa node"
                   " -numa dist,src=0,dst=1,val=21",
                   &data);
@@ -840,7 +850,8 @@ static void test_acpi_piix4_tcg_memhp(void)
     memset(&data, 0, sizeof(data));
     data.machine = MACHINE_PC;
     data.variant = ".memhp";
-    test_acpi_one(" -m 128,slots=3,maxmem=1G"
+    test_acpi_one(NULL,
+                  " -m 128,slots=3,maxmem=1G"
                   " -numa node -numa node"
                   " -numa dist,src=0,dst=1,val=21",
                   &data);
@@ -854,7 +865,8 @@ static void test_acpi_q35_tcg_numamem(void)
     memset(&data, 0, sizeof(data));
     data.machine = MACHINE_Q35;
     data.variant = ".numamem";
-    test_acpi_one(" -numa node -numa node,mem=128", &data);
+    test_acpi_one(NULL,
+                  " -numa node -numa node,mem=128", &data);
     free_test_data(&data);
 }
 
@@ -865,7 +877,8 @@ static void test_acpi_piix4_tcg_numamem(void)
     memset(&data, 0, sizeof(data));
     data.machine = MACHINE_PC;
     data.variant = ".numamem";
-    test_acpi_one(" -numa node -numa node,mem=128", &data);
+    test_acpi_one(NULL,
+                  " -numa node -numa node,mem=128", &data);
     free_test_data(&data);
 }
 
-- 
2.14.1

  parent reply	other threads:[~2018-02-28  4:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  4:02 [Qemu-devel] [PATCH v2 0/3] hw/acpi-build: build SRAT memory affinity structures for DIMM devices Haozhong Zhang
2018-02-28  4:02 ` [Qemu-devel] [PATCH v2 1/3] " Haozhong Zhang
2018-03-01 10:42   ` Igor Mammedov
2018-03-01 11:56     ` Haozhong Zhang
2018-03-01 13:01       ` Igor Mammedov
2018-03-01 13:12         ` Haozhong Zhang
2018-03-01 16:06           ` Igor Mammedov
2018-02-28  4:02 ` Haozhong Zhang [this message]
2018-02-28  4:03 ` [Qemu-devel] [PATCH v2 3/3] tests/bios-tables-test: add test cases for DIMM proximity Haozhong Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180228040300.8914-3-haozhong.zhang@intel.com \
    --to=haozhong.zhang@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=xiaoguangrong.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.