Re: [PATCH RFC 07/40] qemu: domain: Tolerate NULL @disk in qemuDomainPrepareDiskSourceData

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

 



On Fri, Oct 18, 2019 at 16:08:13 -0300, Daniel Henrique Barboza wrote:
> 
> 
> On 10/18/19 1:10 PM, Peter Krempa wrote:
> > In some cases we want to prepare a @src which is not meant to belong to
> > a disk and thus does not require us to copy the data. Allow passing in
> > NULL @disk into qemuDomainPrepareDiskSourceData.
> > 
> > Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> > ---
> 
> This is worth pushing as a bug fix IMO. Of all callers of
> qemuDomainPrepareDiskSourceData, just qemuDomainPrepareDiskSourceLegacy
> ensures that disk isn't NULL (and not explicitly, more like a side effect of
> qemuDomainValidateStorageSource being used with disk->src there). In all
> other places there is no guard of disk == NULL.
> 
> Or perhaps disk=NULL never happens in the current usage of this function and
> I'm being pendant.  Anyway ....

It is not a bug fix. Out of the 3 non-test callers, two dereference disk
anyways in other places thus this fix will not help.

In fact it is meant to make the third caller
qemuDomainPrepareStorageSourceBlockdev callable with NULL disk which is
the intended purpose of this patch. That helper is currently used only
in cases where qemuDomainPrepareDiskSourceLegacy would be used and thus
disk must be non-NULL. The use with NULL disk will appear later in this
series.

--
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