summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-08-24 15:22:24 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-08-24 15:22:24 +0000
commit2446333cd5b5c985f6517dee7004e542ecacd21c (patch)
tree9646889006f9944dc5d530b73d35a6c3c30c239b
parente945fb76271eb4c8ceed6bff417a0b98744e1af3 (diff)
Rearrange block headersHEADmaster
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 <blauwirbel@gmail.com>
-rw-r--r--blockdev.h10
-rw-r--r--hw/device-hotplug.c1
-rw-r--r--hw/etraxfs.c1
-rw-r--r--hw/fdc.c1
-rw-r--r--hw/fdc.h1
-rw-r--r--hw/gumstix.c1
-rw-r--r--hw/ide/core.c1
-rw-r--r--hw/ide/qdev.c1
-rw-r--r--hw/mainstone.c1
-rw-r--r--hw/mips_fulong2e.c1
-rw-r--r--hw/mips_jazz.c1
-rw-r--r--hw/mips_malta.c1
-rw-r--r--hw/mips_r4k.c1
-rw-r--r--hw/musicpal.c1
-rw-r--r--hw/omap1.c1
-rw-r--r--hw/omap_sx1.c1
-rw-r--r--hw/pc.c1
-rw-r--r--hw/pc_piix.c1
-rw-r--r--hw/pci-hotplug.c1
-rw-r--r--hw/pcmcia.h1
-rw-r--r--hw/petalogix_s3adsp1800_mmu.c1
-rw-r--r--hw/ppc405_boards.c1
-rw-r--r--hw/ppc_newworld.c1
-rw-r--r--hw/ppc_oldworld.c1
-rw-r--r--hw/ppc_prep.c1
-rw-r--r--hw/pxa2xx.c1
-rw-r--r--hw/qdev-properties.c1
-rw-r--r--hw/qdev.c1
-rw-r--r--hw/qdev.h1
-rw-r--r--hw/r2d.c1
-rw-r--r--hw/realview.c1
-rw-r--r--hw/scsi-bus.c1
-rw-r--r--hw/scsi-disk.c1
-rw-r--r--hw/scsi-generic.c1
-rw-r--r--hw/spitz.c1
-rw-r--r--hw/sun4m.c1
-rw-r--r--hw/sun4u.c1
-rw-r--r--hw/tosa.c1
-rw-r--r--hw/usb-msd.c1
-rw-r--r--hw/versatilepb.c1
-rw-r--r--hw/virtio-blk.c1
-rw-r--r--hw/virtio-pci.c1
-rw-r--r--hw/xen_backend.h2
-rw-r--r--hw/xen_devconfig.c2
-rw-r--r--hw/xen_disk.c1
-rw-r--r--hw/xen_machine_pv.c1
-rw-r--r--qemu-common.h7
47 files changed, 51 insertions, 13 deletions
diff --git a/blockdev.h b/blockdev.h
index 37f3a017e..89dcd9a88 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 c1a9a561d..9704e2feb 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 46e2920c2..5ee5f979a 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 2d50bd6a3..c159dcb63 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 b6b377259..242730af8 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 c343a166e..af8b464b8 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 631673fc0..3651d2be9 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 53468edcb..080876035 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 cba7e63b3..efa2959c7 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 c6c13ca99..cbe71567a 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 71b05a203..5d5305a82 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 11e220a94..ec95cd850 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 61cd33a93..ca61431ee 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 33180a265..56f27669d 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 cf0d42869..06370b6d3 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 c3f197393..44dc514f3 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 58dea57f8..69b13bf62 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 812ddfd67..32a105736 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 6a5e3b883..716133c37 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 360292395..50648c973 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 fcbb825d7..42de45963 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 40ff1b34e..662d7c437 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 fbba9b6fb..639dcde00 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 6b3ab8961..de6005e35 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 fc3e17a0c..52fa9b6d9 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 953e9ee1d..26b9205db 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 2d600f5ee..a493087a5 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 d1acf86c4..35858cb81 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 678f8b7d1..579328afc 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 8c1fbad4b..a58f653e5 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 70bcdb846..e9fcbc9a6 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 b860a09ed..7aa0bcd1e 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 f43f2d097..07a6d8694 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 a8b4176d8..aa4f62ae5 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 ccf2a091f..a06446093 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 a1373d407..7d7a7df1c 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 31c0c4c48..45a46d673 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 ba6d9e73b..cc8ce6d64 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 8b510cf90..0a95d8d50 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 1d049f234..c51ee02c4 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 490cd4105..c3a73438f 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 82a6d78a9..6e8f88a14 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 cc25f9d7d..292126dd1 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 ea8f8c4c2..8d50216c0 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 9a466f3cc..134ac3388 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 586214d8b..77a34bf11 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 3fb2f0b37..dfd3dc08a 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. */