[libvirt] [PATCH v2 10/11] tests/qemuxml2argvtest: test RISC-V virt machine arguments

Andrea Bolognani abologna at redhat.com
Tue Jun 26 15:41:58 UTC 2018


On Thu, 2018-06-14 at 22:32 +0200, Lubomir Rintel wrote:
[...]
> +++ b/tests/qemuxml2argvdata/riscv64-virt.xml
> @@ -0,0 +1,32 @@
> +<domain type='qemu'>
> +  <name>riscv64</name>
> +  <uuid>fd65fc03-8838-4c4d-9d8d-395802488790</uuid>

A lot of the information you included in this file can be omitted,
and doing so not only highlights which parts actually matter, but
also ensures that libvirt is able to fill in the blanks on its own
as you would expect it to.

  <domain type='qemu'>
    <name>riscv64</name>
    <uuid>fd65fc03-8838-4c4d-9d8d-395802488790</uuid>
    <memory unit='KiB'>2097152</memory>
    <vcpu placement='static'>1</vcpu>
    <os>
      <type arch='riscv64' machine='virt'>hvm</type>
      <kernel>/var/lib/libvirt/images/bbl</kernel>
      <cmdline>console=ttyS0 ro root=/dev/vda</cmdline>
    </os>
    <devices>
      <emulator>/usr/bin/qemu-system-riscv64</emulator>
      <disk type='file'>
        <source file='/var/lib/libvirt/images/stage4-disk.img'/>
        <target dev='vda' bus='virtio'/>
      </disk>
      <serial type='pty'/>
    </devices>
  </domain>

The above is all you need.

[...]
> +++ b/tests/qemuxml2argvtest.c
> @@ -2903,6 +2903,9 @@ mymain(void)
>              QEMU_CAPS_KVM,
>              QEMU_CAPS_SEV_GUEST);
>  
> +    DO_TEST("riscv64-virt",
> +            QEMU_CAPS_DEVICE_VIRTIO_MMIO);

You forgot to add the same snippet to tests/qemuxml2xmltest.c, and
without that XML round-trip will not actually be tested :)


With the above addressed,

  Reviewed-by: Andrea Bolognani <abologna at redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list