[libvirt] [PATCH] Allocate priv->vioserialaddrs unconditionally

Peter Krempa pkrempa at redhat.com
Fri May 29 13:23:13 UTC 2015


On Fri, May 29, 2015 at 15:11:22 +0200, Ján Tomko wrote:

The Subject conveys the most information of this commit message. 

I'd probably mention something like:

"By removing the check priv->vioserailaddrs gets always allocated ..."

> When attempting to hotplug a virtio-serial console to a domain
> that had no virtio-serial controllers (not even those that
> are added by libvirt when some devices need them) at daemon startup,
> report a user-friendly error:
> 
> error: Failed to attach device from console.xml
> error: internal error: no virtio-serial controllers are available
> 
> instead of crashing the daemon:
> 
> Process terminating with default action of signal 11 (SIGSEGV): dumping core
>  Access not within mapped region at address 0x8
>    at 0x531028F: virDomainVirtioSerialAddrNext (domain_addr.c:916)
>    by 0x531028F: virDomainVirtioSerialAddrAssign (domain_addr.c:1029)
>    by 0x1CBF68: qemuDomainAttachChrDevice (qemu_hotplug.c:1565)
>    by 0x1BCD5E: qemuDomainAttachDeviceLive (qemu_driver.c:7997)
>    by 0x1BCD5E: qemuDomainAttachDeviceFlags (qemu_driver.c:8743)
> 
> Introduced in v1.2.14-30-g5903378.
> ---
>  src/qemu/qemu_command.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index d8ce511..11c6823 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -1447,9 +1447,6 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def,
>      virDomainVirtioSerialAddrSetPtr addrs = NULL;
>      qemuDomainObjPrivatePtr priv = NULL;
>  
> -    if (virDomainControllerFindByType(def, VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) == -1)
> -        return 0;
> -
>      if (!(addrs = virDomainVirtioSerialAddrSetCreate()))
>          goto cleanup;

ACK, safe for freeze.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150529/1a17fe40/attachment-0001.sig>


More information about the libvir-list mailing list