[PATCH 1/5] qemuDomainChrInsertPreAlloced: Fix adding implicit console

Ján Tomko jtomko at redhat.com
Tue Apr 18 12:48:36 UTC 2023


On a Wednesday in 2023, Michal Privoznik wrote:
>When hotpluging a <serial/> device, we might need to add a
><console/> device with it (because of some crazy backcompat).
>Now, hotplugging is done in several phases. In one of them,
>qemuDomainChrPreInsert() allocates space for both devices, and
>then qemuDomainChrInsertPreAlloced() actually inserts the device
>into domain definition and sets up the <console/> device with it.
>Except, the condition that checks whether to create the aliased
><console/> is wrong as it compares nconsoles against 0.
>Surprisingly, qemuDomainChrInsertPreAllocCleanup() doesn't suffer
>from the same error.
>
>Fixes: daf51be5f1b0f7b41c0813d43d6b66edfbe4f6d9
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_hotplug.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230418/695fb85e/attachment.sig>


More information about the libvir-list mailing list