[PATCH] libxl: fix crash when initializing driver

Jim Fehlig jfehlig at suse.com
Mon Apr 6 14:18:33 UTC 2020


On 4/6/20 3:19 AM, Ján Tomko wrote:
> On a Friday in 2020, Jim Fehlig wrote:
>> Commit 54a401af478 split out DriverConfigInit from DriverConfigNew, but
>> then called it a bit late from libxlStateInitialize. The cfg is used in
>> libxlDriverConfigLoadFile and when uninitialized results in a crash.
>> Calling DriverConfigInit immediately after DriverConfigNew fixes the
>> crash.
>>
> 
> More specifically it's libxlGetAutoballoonConf which depends on
> cfg->verInfo being filled if autoballoon is not set in the config file.

And I was hoping no one would notice that ugly little detail :-).

> I don't have an idea how to neatly split it to maintain the separation
> I intended to do in that commit.

Before sending this patch I thought about splitting the check for dom0_mem out 
of libxlGetAutoballoonConf, but I couldn't think of a better place to put it. 
Although it is lumped with parsing libxl.conf it does keep the autoballoon logic 
in one small function, so in the end I decided to just leave it.

Regards,
Jim





More information about the libvir-list mailing list