Skip to content
  • Andreas Färber's avatar
    target-i386: Fix X86CPU error handling · cd7b87ff
    Andreas Färber authored
    
    
    Error **errp argument is not for emitting warnings, it means an error
    has occurred and the caller should not make any assumptions about the
    state of other return values (unless otherwise documented).
    
    Therefore cpu_x86_create() must unref the new X86CPU itself, and
    pc_new_cpu() must check for an Error rather than NULL return value.
    
    While at it, clean up a superfluous NULL check.
    
    Reported-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    Cc: qemu-stable@nongnu.org
    Cc: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
    cd7b87ff