From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: [PATCH 4/7] kvm tools: Add guest compatability warning to virtio-9p Date: Thu, 18 Aug 2011 15:18:34 +0300 Message-ID: <1313669917-21192-4-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]:36990 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755825Ab1HRMUA (ORCPT ); Thu, 18 Aug 2011 08:20:00 -0400 Received: by mail-fx0-f46.google.com with SMTP id 19so1238929fxh.19 for ; Thu, 18 Aug 2011 05:20:00 -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/include/kvm/virtio-9p.h | 1 + tools/kvm/virtio/9p.c | 9 +++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/virtio-9p.h b/tools/kvm/include/kvm/virtio-9p.h index 0e55e5c..70db831 100644 --- a/tools/kvm/include/kvm/virtio-9p.h +++ b/tools/kvm/include/kvm/virtio-9p.h @@ -44,6 +44,7 @@ struct p9_dev { u32 features; struct virtio_9p_config *config; u16 base_addr; + int compat_id; /* virtio queue */ u16 queue_selector; diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index ca9268a..92fe345 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@ -5,6 +5,7 @@ #include "kvm/ioeventfd.h" #include "kvm/irq.h" #include "kvm/virtio-9p.h" +#include "kvm/guest_compat.h" #include #include @@ -781,6 +782,8 @@ static bool virtio_p9_pci_io_out(struct ioport *ioport, struct kvm *kvm, struct p9_dev_job *job; struct virt_queue *queue; + compat__remove_message(p9dev->compat_id); + job = &p9dev->jobs[p9dev->queue_selector]; queue = &p9dev->vqs[p9dev->queue_selector]; queue->pfn = ioport__read32(data); @@ -900,6 +903,12 @@ int virtio_9p__init(struct kvm *kvm, const char *root, const char *tag_name) }; pci__register(&p9dev->pci_hdr, dev); + p9dev->compat_id = compat__add_message("virtio-9p device was not detected", + "While you have requested a virtio-9p device, " + "the guest kernel didn't seem to detect it.\n" + "Please make sure that the kernel was compiled" + "with CONFIG_NET_9P_VIRTIO."); + return err; free_p9dev_config: -- 1.7.6