Re: [PATCH] qemu: hotplug: Don't access srcPriv when it's not allocated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 03, 2018 at 17:05:31 +0200, Marc Hartmayer wrote:
> On Tue, Jul 03, 2018 at 04:22 PM +0200, Peter Krempa <pkrempa@xxxxxxxxxx> wrote:
> > On Tue, Jul 03, 2018 at 09:34:56 -0400, John Ferlan wrote:
> >> Feels like we've done this before...
> >>
> >> 97202988 <sigh> and 6050affb7f
> >
> > Specifically the former commit was not good enough to cover this case
> > despite touching this code.
> 
> Would it make sense to always allocate the
> qemuDomainStorageSourcePrivate struct? We’d be wasting some memory, but
> at the same time the code would be easier to read and less prone to
> error. e.g. qemuDomainDeviceDiskDefPostParseRestoreSecAlias would be
> simpler.
> 
> For the privateData of virConnect, virDomainVsockDef, virDisk,
> virDomainVcpu… it’s implemented this way.
> 
> Anyway: Reviewed-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx> and thanks
> for fixing it!

virStorageSource is not allocated using a helper so this would require
refactoring all allocations and passing in of the private data structure
which contains the callback to allocate the private data. I was thinking
about it but did not find fixing it compelling enough to do it myself.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux