tests/x86: Use 'pc' machine type for hotplug tests
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>
This commit is contained in:
parent
fedcc3793e
commit
7b172333f1
@ -63,7 +63,15 @@ static void wait_device_deleted_event(QTestState *qtest, const char *id)
|
|||||||
|
|
||||||
static void test_pci_unplug_request(void)
|
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
|
* 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)
|
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(
|
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
|
* Request device removal. As the guest is not running, the request won't
|
||||||
|
@ -235,14 +235,21 @@ static void test_drive_del_device_del(void)
|
|||||||
static void test_cli_device_del(void)
|
static void test_cli_device_del(void)
|
||||||
{
|
{
|
||||||
QTestState *qts;
|
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
|
* -drive/-device and device_del. Start with a drive used by a
|
||||||
* device that unplugs after reset.
|
* 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"
|
"file.read-zeroes=on,format=raw"
|
||||||
" -device virtio-blk-%s,drive=drive0,id=dev0",
|
" -device virtio-blk-%s,drive=drive0,id=dev0",
|
||||||
|
machine_addition,
|
||||||
qvirtio_get_dev_type());
|
qvirtio_get_dev_type());
|
||||||
|
|
||||||
device_del(qts, true);
|
device_del(qts, true);
|
||||||
@ -266,13 +273,19 @@ static void test_empty_device_del(void)
|
|||||||
static void test_device_add_and_del(void)
|
static void test_device_add_and_del(void)
|
||||||
{
|
{
|
||||||
QTestState *qts;
|
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
|
* -drive/device_add and device_del. Start with a drive used by a
|
||||||
* device that unplugs after reset.
|
* device that unplugs after reset.
|
||||||
*/
|
*/
|
||||||
qts = qtest_init("-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");
|
"file.read-zeroes=on,format=raw", machine_addition);
|
||||||
|
|
||||||
device_add(qts);
|
device_add(qts);
|
||||||
device_del(qts, true);
|
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)
|
static void test_drive_add_device_add_and_del(void)
|
||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
const char *arch = qtest_get_arch();
|
||||||
|
const char *machine_addition = "";
|
||||||
|
|
||||||
qts = qtest_init("");
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
|
machine_addition = "-machine pc";
|
||||||
|
}
|
||||||
|
|
||||||
|
qts = qtest_init(machine_addition);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* drive_add/device_add and device_del. The drive is used by a
|
* 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)
|
static void test_blockdev_add_device_add_and_del(void)
|
||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
const char *arch = qtest_get_arch();
|
||||||
|
const char *machine_addition = "";
|
||||||
|
|
||||||
qts = qtest_init("");
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
|
machine_addition = "-machine pc";
|
||||||
|
}
|
||||||
|
|
||||||
|
qts = qtest_init(machine_addition);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* blockdev_add/device_add and device_del. The it drive is used by a
|
* blockdev_add/device_add and device_del. The it drive is used by a
|
||||||
|
@ -839,7 +839,7 @@ static void test_override_scsi_hot_unplug(void)
|
|||||||
|
|
||||||
joined_args = g_strjoinv(" ", args->argv);
|
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);
|
fw_cfg = pc_fw_cfg_init(qts);
|
||||||
|
|
||||||
read_bootdevices(fw_cfg, expected);
|
read_bootdevices(fw_cfg, expected);
|
||||||
@ -899,7 +899,7 @@ static void test_override_virtio_hot_unplug(void)
|
|||||||
|
|
||||||
joined_args = g_strjoinv(" ", args->argv);
|
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);
|
fw_cfg = pc_fw_cfg_init(qts);
|
||||||
|
|
||||||
read_bootdevices(fw_cfg, expected);
|
read_bootdevices(fw_cfg, expected);
|
||||||
|
@ -385,7 +385,12 @@ static void test_ivshmem_hotplug(void)
|
|||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
const char *arch = qtest_get_arch();
|
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",
|
qtest_qmp_device_add(qts, "ivshmem-plain", "iv1",
|
||||||
"{'addr': %s, 'memdev': 'mb1'}",
|
"{'addr': %s, 'memdev': 'mb1'}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user