[libvirt] [PATCH v3 2/4] qemu: Generate 'xres' and 'yres' for video devices

Cole Robinson crobinso at redhat.com
Thu Oct 10 17:28:12 UTC 2019


On 10/7/19 11:35 PM, jcfaracco at gmail.com wrote:
> From: Julio Faracco <jcfaracco at gmail.com>
> 
> Now, QEMU command line can define 'xres' and 'yres' if XML contains both
> properties from video model. This is generetaed if resolution was set.
> Code let QEMU handle if video model supports this feature.
> 
> Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
> ---
>   src/qemu/qemu_command.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index cbf25d5f07..99b43243e3 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -4596,6 +4596,11 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
>               virBufferAsprintf(&buf, ",vgamem=%uk", video->vram);
>       }
>   
> +    if (video->res && video->res->x && video->res->y) {
> +        /* QEMU accepts resolution xres and yres. */
> +        virBufferAsprintf(&buf, ",xres=%u,yres=%u", video->res->x, video->res->y);
> +    }
> +
>       if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0)
>           return NULL;
>   
> 

If I apply just patch #1 and #2, the code fails to compile. This patch 
depends on patch #3. This may break 'git bisect' if people are trying to 
locate a regression so it should be avoided. Please ensure every 
individual patch in a series is compilable and doesn't break the test 
suite, or have syntax-check errors. You can write a git rebase one liner 
to do roughly that.

In v2 review I also pointed to this example commit:
https://www.redhat.com/archives/libvir-list/2019-May/msg00820.html

I don't think all these changes need to be lumped together, but adding 
docs/ and src/conf and a qemu test case in one commit is nice and self 
containers. Then patch #2 can add the qemu_command.c bits and regenerate 
the test output, to demonstrate what's actually changing. Generally 
though I think it's a good idea to put the conf and docs/ changes in the 
same commit, unless there's a large amount of doc additions

- Cole




More information about the libvir-list mailing list