[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 5/5] qemu: Default to video type=virtio for machvirt



On Sun, Aug 27, 2017 at 11:04:42AM -0400, Cole Robinson wrote:
> arm/aarch64 -M virt on KVM doesn't and will never work with standard
> VGA card emulation. The recommended method is to use type=virtio, so
> let's make it the default for video devices without an explicit type
> set by the user

Missing a period at the end of sentence.

> https://bugzilla.redhat.com/show_bug.cgi?id=1404112

I would put an empty line after the BZ link.

> Signed-off-by: Cole Robinson <crobinso redhat com>
> ---
>  src/qemu/qemu_domain.c                             |  2 +
>  .../qemuxml2argv-aarch64-video-default.args        | 26 ++++++++++++
>  .../qemuxml2argv-aarch64-video-default.xml         | 17 ++++++++
>  tests/qemuxml2argvtest.c                           |  6 +++
>  .../qemuxml2xmlout-aarch64-video-default.xml       | 46 ++++++++++++++++++++++
>  tests/qemuxml2xmltest.c                            | 10 +++++
>  6 files changed, 107 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-default.xml
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 7d8c2c1ce..6f9fafb6e 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -3670,6 +3670,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
>          if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
>              if ARCH_IS_PPC64(def->os.arch)
>                  dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
> +            else if (qemuDomainIsVirt(def))
> +                dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
>              else
>                  dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
>          }
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args
> new file mode 100644
> index 000000000..359c3875d
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args
> @@ -0,0 +1,26 @@
> +LC_ALL=C \
> +PATH=/bin \
> +HOME=/home/test \
> +USER=test \
> +LOGNAME=test \
> +QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu-system-aarch64 \
> +-name aarch64-vgpu \
> +-S \
> +-M virt \
> +-cpu cortex-a57 \
> +-m 1024 \
> +-smp 1,sockets=1,cores=1,threads=1 \
> +-uuid f3197c89-6457-44fe-b26d-897090ba6541 \
> +-nodefconfig \
> +-nodefaults \
> +-chardev socket,id=charmonitor,\
> +path=/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \
> +-mon chardev=charmonitor,id=monitor,mode=readline \
> +-no-acpi \
> +-boot c \
> +-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
> +-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
> +-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
> +-vnc 127.0.0.1:0 \
> +-device virtio-gpu-pci,id=video0,bus=pci.2,addr=0x1
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml
> new file mode 100644
> index 000000000..bc4ea48f0
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml
> @@ -0,0 +1,17 @@
> +<domain type='qemu'>
> +  <name>aarch64-vgpu</name>
> +  <uuid>f3197c89-6457-44fe-b26d-897090ba6541</uuid>
> +  <memory unit='KiB'>1048576</memory>
> +  <currentMemory unit='KiB'>1048576</currentMemory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='aarch64' machine='virt'>hvm</type>
> +  </os>
> +  <cpu mode='custom' match='exact'>
> +    <model fallback='allow'>cortex-a57</model>
> +  </cpu>
> +  <devices>
> +    <emulator>/usr/bin/qemu-system-aarch64</emulator>
> +    <graphics type='vnc'/>

It is possible to skip the graphics and use <video/> instead.  This
would make the test only about video device but I'm fine with having
the graphics in the test as well.

Reviewed-by: Pavel Hrdina <phrdina redhat com>

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]