]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Unify virtio code file names
authorAsias He <asias.hejun@gmail.com>
Fri, 8 Apr 2011 16:10:05 +0000 (00:10 +0800)
committerPekka Enberg <penberg@kernel.org>
Fri, 8 Apr 2011 16:22:00 +0000 (19:22 +0300)
- rename {blk,console}-virtio.* to virtio-{blk,console}.*
- change the virtio block device PCI io space operation callback names

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/Makefile
tools/kvm/include/kvm/virtio-blk.h [moved from tools/kvm/include/kvm/blk-virtio.h with 70% similarity]
tools/kvm/include/kvm/virtio-console.h [moved from tools/kvm/include/kvm/console-virtio.h with 100% similarity]
tools/kvm/include/kvm/virtio-pci.h [moved from tools/kvm/include/kvm/virtio_pci.h with 100% similarity]
tools/kvm/main.c
tools/kvm/virtio-blk.c [moved from tools/kvm/blk-virtio.c with 86% similarity]
tools/kvm/virtio-console.c [moved from tools/kvm/console-virtio.c with 98% similarity]

index 82d41b6b06c5647a5d86b01859d0d883a5011331..45498a2ce16023b4ca49e91bfa85015c6546fae8 100644 (file)
@@ -13,8 +13,8 @@ CSCOPE = cscope
 TAGS = ctags
 
 OBJS   += 8250-serial.o
-OBJS   += blk-virtio.o
-OBJS   += console-virtio.o
+OBJS   += virtio-blk.o
+OBJS   += virtio-console.o
 OBJS   += cpuid.o
 OBJS   += read-write.o
 OBJS   += disk-image.o
similarity index 70%
rename from tools/kvm/include/kvm/blk-virtio.h
rename to tools/kvm/include/kvm/virtio-blk.h
index 02f39df7a6576e4d787eeea36fa7b3769d73a971..f82bbc7f6954c606a16d5e243254e0e594a86a29 100644 (file)
@@ -3,6 +3,6 @@
 
 struct kvm;
 
-void blk_virtio__init(struct kvm *self);
+void virtio_blk__init(struct kvm *self);
 
 #endif /* KVM__BLK_VIRTIO_H */
index bc165027ad6c2a54512975cfbc221b19e56edfef..b744ce0d0d301032f54577ba8d56613a8be2c47f 100644 (file)
@@ -1,8 +1,8 @@
 #include "kvm/kvm.h"
 
 #include "kvm/8250-serial.h"
-#include "kvm/blk-virtio.h"
-#include "kvm/console-virtio.h"
+#include "kvm/virtio-blk.h"
+#include "kvm/virtio-console.h"
 #include "kvm/disk-image.h"
 #include "kvm/util.h"
 #include "kvm/pci.h"
@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
 
        pci__init();
 
-       blk_virtio__init(kvm);
+       virtio_blk__init(kvm);
 
        virtio_console__init(kvm);
 
similarity index 86%
rename from tools/kvm/blk-virtio.c
rename to tools/kvm/virtio-blk.c
index 2eb9734547d5125a25a70fc1d3e33fc799c01c42..a41d5aca91e1324369be5c98a7af5eb293b2c116 100644 (file)
@@ -1,6 +1,6 @@
-#include "kvm/blk-virtio.h"
+#include "kvm/virtio-blk.h"
 
-#include "kvm/virtio_pci.h"
+#include "kvm/virtio-pci.h"
 
 #include "kvm/disk-image.h"
 #include "kvm/virtio.h"
@@ -48,7 +48,7 @@ static struct blk_device blk_device = {
        .host_features          = (1UL << VIRTIO_BLK_F_SEG_MAX),
 };
 
-static bool virtio_blk_config_in(void *data, unsigned long offset, int size, uint32_t count)
+static bool virtio_blk_pci_io_device_specific_in(void *data, unsigned long offset, int size, uint32_t count)
 {
        uint8_t *config_space = (uint8_t *) &blk_device.blk_config;
 
@@ -60,7 +60,7 @@ static bool virtio_blk_config_in(void *data, unsigned long offset, int size, uin
        return true;
 }
 
-static bool blk_virtio_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
+static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
 {
        unsigned long offset;
 
@@ -92,13 +92,13 @@ static bool blk_virtio_in(struct kvm *self, uint16_t port, void *data, int size,
                ioport__write16(data, blk_device.config_vector);
                break;
        default:
-               return virtio_blk_config_in(data, offset, size, count);
+               return virtio_blk_pci_io_device_specific_in(data, offset, size, count);
        };
 
        return true;
 }
 
-static bool blk_virtio_request(struct kvm *self, struct virt_queue *queue)
+static bool virtio_blk_request(struct kvm *self, struct virt_queue *queue)
 {
        struct vring_used_elem *used_elem;
        struct virtio_blk_outhdr *req;
@@ -197,7 +197,7 @@ static bool blk_virtio_request(struct kvm *self, struct virt_queue *queue)
        return true;
 }
 
-static bool blk_virtio_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
+static bool virtio_blk_pci_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
 {
        unsigned long offset;
 
@@ -233,7 +233,7 @@ static bool blk_virtio_out(struct kvm *self, uint16_t port, void *data, int size
                queue                   = &blk_device.virt_queues[queue_index];
 
                while (queue->vring.avail->idx != queue->last_avail_idx) {
-                       if (!blk_virtio_request(self, queue))
+                       if (!virtio_blk_request(self, queue))
                                return false;
                }
                kvm__irq_line(self, VIRTIO_BLK_IRQ, 1);
@@ -255,9 +255,9 @@ static bool blk_virtio_out(struct kvm *self, uint16_t port, void *data, int size
        return true;
 }
 
-static struct ioport_operations blk_virtio_io_ops = {
-       .io_in          = blk_virtio_in,
-       .io_out         = blk_virtio_out,
+static struct ioport_operations virtio_blk_io_ops = {
+       .io_in          = virtio_blk_pci_io_in,
+       .io_out         = virtio_blk_pci_io_out,
 };
 
 #define PCI_VENDOR_ID_REDHAT_QUMRANET          0x1af4
@@ -265,7 +265,7 @@ static struct ioport_operations blk_virtio_io_ops = {
 #define PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET        0x1af4
 #define PCI_SUBSYSTEM_ID_VIRTIO_BLK            0x0002
 
-static struct pci_device_header blk_virtio_pci_device = {
+static struct pci_device_header virtio_blk_pci_device = {
        .vendor_id              = PCI_VENDOR_ID_REDHAT_QUMRANET,
        .device_id              = PCI_DEVICE_ID_VIRTIO_BLK,
        .header_type            = PCI_HEADER_TYPE_NORMAL,
@@ -280,14 +280,14 @@ static struct pci_device_header blk_virtio_pci_device = {
 
 #define PCI_VIRTIO_BLK_DEVNUM 1
 
-void blk_virtio__init(struct kvm *self)
+void virtio_blk__init(struct kvm *self)
 {
        if (!self->disk_image)
                return;
 
        blk_device.blk_config.capacity = self->disk_image->size / SECTOR_SIZE;
 
-       pci__register(&blk_virtio_pci_device, PCI_VIRTIO_BLK_DEVNUM);
+       pci__register(&virtio_blk_pci_device, PCI_VIRTIO_BLK_DEVNUM);
 
-       ioport__register(IOPORT_VIRTIO_BLK, &blk_virtio_io_ops, IOPORT_VIRTIO_BLK_SIZE);
+       ioport__register(IOPORT_VIRTIO_BLK, &virtio_blk_io_ops, IOPORT_VIRTIO_BLK_SIZE);
 }
similarity index 98%
rename from tools/kvm/console-virtio.c
rename to tools/kvm/virtio-console.c
index 3926536d734bddcf726f7b839561d9d995c2f435..fd79c61671c94700da1a30cfd47252eaa12da758 100644 (file)
@@ -1,5 +1,5 @@
-#include "kvm/console-virtio.h"
-#include "kvm/virtio_pci.h"
+#include "kvm/virtio-console.h"
+#include "kvm/virtio-pci.h"
 #include "kvm/disk-image.h"
 #include "kvm/virtio.h"
 #include "kvm/ioport.h"