• E
    qemu: only parse basename when determining emulator properties · 6a373fb2
    Eric Blake 提交于
    '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: NEric Blake <eblake@redhat.com>
    6a373fb2
qemu_command.c 410.9 KB