Re: [PATCH] qemu: Avoid crashes in qemuDomainMachineIs*()

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

 



On Tue, 2017-10-10 at 15:49 +0100, Daniel P. Berrange wrote:
> I think rather than trying to fix up the assumption about
> machine being non-NULL, we should restructure the ARGV
> parsing into we need a 2 pass process.
> 
> In the first pass only look for the -machine arg. If no
> -machine arg is given, we should fill in the default machine
> for that emulator.

I can do this...

> In the second pass process the rest of the ARGV, whereupon
> we have a valid assumption that machine is non-NULL.

... but I'm not sure doing this is a good idea.

Wouldn't it be much safer to leave the newly-added NULL checks
in place so that the qemuDomainMachineIs*() functions are locally
correct instead of relying on external guarantees in order not
to crash on the user?

-- 
Andrea Bolognani / Red Hat / Virtualization

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