Re: [RFC] [PATCH v2] kvm tools: Make virt_queue__available return false if queue is not initialized.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 10 Apr 2011, Amos Kong wrote:
virtio_console__inject_interrupt tries to use virt queues before guest
tell us to initialize them.

(gdb) r run -i linux-0.2.img -k ./vmlinuz-2.6.38-rc6+ -r ./initrd.img-2.6.38-rc6+ -p=init=1 -m 500 -c
Starting program: /project/rh/kvm-tools/tools/kvm/kvm run -i linux-0.2.img -k ./vmlinuz-2.6.38-rc6+ -r ./initrd.img-2.6.38-rc6+ -p=init=1 -m 500 -c
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffd6e2d700 (LWP 19280)]
 Warning: request type 8

Program received signal SIGSEGV, Segmentation fault.
0x00000000004026ca in virt_queue__available (vq=0x60d3c8) at include/kvm/virtio.h:31
31              return vq->vring.avail->idx !=  vq->last_avail_idx;
(gdb)
(gdb) bt
(gdb) p *vq
$2 = {vring = {num = 0, desc = 0x0, avail = 0x0, used = 0x0}, pfn = 0, last_avail_idx = 0}

include/kvm/virtio-console.h:
59 void virtio_console__inject_interrupt(struct kvm *self)
....
71         if (term_readable(CONSOLE_VIRTIO) && virt_queue__available(vq)) {
72                 head = virt_queue__get_iov(vq, iov, &out, &in, self);
                          ^^^^ then this block will not be executed if
                               virtio_queue is unavaiable.


Changes from v1:
- move the check of virt_queue out of virt_queue__get_iov()

Reported-by: Amos Kong <akong@xxxxxxxxxx>
Signed-off-by: Asias He <asias.hejun@xxxxxxxxx>
Signed-off-by: Amos Kong <akong@xxxxxxxxxx>

Applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux