]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Add guest compatability warning to virtio-9p
authorSasha Levin <levinsasha928@gmail.com>
Thu, 18 Aug 2011 12:18:34 +0000 (15:18 +0300)
committerPekka Enberg <penberg@kernel.org>
Fri, 19 Aug 2011 16:13:49 +0000 (19:13 +0300)
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/include/kvm/virtio-9p.h
tools/kvm/virtio/9p.c

index 0e55e5c4b6a3269a3d5abf6ef4457578b8ad7631..70db831fbce8983b307124f8d5e02f145d9df0d3 100644 (file)
@@ -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;
index e42d78c35a266ecc23cd2160ce711e3be2862fa5..8a4fe734d6914711bf6f15c6971bd8681fd30563 100644 (file)
@@ -5,6 +5,7 @@
 #include "kvm/ioeventfd.h"
 #include "kvm/irq.h"
 #include "kvm/virtio-9p.h"
+#include "kvm/guest_compat.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -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: