From 097ff04948ca8426b83a7cd9e191ef68e42565bf Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 22 Aug 2018 11:15:27 +0200 Subject: [PATCH] tests: Add RISC-V guest Signed-off-by: Lubomir Rintel Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvdata/riscv64-virt.args | 30 +++++++++++++++++++ tests/qemuxml2argvdata/riscv64-virt.xml | 19 ++++++++++++ tests/qemuxml2argvtest.c | 3 ++ tests/qemuxml2xmloutdata/riscv64-virt.xml | 36 +++++++++++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 5 files changed, 90 insertions(+) create mode 100644 tests/qemuxml2argvdata/riscv64-virt.args create mode 100644 tests/qemuxml2argvdata/riscv64-virt.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-virt.xml diff --git a/tests/qemuxml2argvdata/riscv64-virt.args b/tests/qemuxml2argvdata/riscv64-virt.args new file mode 100644 index 0000000000..0e103a6755 --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-virt.args @@ -0,0 +1,30 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-riscv64 \ +-name riscv64 \ +-S \ +-machine virt,accel=tcg,usb=off,dump-guest-core=off \ +-m 2048 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid fd65fc03-8838-4c4d-9d8d-395802488790 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-riscv64/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-kernel /var/lib/libvirt/images/bbl \ +-append 'console=ttyS0 ro root=/dev/vda' \ +-usb \ +-drive file=/var/lib/libvirt/images/stage4-disk.img,format=raw,if=none,\ +id=drive-virtio-disk0 \ +-device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \ +-chardev pty,id=charserial0 \ +-serial chardev:charserial0 \ +-device virtio-balloon-device,id=balloon0 diff --git a/tests/qemuxml2argvdata/riscv64-virt.xml b/tests/qemuxml2argvdata/riscv64-virt.xml new file mode 100644 index 0000000000..3a672bdea5 --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-virt.xml @@ -0,0 +1,19 @@ + + riscv64 + fd65fc03-8838-4c4d-9d8d-395802488790 + 2097152 + 1 + + hvm + /var/lib/libvirt/images/bbl + console=ttyS0 ro root=/dev/vda + + + /usr/bin/qemu-system-riscv64 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5f760ef056..82b5b7bbea 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3000,6 +3000,9 @@ mymain(void) DO_TEST_CAPS_VER("launch-security-sev", "2.12.0"); + DO_TEST("riscv64-virt", + QEMU_CAPS_DEVICE_VIRTIO_MMIO); + if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) virFileDeleteTree(fakerootdir); diff --git a/tests/qemuxml2xmloutdata/riscv64-virt.xml b/tests/qemuxml2xmloutdata/riscv64-virt.xml new file mode 100644 index 0000000000..822a59a604 --- /dev/null +++ b/tests/qemuxml2xmloutdata/riscv64-virt.xml @@ -0,0 +1,36 @@ + + riscv64 + fd65fc03-8838-4c4d-9d8d-395802488790 + 2097152 + 2097152 + 1 + + hvm + /var/lib/libvirt/images/bbl + console=ttyS0 ro root=/dev/vda + + + + destroy + restart + destroy + + /usr/bin/qemu-system-riscv64 + + + + +
+ + + + + + + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9ed39c70b6..43fd4e5f0f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1215,6 +1215,8 @@ mymain(void) DO_TEST("vhost-vsock-ccw-auto", QEMU_CAPS_DEVICE_VHOST_VSOCK, QEMU_CAPS_CCW); + DO_TEST("riscv64-virt", + QEMU_CAPS_DEVICE_VIRTIO_MMIO); if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) virFileDeleteTree(fakerootdir);