OSDN Git Service

virtio-scsi: Fix num_queue input validation
authorFam Zheng <famz@redhat.com>
Fri, 31 Oct 2014 03:04:31 +0000 (11:04 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 31 Oct 2014 10:29:02 +0000 (11:29 +0100)
commit0ba1f53191221b541b938df86a39eeccfb87f996
treee930a80d0cbbf94d2d40eb8e20488b855607d1cc
parentfb7b5c0df6e3c501973ce4d57eb2b1d4344a519d
virtio-scsi: Fix num_queue input validation

We need to count the ctrlq and eventq, and also cleanup before
returning. Besides, the format string should be unsigned.

The number could never be less than zero.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/virtio-scsi.c