Re: [libvirt] [PATCH] conf: Allocate structure for 'perf' events in virDomainDefNew

2016-06-29 Thread Peter Krempa
On Wed, Jun 29, 2016 at 08:07:29 +0200, Ján Tomko wrote: > On Tue, Jun 28, 2016 at 02:43:59PM +0200, Peter Krempa wrote: > >Some code paths already assume that it is allocated since it was always > >allocated by virDomainPerfDefParseXML. Move allocation to > > Shouldn't we rather fix those code

Re: [libvirt] [PATCH] conf: Allocate structure for 'perf' events in virDomainDefNew

2016-06-29 Thread Ján Tomko
On Tue, Jun 28, 2016 at 02:43:59PM +0200, Peter Krempa wrote: Some code paths already assume that it is allocated since it was always allocated by virDomainPerfDefParseXML. Move allocation to Shouldn't we rather fix those code paths? virDomainDefNew would get ridiculously long if we started

[libvirt] [PATCH] conf: Allocate structure for 'perf' events in virDomainDefNew

2016-06-28 Thread Peter Krempa
Some code paths already assume that it is allocated since it was always allocated by virDomainPerfDefParseXML. Move allocation to virDomainDefNew to handle cases that don't go through the XML parser. This fixes crash when attempting to connect to an existing process via virDomainQemuAttach.