[libvirt] [PATCH] qemu_hotplug: fix crash in hot(un)plugging chardev devices

Pavel Hrdina phrdina at redhat.com
Tue Oct 18 11:32:26 UTC 2016


On Tue, Oct 18, 2016 at 01:26:55PM +0200, Peter Krempa wrote:
> On Tue, Oct 18, 2016 at 13:20:01 +0200, Pavel Hrdina wrote:
> > We need to make sure that the chardev is serial and TCP.
> 
> Note that it corrupts pointers in a different part of the union.
> 
> > 
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> >  src/qemu/qemu_hotplug.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> > index 14af4e1..1003d50 100644
> > --- a/src/qemu/qemu_hotplug.c
> > +++ b/src/qemu/qemu_hotplug.c
> > @@ -1729,7 +1729,9 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
> >      if (qemuDomainChrPreInsert(vmdef, chr) < 0)
> >          goto cleanup;
> >  
> > -    if (cfg->chardevTLS) {
> > +    if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
> 
> This is relevant for all chardevs that have TCP transport not just the
> serial ones, thus only the actual backend dev should matter.

Right, I didn't realize that, thanks, I'll push it shortly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161018/50bf9caf/attachment-0001.sig>


More information about the libvir-list mailing list