qemu_shim: Don't hang if failed to start domain
qemu_shim: Don't hang if failed to start domain

The qemu shim spawns a separate thread in which the event loop is
ran. The virEventRunDefaultImpl() call is wrapped in a while()
loop, just like it should. There are few lines of code around
which try to ensure that domain is destroyed (when quitting) and
that the last round of event loop is ran after the
virDomainDestroy() call. Only after that the loop is quit from
and the thread quits.

However, if domain creation fails, there is no @dom to call
destroy over, the @quit flag is never set and while() never
exits. Set the flag regardless of @dom pointer.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1920337
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Andrea Bolognani <3ada0bee826c753786fdbba72243dfba997094cf@redhat.com>

jfehlig/libvirt,zippy2/libvirt,jfehlig/libvirt,libvirt/libvirt,libvirt/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,nertpinx/libvirt,zippy2/libvirt,olafhering/libvirt,nertpinx/libvirt,crobinso/libvirt,crobinso/libvirt,libvirt/libvirt,nertpinx/libvirt,olafhering/libvirt,jfehlig/libvirt,libvirt/libvirt,jfehlig/libvirt,crobinso/libvirt,nertpinx/libvirt,zippy2/libvirt,nertpinx/libvirt,olafhering/libvirt