mirror of https://github.com/xemu-project/xemu.git
virtio-blk: Convert fprintf() to error_report()
Errors should be logged using error_report() so they go to the appropriate monitor. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
281a26b15b
commit
870cef1dae
|
@ -324,13 +324,13 @@ static void virtio_blk_handle_request(VirtIOBlockReq *req,
|
||||||
MultiReqBuffer *mrb)
|
MultiReqBuffer *mrb)
|
||||||
{
|
{
|
||||||
if (req->elem.out_num < 1 || req->elem.in_num < 1) {
|
if (req->elem.out_num < 1 || req->elem.in_num < 1) {
|
||||||
fprintf(stderr, "virtio-blk missing headers\n");
|
error_report("virtio-blk missing headers");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req->elem.out_sg[0].iov_len < sizeof(*req->out) ||
|
if (req->elem.out_sg[0].iov_len < sizeof(*req->out) ||
|
||||||
req->elem.in_sg[req->elem.in_num - 1].iov_len < sizeof(*req->in)) {
|
req->elem.in_sg[req->elem.in_num - 1].iov_len < sizeof(*req->in)) {
|
||||||
fprintf(stderr, "virtio-blk header not in correct element\n");
|
error_report("virtio-blk header not in correct element");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue