On 17 March 2014 14:28, Laszlo Ersek <ler...@redhat.com> wrote: > On 03/17/14 07:02, Dave Airlie wrote: >> The main reason I'm considering this stuff is for security reasons if >> the guest asks for something really illegal or crazy what should the >> expected behaviour of the host be? (at least secure I know that). > > exit(1).
No thanks -- the guest should never be able to cause QEMU to exit (in an ideal world). Use qemu_log_mask(LOG_GUEST_ERROR, ...) and continue. > If you grep qemu for it, you'll find such examples. Notably, > "hw/virtio/virtio.c" is chock full of them; if the guest doesn't speak > the basic protocol, there's nothing for the host to do. See also > virtio-blk.c (missing or incorrect headers), virtio-net.c (similar > protocol violations), virtio-scsi.c (wrong header size, bad config etc). I think these are all examples of legacy code written before we had a sensible logging API for this kind of thing. thanks -- PMM