]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
Fixes for git ioemu tree from Christoph Egger
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 23 Mar 2009 16:47:35 +0000 (16:47 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 23 Mar 2009 16:47:35 +0000 (16:47 +0000)
 Make ioemu build w/o CONFIG_PASSTHROUGH
- Make ioemu build w/ TAPGIFNAME defined
- Make pci_emulation_add non-static as it is used in different files
- remove redundant variable re-declarations/re-definitions
- Make xenstore functions static. They have no prototypes and aren't used
  elsewhere
- Initialize xenpv_machine correctly (xen_init_pv didn't match what
  QEMUmachine expected)
- Misc compiler warning fixes

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
12 files changed:
hw/pc.c
hw/tpm_tis.c
hw/xen_blktap.c
hw/xen_blktap.h
hw/xen_machine_pv.c
i386-dm/helper2.c
net.c
sysemu.h
tapdisk-ioemu.c
vl.c
xen-vl-extra.c
xenstore.c

diff --git a/hw/pc.c b/hw/pc.c
index 77f6812b57d589cf8ba3f0b118d3cbe5fe7509e3..d383bdc108f856f294e1bad2994d072c69c65dfd 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
 
 #define MAX_IDE_BUS 2
 
+#ifdef HAS_TPM
+void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
+#endif
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
index ceb0decacdbadea23cd6aba3be86c51d10a40441..50ecac0ab5102c0405afd8b955d75abd33822d83 100644 (file)
@@ -138,7 +138,7 @@ typedef struct TPMState {
 
 
 /* local prototypes */
-static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg);
+static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, const char *msg);
 static int TPM_Receive(tpmState *s, tpmBuffer *buffer);
 static uint32_t vtpm_instance_from_xenstore(void);
 static void tis_poll_timer(void *opaque);
@@ -860,6 +860,9 @@ typedef struct LPCtpmState {
 /*
  * initialize TIS interface
  */
+
+void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
+
 void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq)
 {
     LPCtpmState *d;
@@ -952,7 +955,7 @@ const static unsigned char tpm_failure[] = {
 /*
  * Send a TPM request.
  */
-static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg)
+static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, const char *msg)
 {
     int len;
     uint32_t size = tpm_get_size_from_buffer(buffer->buf);
@@ -1073,7 +1076,7 @@ static uint32_t vtpm_instance_from_xenstore(void)
     unsigned int num;
     uint32_t number = VTPM_BAD_INSTANCE;
     int end = 0;
-    char *token = "tok";
+    const char *token = "tok";
     int subscribed = 0;
     int ctr = 0;
     fd_set readfds;
index 05478890db07c24f8913b0302136f1690869247d..24d10a3401ee4755421208b017c84cf1dcb40b10 100644 (file)
@@ -61,8 +61,6 @@
 #endif 
 
 
-extern int domid;
-
 int read_fd;
 int write_fd;
 
index 92cc08efa5507a019d50cac2e92576266a0c728a..0835878fb5195a6edb35aa784cac6df70b4da08c 100644 (file)
@@ -50,4 +50,6 @@ typedef struct fd_list_entry {
        struct fd_list_entry **pprev, *next;
 } fd_list_entry_t;
 
+int init_blktap(void);
+
 #endif /*XEN_BLKTAP_H_*/
index b7f8e2825cec57e2f0d82695df68d6d20d655cce..6bfafbb9d88410a79baf311de4f8f829d86cb1dc 100644 (file)
 #include "boards.h"
 #include "xen_backend.h"
 
+#ifndef CONFIG_STUBDOM
+#include <hw/xen_blktap.h>
+#endif
+
 uint32_t xen_domid;
 enum xen_mode xen_mode = XEN_EMULATE;
 
-extern void init_blktap(void);
-
 static void xen_init_pv(ram_addr_t ram_size, int vga_ram_size,
-                       const char *boot_device, DisplayState *ds,
+                       const char *boot_device,
                        const char *kernel_filename,
                        const char *kernel_cmdline,
                        const char *initrd_filename,
index f22b28d314480d61816357c421a5b99aff094ea7..969241fa00d53cf666c80570cc54d9139b5d806c 100644 (file)
@@ -82,7 +82,6 @@ int vcpus = 1;
 int xc_handle = -1;
 
 char domain_name[64] = "Xen-no-name";
-int domid;
 
 int domid_backend = 0;
   /* 0 for now.  If we ever have non-dom0 backend domains, this
@@ -313,9 +312,6 @@ static void do_outp(CPUState *env, unsigned long addr,
     }
 }
 
-extern void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
-                                   int len, int is_write);
-
 static inline void read_physical(uint64_t addr, unsigned long size, void *val)
 {
     return cpu_physical_memory_rw((target_phys_addr_t)addr, val, size, 0);
@@ -505,7 +501,6 @@ static void handle_buffered_io(void *opaque)
 
 static void cpu_handle_ioreq(void *opaque)
 {
-    extern int vm_running;
     extern int shutdown_requested;
     CPUState *env = opaque;
     ioreq_t *req = cpu_get_ioreq();
@@ -552,7 +547,6 @@ int xen_pause_requested;
 
 int main_loop(void)
 {
-    extern int vm_running;
     CPUState *env = cpu_single_env;
     int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
     char *qemu_file;
diff --git a/net.c b/net.c
index 78e2e651c2ba38ab2882dd97abf507d74b7717e5..9c4847b50dadb2185f005ad9193d32f7aaa62e00 100644 (file)
--- a/net.c
+++ b/net.c
@@ -757,6 +757,8 @@ static int tap_open(char *ifname, int ifname_size)
 #ifndef TAPGIFNAME
     char *dev;
     struct stat s;
+#else
+    struct ifreq ifr;
 #endif
 
     TFR(fd = open("/dev/tap", O_RDWR));
index 2fc49142d0eecff183cbaec13c6d1d9808243c24..8185e3fbe48094e217f8ef4de17dd1c0c20ec1c0 100644 (file)
--- a/sysemu.h
+++ b/sysemu.h
@@ -44,6 +44,10 @@ void do_loadvm(const char *name);
 void do_delvm(const char *name);
 void do_info_snapshots(void);
 
+#ifdef CONFIG_PASSTHROUGH
+int pci_emulation_add(char *config_text);
+#endif
+
 void qemu_announce_self(void);
 
 void main_loop_wait(int timeout);
index 52c5ac67ede1be9a2157347fc001ce9e3859b195..5b257e7b8268c11432901b494ee119343a9a3b5f 100644 (file)
@@ -8,8 +8,8 @@
 #include <sys/time.h>
 
 #include <assert.h>
+#include <hw/xen_blktap.h>
 
-extern int init_blktap(void);
 extern void qemu_aio_init(void);
 extern void qemu_aio_poll(void);
 extern void bdrv_init(void);
diff --git a/vl.c b/vl.c
index 9b9f7d5165ef755aba954fcbdd0bc2153fc6924a..3a130d1ee0c4e43db9fb4cfde30da538ea76fb97 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -5894,12 +5894,14 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
+#ifdef CONFIG_PASSTHROUGH
     for (i = 0; i < nb_pci_emulation; i++) {
-        if(pci_emulation_add(pci_emulation_config_text[i]) < 0) {
+        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
             fprintf(stderr, "Warning: could not add PCI device %s\n",
                     pci_emulation_config_text[i]);
         }
     }
+#endif
 
     if (strlen(direct_pci_str) > 0)
         direct_pci = direct_pci_str;
index 6f7b95fef95db86293c834cadce3626bdcb52d72..8e449a8b670cf6fd8fc04812efb22d123ed28648 100644 (file)
@@ -7,7 +7,7 @@
 /* There is no need for multiple-inclusion protection since
  * there is only one place where this file is included. */
 
-
+#include "sysemu.h"
 
 /* Max number of PCI emulation */
 #define MAX_PCI_EMULATION 32
@@ -134,7 +134,7 @@ void do_pci_add(char *devname)
 }
 #endif
 
-static int pci_emulation_add(char *config_text)
+int pci_emulation_add(char *config_text)
 {
     PCI_EMULATION_INFO *new;
     if ((new = qemu_mallocz(sizeof(PCI_EMULATION_INFO))) == NULL) {
index 92ee1e21ff2d644d6f2800f16134b931e46e80e9..7115c6b1425cefdc8345f6476eb274b043b48032 100644 (file)
@@ -247,7 +247,7 @@ static void xenstore_get_backend_path(char **backend, const char *devtype,
     free(frontend_doublecheck);
 }
 
-const char *xenstore_get_guest_uuid(void)
+static const char *xenstore_get_guest_uuid(void)
 {
     static char *already_computed = NULL;
 
@@ -646,7 +646,7 @@ int xenstore_fd(void)
     return -1;
 }
 
-void xenstore_process_logdirty_event(void)
+static void xenstore_process_logdirty_event(void)
 {
     char *act;
     static char *active_path = NULL;
@@ -1266,7 +1266,7 @@ char *xenstore_device_model_read(int domid, char *key, unsigned int *len)
     return value;
 }
 
-char *xenstore_extended_power_mgmt_read(const char *key, unsigned int *len)
+static char *xenstore_extended_power_mgmt_read(const char *key, unsigned int *len)
 {
     char *path = NULL, *value = NULL;
     
@@ -1281,7 +1281,7 @@ char *xenstore_extended_power_mgmt_read(const char *key, unsigned int *len)
     return value;
 }
 
-int xenstore_extended_power_mgmt_write(const char *key, const char *value)
+static int xenstore_extended_power_mgmt_write(const char *key, const char *value)
 {
     int ret;
     char *path = NULL;
@@ -1294,7 +1294,8 @@ int xenstore_extended_power_mgmt_write(const char *key, const char *value)
     return ret;
 }
 
-int xenstore_extended_power_mgmt_event_trigger(const char *key, const char *value)
+static int
+xenstore_extended_power_mgmt_event_trigger(const char *key, const char *value)
 {
     int ret;
     char *path = NULL;