[libvirt] [PATCH] qemu: Fix serial stub console allocation

Peter Krempa pkrempa at redhat.com
Mon May 29 12:33:04 UTC 2017


On Mon, May 29, 2017 at 13:11:09 +0200, Erik Skultety wrote:
> When adding the aliased serial stub console, the structure wasn't
> properly allocated (VIR_ALLOC instead of virDomainChrDefNew) which then
> resulted in SIGSEGV in virDomainChrSourceIsEqual during a serial device
> coldplug.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1434278
> 
> Signed-off-by: Erik Skultety <eskultet at redhat.com>
> ---
>  src/qemu/qemu_hotplug.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 4a7d99725..34ddb95f8 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -1810,7 +1810,7 @@ qemuDomainChrPreInsert(virDomainDefPtr vmdef,
>          if (!vmdef->consoles && VIR_ALLOC(vmdef->consoles) < 0)
>              return -1;
>  
> -        if (VIR_ALLOC(vmdef->consoles[0]) < 0) {
> +        if (!(vmdef->consoles[0] = virDomainChrDefNew(NULL))) {

With this the code will not call qemuDomainChrSourcePrivateNew in the
qemu driver, which is called everywhere. Are you sure this is okay? If
so please add a comment that xmlopt is not necessary here.

Otherwise it should be simple to pass xmlopt here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170529/3a504c26/attachment-0001.sig>


More information about the libvir-list mailing list