virtio: validate address space cache during init
authorJason Wang <jasowang@redhat.com>
Wed, 15 Mar 2017 11:48:32 +0000 (19:48 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 15 Mar 2017 17:37:19 +0000 (19:37 +0200)
commite45da653223869849877ee8f4b86f511f891d4f8
tree0f0c8f7df7e52be19b7c49836c8597bef1fb407d
parente0e2d644096c79a71099b176d08f465f6803a8b1
virtio: validate address space cache during init

We don't check the return value of address_space_cache_init(), this
may lead buggy driver use incorrect region caches. Instead of
triggering an assert, catch and warn this early in
virtio_init_region_cache().

Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio.c