qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] Rearrange block headers


From: Blue Swirl
Subject: [Qemu-devel] [PATCH] Rearrange block headers
Date: Fri, 30 Jul 2010 15:20:18 +0000

Changing block.h or blockdev.h resulted in recompiling most objects.

Move DriveInfo typedef and BlockInterfaceType enum definitions
to qemu-common.h and rearrange blockdev.h use to decrease churn.

Signed-off-by: Blue Swirl <address@hidden>
---
 blockdev.h                    |   10 ++--------
 hw/device-hotplug.c           |    1 +
 hw/etraxfs.c                  |    1 +
 hw/fdc.c                      |    1 +
 hw/fdc.h                      |    1 -
 hw/gumstix.c                  |    1 +
 hw/ide/core.c                 |    1 +
 hw/ide/qdev.c                 |    1 +
 hw/mainstone.c                |    1 +
 hw/mips_fulong2e.c            |    1 +
 hw/mips_jazz.c                |    1 +
 hw/mips_malta.c               |    1 +
 hw/mips_r4k.c                 |    1 +
 hw/musicpal.c                 |    1 +
 hw/omap1.c                    |    1 +
 hw/omap_sx1.c                 |    1 +
 hw/pc.c                       |    1 +
 hw/pc_piix.c                  |    1 +
 hw/pci-hotplug.c              |    1 +
 hw/pcmcia.h                   |    1 -
 hw/petalogix_s3adsp1800_mmu.c |    1 +
 hw/ppc405_boards.c            |    1 +
 hw/ppc_newworld.c             |    1 +
 hw/ppc_oldworld.c             |    1 +
 hw/ppc_prep.c                 |    1 +
 hw/pxa2xx.c                   |    1 +
 hw/qdev-properties.c          |    1 +
 hw/qdev.c                     |    1 +
 hw/qdev.h                     |    1 -
 hw/r2d.c                      |    1 +
 hw/realview.c                 |    1 +
 hw/scsi-bus.c                 |    1 +
 hw/scsi-disk.c                |    1 +
 hw/scsi-generic.c             |    1 +
 hw/spitz.c                    |    1 +
 hw/sun4m.c                    |    1 +
 hw/sun4u.c                    |    1 +
 hw/tosa.c                     |    1 +
 hw/usb-msd.c                  |    1 +
 hw/versatilepb.c              |    1 +
 hw/virtio-blk.c               |    1 +
 hw/virtio-pci.c               |    1 +
 hw/xen_backend.h              |    2 --
 hw/xen_devconfig.c            |    2 ++
 hw/xen_disk.c                 |    1 +
 hw/xen_machine_pv.c           |    1 +
 qemu-common.h                 |    7 +++++++
 47 files changed, 51 insertions(+), 13 deletions(-)

diff --git a/blockdev.h b/blockdev.h
index 37f3a01..89dcd9a 100644
--- a/blockdev.h
+++ b/blockdev.h
@@ -16,15 +16,9 @@
 void blockdev_mark_auto_del(BlockDriverState *bs);
 void blockdev_auto_del(BlockDriverState *bs);

-typedef enum {
-    IF_NONE,
-    IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN,
-    IF_COUNT
-} BlockInterfaceType;
-
 #define BLOCK_SERIAL_STRLEN 20

-typedef struct DriveInfo {
+struct DriveInfo {
     BlockDriverState *bdrv;
     char *id;
     const char *devaddr;
@@ -35,7 +29,7 @@ typedef struct DriveInfo {
     QemuOpts *opts;
     char serial[BLOCK_SERIAL_STRLEN + 1];
     QTAILQ_ENTRY(DriveInfo) next;
-} DriveInfo;
+};

 #define MAX_IDE_DEVS   2
 #define MAX_SCSI_DEVS  7
diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index c1a9a56..9704e2f 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -25,6 +25,7 @@
 #include "hw.h"
 #include "boards.h"
 #include "net.h"
+#include "blockdev.h"

 DriveInfo *add_init_drive(const char *optstr)
 {
diff --git a/hw/etraxfs.c b/hw/etraxfs.c
index 46e2920..5ee5f97 100644
--- a/hw/etraxfs.c
+++ b/hw/etraxfs.c
@@ -31,6 +31,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "cris-boot.h"
+#include "blockdev.h"

 #define FLASH_SIZE 0x2000000
 #define INTMEM_SIZE (128 * 1024)
diff --git a/hw/fdc.c b/hw/fdc.c
index 2d50bd6..c159dcb 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -34,6 +34,7 @@
 #include "isa.h"
 #include "sysbus.h"
 #include "qdev-addr.h"
+#include "blockdev.h"

 /********************************************************/
 /* debug Floppy devices */
diff --git a/hw/fdc.h b/hw/fdc.h
index b6b3772..242730a 100644
--- a/hw/fdc.h
+++ b/hw/fdc.h
@@ -2,7 +2,6 @@
 #define HW_FDC_H

 /* fdc.c */
-#include "blockdev.h"
 #define MAX_FD 2

 typedef struct FDCtrl FDCtrl;
diff --git a/hw/gumstix.c b/hw/gumstix.c
index c343a16..af8b464 100644
--- a/hw/gumstix.c
+++ b/hw/gumstix.c
@@ -38,6 +38,7 @@
 #include "sysemu.h"
 #include "devices.h"
 #include "boards.h"
+#include "blockdev.h"

 static const int sector_len = 128 * 1024;

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 56aed93..8b99703 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -30,6 +30,7 @@
 #include "qemu-timer.h"
 #include "sysemu.h"
 #include "dma.h"
+#include "blockdev.h"

 #include <hw/ide/internal.h>

diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 53468ed..0808760 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -20,6 +20,7 @@
 #include "dma.h"
 #include "qemu-error.h"
 #include <hw/ide/internal.h>
+#include "blockdev.h"

 /* --------------------------------- */

diff --git a/hw/mainstone.c b/hw/mainstone.c
index cba7e63..efa2959 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -17,6 +17,7 @@
 #include "mainstone.h"
 #include "sysemu.h"
 #include "flash.h"
+#include "blockdev.h"

 static struct keymap map[0xE0] = {
     [0 ... 0xDF] = { -1, -1 },
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index a9bbff6..8019eeb 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -37,6 +37,7 @@
 #include "elf.h"
 #include "vt82c686.h"
 #include "mc146818rtc.h"
+#include "blockdev.h"

 #define DEBUG_FULONG2E_INIT

diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index 71b05a2..5d5305a 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -36,6 +36,7 @@
 #include "mips-bios.h"
 #include "loader.h"
 #include "mc146818rtc.h"
+#include "blockdev.h"

 enum jazz_model_e
 {
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 11e220a..ec95cd8 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -45,6 +45,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "mc146818rtc.h"
+#include "blockdev.h"

 //#define DEBUG_BOARD_INIT

diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index 61cd33a..ca61431 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -22,6 +22,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "mc146818rtc.h"
+#include "blockdev.h"

 #define MAX_IDE_BUS 2

diff --git a/hw/musicpal.c b/hw/musicpal.c
index 33180a2..56f2766 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -18,6 +18,7 @@
 #include "flash.h"
 #include "console.h"
 #include "i2c.h"
+#include "blockdev.h"

 #define MP_MISC_BASE            0x80002000
 #define MP_MISC_SIZE            0x00001000
diff --git a/hw/omap1.c b/hw/omap1.c
index cf0d428..06370b6 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -25,6 +25,7 @@
 #include "soc_dma.h"
 /* We use pc-style serial ports.  */
 #include "pc.h"
+#include "blockdev.h"

 /* Should signal the TCMI/GPMC */
 uint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr)
diff --git a/hw/omap_sx1.c b/hw/omap_sx1.c
index c3f1973..44dc514 100644
--- a/hw/omap_sx1.c
+++ b/hw/omap_sx1.c
@@ -32,6 +32,7 @@
 #include "boards.h"
 #include "arm-misc.h"
 #include "flash.h"
+#include "blockdev.h"

 /*****************************************************************************/
 /* Siemens SX1 Cellphone V1 */
diff --git a/hw/pc.c b/hw/pc.c
index 58dea57..69b13bf 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -39,6 +39,7 @@
 #include "msix.h"
 #include "sysbus.h"
 #include "sysemu.h"
+#include "blockdev.h"

 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 812ddfd..32a1057 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -34,6 +34,7 @@
 #include "kvm.h"
 #include "sysemu.h"
 #include "sysbus.h"
+#include "blockdev.h"

 #define MAX_IDE_BUS 2

diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index c38f47f..50e2ab0 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -31,6 +31,7 @@
 #include "scsi.h"
 #include "virtio-blk.h"
 #include "qemu-config.h"
+#include "blockdev.h"

 #if defined(TARGET_I386)
 static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
diff --git a/hw/pcmcia.h b/hw/pcmcia.h
index 3602923..50648c9 100644
--- a/hw/pcmcia.h
+++ b/hw/pcmcia.h
@@ -1,7 +1,6 @@
 /* PCMCIA/Cardbus */

 #include "qemu-common.h"
-#include "blockdev.h"

 typedef struct {
     qemu_irq irq;
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 70b6a36..f5c8714 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -34,6 +34,7 @@
 #include "xilinx.h"
 #include "loader.h"
 #include "elf.h"
+#include "blockdev.h"

 #define LMB_BRAM_SIZE  (128 * 1024)
 #define FLASH_SIZE     (16 * 1024 * 1024)
diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c
index 40ff1b3..662d7c4 100644
--- a/hw/ppc405_boards.c
+++ b/hw/ppc405_boards.c
@@ -31,6 +31,7 @@
 #include "boards.h"
 #include "qemu-log.h"
 #include "loader.h"
+#include "blockdev.h"

 #define BIOS_FILENAME "ppc405_rom.bin"
 #define BIOS_SIZE (2048 * 1024)
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index fbba9b6..639dcde 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -66,6 +66,7 @@
 #include "kvm.h"
 #include "kvm_ppc.h"
 #include "hw/usb.h"
+#include "blockdev.h"

 #define MAX_IDE_BUS 2
 #define VGA_BIOS_SIZE 65536
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index 6b3ab89..de6005e 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -41,6 +41,7 @@
 #include "elf.h"
 #include "kvm.h"
 #include "kvm_ppc.h"
+#include "blockdev.h"

 #define MAX_IDE_BUS 2
 #define VGA_BIOS_SIZE 65536
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index fc3e17a..52fa9b6 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -37,6 +37,7 @@
 #include "ide.h"
 #include "loader.h"
 #include "mc146818rtc.h"
+#include "blockdev.h"

 //#define HARD_DEBUG_PPC_IO
 //#define DEBUG_PPC_IO
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 953e9ee..26b9205 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -15,6 +15,7 @@
 #include "ssi.h"
 #include "qemu-timer.h"
 #include "qemu-char.h"
+#include "blockdev.h"

 static struct {
     target_phys_addr_t io_base;
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 9219cd7..5daa894 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -1,6 +1,7 @@
 #include "net.h"
 #include "qdev.h"
 #include "qerror.h"
+#include "blockdev.h"

 void *qdev_get_prop_ptr(DeviceState *dev, Property *prop)
 {
diff --git a/hw/qdev.c b/hw/qdev.c
index e99c73f..963f1e7 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -29,6 +29,7 @@
 #include "qdev.h"
 #include "sysemu.h"
 #include "monitor.h"
+#include "blockdev.h"

 static int qdev_hotplug = 0;

diff --git a/hw/qdev.h b/hw/qdev.h
index 678f8b7..579328a 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -2,7 +2,6 @@
 #define QDEV_H

 #include "hw.h"
-#include "blockdev.h"
 #include "qemu-queue.h"
 #include "qemu-char.h"
 #include "qemu-option.h"
diff --git a/hw/r2d.c b/hw/r2d.c
index 8c1fbad..a58f653 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -36,6 +36,7 @@
 #include "loader.h"
 #include "usb.h"
 #include "flash.h"
+#include "blockdev.h"

 #define FLASH_BASE 0x00000000
 #define FLASH_SIZE 0x02000000
diff --git a/hw/realview.c b/hw/realview.c
index 70bcdb8..e9fcbc9 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -18,6 +18,7 @@
 #include "boards.h"
 #include "bitbang_i2c.h"
 #include "sysbus.h"
+#include "blockdev.h"

 #define SMP_BOOT_ADDR 0xe0000000

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index b860a09..7aa0bcd 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -3,6 +3,7 @@
 #include "scsi.h"
 #include "scsi-defs.h"
 #include "qdev.h"
+#include "blockdev.h"

 static struct BusInfo scsi_bus_info = {
     .name  = "SCSI",
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index f43f2d0..07a6d86 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -36,6 +36,7 @@ do { fprintf(stderr, "scsi-disk: " fmt , ##
__VA_ARGS__); } while (0)
 #include "scsi.h"
 #include "scsi-defs.h"
 #include "sysemu.h"
+#include "blockdev.h"

 #define SCSI_DMA_BUF_SIZE    131072
 #define SCSI_MAX_INQUIRY_LEN 256
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index a8b4176..aa4f62a 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -14,6 +14,7 @@
 #include "qemu-common.h"
 #include "qemu-error.h"
 #include "scsi.h"
+#include "blockdev.h"

 #ifdef __linux__

diff --git a/hw/spitz.c b/hw/spitz.c
index ccf2a09..a064460 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -22,6 +22,7 @@
 #include "block.h"
 #include "audio/audio.h"
 #include "boards.h"
+#include "blockdev.h"

 #undef REG_FMT
 #define REG_FMT                        "0x%02lx"
diff --git a/hw/sun4m.c b/hw/sun4m.c
index e7a4cf6..a9639c3 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -40,6 +40,7 @@
 #include "qdev-addr.h"
 #include "loader.h"
 #include "elf.h"
+#include "blockdev.h"

 //#define DEBUG_IRQ

diff --git a/hw/sun4u.c b/hw/sun4u.c
index 31c0c4c..45a46d6 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -37,6 +37,7 @@
 #include "ide.h"
 #include "loader.h"
 #include "elf.h"
+#include "blockdev.h"

 //#define DEBUG_IRQ
 //#define DEBUG_EBUS
diff --git a/hw/tosa.c b/hw/tosa.c
index ba6d9e7..cc8ce6d 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -19,6 +19,7 @@
 #include "boards.h"
 #include "i2c.h"
 #include "ssi.h"
+#include "blockdev.h"

 #define TOSA_RAM    0x04000000
 #define TOSA_ROM       0x00800000
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 65e9624..89a754c 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -15,6 +15,7 @@
 #include "console.h"
 #include "monitor.h"
 #include "sysemu.h"
+#include "blockdev.h"

 //#define DEBUG_MSD

diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 1d049f2..c51ee02 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -16,6 +16,7 @@
 #include "pci.h"
 #include "usb-ohci.h"
 #include "boards.h"
+#include "blockdev.h"

 /* Primary interrupt controller.  */

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index f50069d..4c43462 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -13,6 +13,7 @@

 #include <qemu-common.h>
 #include "qemu-error.h"
+#include "blockdev.h"
 #include "virtio-blk.h"
 #ifdef __linux__
 # include <scsi/sg.h>
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 31a711e..13fcc86 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -24,6 +24,7 @@
 #include "net.h"
 #include "loader.h"
 #include "kvm.h"
+#include "blockdev.h"

 /* from Linux's linux/virtio_pci.h */

diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index cc25f9d..292126d 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -4,8 +4,6 @@
 #include "xen_common.h"
 #include "sysemu.h"
 #include "net.h"
-#include "block_int.h"
-#include "blockdev.h"

 /* ------------------------------------------------------------- */

diff --git a/hw/xen_devconfig.c b/hw/xen_devconfig.c
index ea8f8c4..8d50216 100644
--- a/hw/xen_devconfig.c
+++ b/hw/xen_devconfig.c
@@ -1,4 +1,6 @@
 #include "xen_backend.h"
+#include "blockdev.h"
+#include "block_int.h" /* XXX */

 /* ------------------------------------------------------------- */

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 9a466f3..134ac33 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -41,6 +41,7 @@
 #include "qemu-char.h"
 #include "xen_blkif.h"
 #include "xen_backend.h"
+#include "blockdev.h"

 /* ------------------------------------------------------------- */

diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c
index 586214d..77a34bf 100644
--- a/hw/xen_machine_pv.c
+++ b/hw/xen_machine_pv.c
@@ -28,6 +28,7 @@
 #include "boards.h"
 #include "xen_backend.h"
 #include "xen_domainbuild.h"
+#include "blockdev.h"

 static void xen_init_pv(ram_addr_t ram_size,
                        const char *boot_device,
diff --git a/qemu-common.h b/qemu-common.h
index 3fb2f0b..dfd3dc0 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -201,6 +201,7 @@ typedef struct NICInfo NICInfo;
 typedef struct HCIInfo HCIInfo;
 typedef struct AudioState AudioState;
 typedef struct BlockDriverState BlockDriverState;
+typedef struct DriveInfo DriveInfo;
 typedef struct DisplayState DisplayState;
 typedef struct DisplayChangeListener DisplayChangeListener;
 typedef struct DisplaySurface DisplaySurface;
@@ -231,6 +232,12 @@ typedef struct VirtIODevice VirtIODevice;

 typedef uint64_t pcibus_t;

+typedef enum {
+    IF_NONE,
+    IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN,
+    IF_COUNT
+} BlockInterfaceType;
+
 void cpu_exec_init_all(unsigned long tb_size);

 /* CPU save/load.  */
-- 
1.6.2.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]