[libvirt] [PATCH 1/3] qemu: only parse basename when determining emulator properties

Eric Blake eblake at redhat.com
Fri Sep 6 15:34:06 UTC 2013


On 09/04/2013 06:14 AM, Michal Privoznik wrote:
> On 28.08.2013 06:00, Eric Blake wrote:
>> 'virsh domxml-from-native' and 'virsh qemu-attach' could misbehave
>> for an emulator installed in (a somewhat unlikely) location
>> such as /usr/local/qemu-1.6/qemu-system-x86_64 or (an even less
>> likely) /opt/notxen/qemu-system-x86_64.  Limit the strstr seach
>> to just the basename of the file where we are assuming details
>> about the binary based on its name.
>>
>> While testing, I accidentally triggered a core dump during strcmp
>> when I forgot to set os.type on one of my code paths; this patch
>> changes such a coding error to raise a nicer internal error instead.
>>
>> * src/qemu/qemu_command.c (qemuParseCommandLine): Compute basename
>> earlier.
>> * src/conf/domain_conf.c (virDomainDefPostParseInternal): Avoid
>> NULL deref.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>  src/conf/domain_conf.c  |  6 ++++++
>>  src/qemu/qemu_command.c | 22 ++++++++++------------
>>  2 files changed, 16 insertions(+), 12 deletions(-)
> 
> ACK

Thanks; pushed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130906/c8c404f3/attachment-0001.sig>


More information about the libvir-list mailing list