From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: [PATCH v2] kvm-userspace: Fix kvm-originated warnings
Date: Fri, 06 Feb 2009 18:43:11 +0100 [thread overview]
Message-ID: <498C76AF.3090306@siemens.com> (raw)
[ New version, fixing another brand-new warning. Again, if something
should be split out into a separate patch, just let me know. ]
This patch kills the last warnings (caused by kvm changes) that I see on
a x86-64 host when building x86_64-softmmu and also i386-softmmu without
kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
qemu/block-raw-posix.c | 1 -
qemu/block.c | 10 ----------
qemu/hw/extboot.c | 2 +-
qemu/kvm-tpr-opt.c | 2 +-
qemu/net.c | 2 +-
qemu/qemu-kvm.c | 11 ++++++-----
qemu/target-i386/cpu.h | 2 +-
qemu/vl.c | 7 ++++---
user/test/x86/access.c | 4 ++--
user/test/x86/emulator.c | 1 -
user/test/x86/vmexit.c | 2 +-
11 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/qemu/block-raw-posix.c b/qemu/block-raw-posix.c
index 50685b6..8ab27d8 100644
--- a/qemu/block-raw-posix.c
+++ b/qemu/block-raw-posix.c
@@ -527,7 +527,6 @@ static int posix_aio_init(void)
{
sigset_t mask;
PosixAioState *s;
- int fds[2];
struct qemu_paioinit ai;
if (posix_aio_state)
diff --git a/qemu/block.c b/qemu/block.c
index f6a1180..453e77c 100644
--- a/qemu/block.c
+++ b/qemu/block.c
@@ -1005,16 +1005,6 @@ void bdrv_flush(BlockDriverState *bs)
bdrv_flush(bs->backing_hd);
}
-void bdrv_iterate_writeable(void (*it)(BlockDriverState *bs))
-{
- BlockDriverState *bs;
-
- for (bs = bdrv_first; bs != NULL; bs = bs->next)
- if (bs->drv && !bdrv_is_read_only(bs) &&
- (!bdrv_is_removable(bs) || bdrv_is_inserted(bs)))
- it(bs);
-}
-
void bdrv_flush_all(void)
{
BlockDriverState *bs;
diff --git a/qemu/hw/extboot.c b/qemu/hw/extboot.c
index 056fb59..ada0fdd 100644
--- a/qemu/hw/extboot.c
+++ b/qemu/hw/extboot.c
@@ -76,7 +76,7 @@ static void extboot_write_cmd(void *opaque, uint32_t addr, uint32_t value)
union extboot_cmd *cmd = (void *)(phys_ram_base + ((value & 0xFFFF) << 4));
BlockDriverState *bs = opaque;
int cylinders, heads, sectors, err;
- int64_t nb_sectors;
+ uint64_t nb_sectors;
get_translated_chs(bs, &cylinders, &heads, §ors);
diff --git a/qemu/kvm-tpr-opt.c b/qemu/kvm-tpr-opt.c
index 44b453f..246e08d 100644
--- a/qemu/kvm-tpr-opt.c
+++ b/qemu/kvm-tpr-opt.c
@@ -112,7 +112,7 @@ static struct vapic_bios vapic_bios;
static uint32_t real_tpr;
static uint32_t bios_addr;
static uint32_t vapic_phys;
-static int bios_enabled;
+static uint32_t bios_enabled;
static uint32_t vbios_desc_phys;
static void update_vbios_real_tpr(void)
diff --git a/qemu/net.c b/qemu/net.c
index b4c92da..4b0bc0b 100644
--- a/qemu/net.c
+++ b/qemu/net.c
@@ -767,7 +767,7 @@ static int tap_can_send(void *opaque)
static int tap_send_packet(TAPState *s)
{
- uint8_t *buf = s->buf;
+ uint8_t *buf = (uint8_t *)s->buf;
int size = s->size;
#ifdef IFF_VNET_HDR
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 97f4a81..0317ea6 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -102,12 +102,12 @@ static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
static void inject_interrupt(void *data)
{
- cpu_interrupt(current_env, (int)data);
+ cpu_interrupt(current_env, (long)data);
}
void kvm_inject_interrupt(CPUState *env, int mask)
{
- on_vcpu(env, inject_interrupt, (void *)mask);
+ on_vcpu(env, inject_interrupt, (void *)(long)mask);
}
void kvm_update_interrupt_request(CPUState *env)
@@ -319,7 +319,7 @@ static void resume_all_threads(void)
}
}
-static void kvm_vm_state_change_handler(void *context, int running)
+static void kvm_vm_state_change_handler(void *context, int running, int reason)
{
if (running)
resume_all_threads();
@@ -616,7 +616,8 @@ int kvm_main_loop(void)
}
#ifdef KVM_CAP_SET_GUEST_DEBUG
-int kvm_debug(void *opaque, void *data, struct kvm_debug_exit_arch *arch_info)
+static int kvm_debug(void *opaque, void *data,
+ struct kvm_debug_exit_arch *arch_info)
{
int handle = kvm_arch_debug(arch_info);
struct CPUState *env = data;
@@ -1006,7 +1007,7 @@ struct kvm_set_guest_debug_data {
int err;
};
-void kvm_invoke_set_guest_debug(void *data)
+static void kvm_invoke_set_guest_debug(void *data)
{
struct kvm_set_guest_debug_data *dbg_data = data;
diff --git a/qemu/target-i386/cpu.h b/qemu/target-i386/cpu.h
index 28c86e5..1338f5c 100644
--- a/qemu/target-i386/cpu.h
+++ b/qemu/target-i386/cpu.h
@@ -670,7 +670,7 @@ typedef struct CPUX86State {
/* in order to simplify APIC support, we leave this pointer to the
user */
struct APICState *apic_state;
- int mp_state;
+ uint32_t mp_state;
} CPUX86State;
CPUX86State *cpu_x86_init(const char *cpu_model);
diff --git a/qemu/vl.c b/qemu/vl.c
index 93ed5fe..0ba9ef5 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -4725,7 +4725,7 @@ void qemu_get_launch_info(int *argc, char ***argv, int *opt_daemonize, const cha
*opt_incoming = incoming;
}
-
+#ifdef USE_KVM
static int gethugepagesize(void)
{
int ret, fd;
@@ -4812,13 +4812,14 @@ static void *alloc_mem_area(size_t memory, unsigned long *len, const char *path)
*len = memory;
return area;
}
+#endif
static void *qemu_alloc_physram(unsigned long memory)
{
void *area = NULL;
+#ifdef USE_KVM
unsigned long map_len = memory;
-#ifdef USE_KVM
if (mem_path)
area = alloc_mem_area(memory, &map_len, mem_path);
#endif
@@ -5670,7 +5671,7 @@ int main(int argc, char **argv, char **envp)
}
#endif
-#if USE_KVM
+#ifdef USE_KVM
if (kvm_enabled()) {
if (kvm_qemu_init() < 0) {
fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
diff --git a/user/test/x86/access.c b/user/test/x86/access.c
index 0e61597..49f74b3 100644
--- a/user/test/x86/access.c
+++ b/user/test/x86/access.c
@@ -551,7 +551,7 @@ int ac_test_exec(ac_test_t *at)
return r;
}
-int ac_test_run()
+int ac_test_run(void)
{
static ac_test_t at;
int tests, successes;
@@ -574,7 +574,7 @@ int main()
int r;
printf("starting test\n\n");
- smp_init(ac_test_run);
+ smp_init((void(*)(void))ac_test_run);
r = ac_test_run();
return r ? 0 : 1;
}
diff --git a/user/test/x86/emulator.c b/user/test/x86/emulator.c
index bbe55a7..c6adbb5 100644
--- a/user/test/x86/emulator.c
+++ b/user/test/x86/emulator.c
@@ -134,7 +134,6 @@ void test_pop(void *mem)
{
unsigned long tmp;
unsigned long *stack_top = mem + 4096;
- unsigned long *new_stack_top;
unsigned long memw = 0x123456789abcdeful;
static unsigned long tmp2;
diff --git a/user/test/x86/vmexit.c b/user/test/x86/vmexit.c
index 0662f34..bd57bfa 100644
--- a/user/test/x86/vmexit.c
+++ b/user/test/x86/vmexit.c
@@ -1,5 +1,5 @@
-#include "printf.h"
+#include "libcflat.h"
static inline unsigned long long rdtsc()
{
next reply other threads:[~2009-02-06 17:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-06 17:43 Jan Kiszka [this message]
2009-02-06 17:55 ` [PATCH] libkvm: Fix return of kvm_commit_irq_routes Jan Kiszka
2009-02-08 9:55 ` Avi Kivity
2009-02-08 9:59 ` [PATCH v2] kvm-userspace: Fix kvm-originated warnings Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=498C76AF.3090306@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.