From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: [PATCH 3/7] kvm tools: Add guest compatability warning to virtio-blk Date: Thu, 18 Aug 2011 15:18:33 +0300 Message-ID: <1313669917-21192-3-git-send-email-levinsasha928@gmail.com> References: <1313669917-21192-1-git-send-email-levinsasha928@gmail.com> Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, Sasha Levin To: penberg@kernel.org Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:54788 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755812Ab1HRMT7 (ORCPT ); Thu, 18 Aug 2011 08:19:59 -0400 Received: by mail-fx0-f46.google.com with SMTP id 19so1238918fxh.19 for ; Thu, 18 Aug 2011 05:19:58 -0700 (PDT) In-Reply-To: <1313669917-21192-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Sasha Levin --- tools/kvm/virtio/blk.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/tools/kvm/virtio/blk.c b/tools/kvm/virtio/blk.c index f5ecdd9..856c418 100644 --- a/tools/kvm/virtio/blk.c +++ b/tools/kvm/virtio/blk.c @@ -11,6 +11,7 @@ #include "kvm/pci.h" #include "kvm/threadpool.h" #include "kvm/ioeventfd.h" +#include "kvm/guest_compat.h" #include #include @@ -48,6 +49,7 @@ struct blk_dev { u16 config_vector; u8 status; u8 isr; + int compat_id; /* virtio queue */ u16 queue_selector; @@ -208,6 +210,8 @@ static bool virtio_blk_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 po struct virt_queue *queue; void *p; + compat__remove_message(bdev->compat_id); + queue = &bdev->vqs[bdev->queue_selector]; queue->pfn = ioport__read32(data); p = guest_pfn_to_host(kvm, queue->pfn); @@ -322,6 +326,12 @@ void virtio_blk__init(struct kvm *kvm, struct disk_image *disk) ioeventfd__add_event(&ioevent); } + + bdev->compat_id = compat__add_message("virtio-blk device was not detected", + "While you have requested a virtio-blk device, " + "the guest kernel didn't seem to detect it.\n" + "Please make sure that the kernel was compiled" + "with CONFIG_VIRTIO_BLK."); } void virtio_blk__init_all(struct kvm *kvm) -- 1.7.6