[PATCH] vmx: make 'fileName' optional for CD-ROMs

Pino Toscano ptoscano at redhat.com
Wed Mar 18 12:44:18 UTC 2020


(Apparently forgot to send it yesterday, so sending it with a small
addedum.)

On Tuesday, 17 March 2020 18:09:04 CET Richard W.M. Jones wrote:
> My only worry about this patch is that it relies on fileName now
> possibly being NULL, which means if there is any case that you've
> missed now — or one added in future — which doesn't consider that
> fileName might be NULL then it'll crash (libvirtd? or virsh? I'm not
> sure).

In case now (even in v2) fileName is used without checking, it will
crash libvirt, as the esx/vmware drivers are built-in in the library.

> I wonder if therefore it would be safer to set the string to a
> known-good non-NULL value such as ‘strdup ("emptyBackingString")’?

Thought about that, however "emptyBackingString" seems like a magic
identifier, and it would be trading one hack with another, somehow.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200318/853fd8ae/attachment-0001.sig>


More information about the libvir-list mailing list