[PATCH 5/7] qemu_command: Switch from VIR_ENUM_IMPL(qemuDeviceVideoSecondary) to explicit switch()

Peter Krempa pkrempa at redhat.com
Fri Jun 11 15:24:45 UTC 2021


On Fri, Jun 11, 2021 at 17:04:58 +0200, Michal Privoznik wrote:
> This may look like a step backwards, but it isn't. The point is
> that in near future the chosen model will depend on more than
> just video type.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/qemu/qemu_command.c | 41 +++++++++++++++++++++--------------------
>  1 file changed, 21 insertions(+), 20 deletions(-)
> @@ -4229,7 +4210,27 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps,
>                  break;
>              }
>          } else {
> -            model = qemuDeviceVideoSecondaryTypeToString(video->type);
> +            switch (video->type) {

Same as previous patch.

> +            case VIR_DOMAIN_VIDEO_TYPE_QXL:
> +                model = "qxl";
> +                break;
> +            case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
> +                model = "virtio-gpu";
> +                break;
> +            case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:




More information about the libvir-list mailing list