]> git.proxmox.com Git - qemu.git/log
qemu.git
14 years agovl.c: Remove double include of netinet/in.h for Solaris
Jes Sorensen [Thu, 10 Jun 2010 09:42:15 +0000 (11:42 +0200)]
vl.c: Remove double include of netinet/in.h for Solaris

vl.c: netinet/in.h is already included once above for the

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Andreas Faerber <afaerber@opensolaris.org>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Richard Henderson <rth@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoNEON vldN optimization
Paul Brook [Fri, 11 Jun 2010 19:01:00 +0000 (20:01 +0100)]
NEON vldN optimization

When combining multiple values as part of a NEON array load, do explcit
shift/or rather than using gen_bfi.  This voids redundant mask
operations.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agohxtool: Fix line number reporting on SQMP/EQMP errors
Jan Kiszka [Wed, 2 Jun 2010 07:06:03 +0000 (09:06 +0200)]
hxtool: Fix line number reporting on SQMP/EQMP errors

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoremove unnecessary lookaheads
Paolo Bonzini [Mon, 24 May 2010 07:39:53 +0000 (09:39 +0200)]
remove unnecessary lookaheads

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoimplement optional lookahead in json lexer
Paolo Bonzini [Mon, 24 May 2010 07:39:52 +0000 (09:39 +0200)]
implement optional lookahead in json lexer

Not requiring one extra character when lookahead is not necessary
ensures that clients behave properly even if they, for example,
send QMP requests without a trailing newline.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoadd some tests for invalid JSON
Paolo Bonzini [Mon, 24 May 2010 07:39:51 +0000 (09:39 +0200)]
add some tests for invalid JSON

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agojson-streamer: Don't use qdict_put_obj()
Luiz Capitulino [Wed, 19 May 2010 20:17:05 +0000 (17:17 -0300)]
json-streamer: Don't use qdict_put_obj()

It's not needed, use qobject_put() instead and get a cleaner code.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agojson-lexer: Drop 'buf'
Luiz Capitulino [Mon, 17 May 2010 20:59:00 +0000 (17:59 -0300)]
json-lexer: Drop 'buf'

QString supports adding a single char, 'buf' is unneeded.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agocheck-qjson: Add more escape tests
Luiz Capitulino [Wed, 19 May 2010 20:08:37 +0000 (17:08 -0300)]
check-qjson: Add more escape tests

While there make the fail_unless() calls print error messages.

IMPORTANT: The test for "\/" is failing, don't know why.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoqjson: Handle "\f"
Luiz Capitulino [Wed, 19 May 2010 20:06:15 +0000 (17:06 -0300)]
qjson: Handle "\f"

It's valid JSON and should be handled.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agojson-lexer: Handle missing escapes
Luiz Capitulino [Wed, 19 May 2010 19:57:28 +0000 (16:57 -0300)]
json-lexer: Handle missing escapes

The JSON escape sequence "\/" and "\\" are valid and should be
handled.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agojson-lexer: Initialize 'x' and 'y'
Luiz Capitulino [Mon, 17 May 2010 20:50:01 +0000 (17:50 -0300)]
json-lexer: Initialize 'x' and 'y'

The 'lexer' variable is passed by the caller, it can contain anything
(eg. garbage).

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agotcg: fix DEF macro after commit c61aaf7a388c4ad95d8b546fdb9267dc01183317
Aurelien Jarno [Fri, 11 Jun 2010 16:39:47 +0000 (18:39 +0200)]
tcg: fix DEF macro after commit c61aaf7a388c4ad95d8b546fdb9267dc01183317

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-s390: Adjust compilation flags.
Richard Henderson [Fri, 4 Jun 2010 19:14:09 +0000 (12:14 -0700)]
tcg-s390: Adjust compilation flags.

Force -m31/-m64 based on s390/s390x target.

Force -march=z990.  The TCG backend will always require the
long-displacement facility, so the compiler may as well make
use of that as well.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-s390: Compute is_write in cpu_signal_handler.
Richard Henderson [Fri, 4 Jun 2010 19:14:12 +0000 (12:14 -0700)]
tcg-s390: Compute is_write in cpu_signal_handler.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agos390x: Don't use a linker script for user-only.
Richard Henderson [Fri, 4 Jun 2010 19:14:11 +0000 (12:14 -0700)]
s390x: Don't use a linker script for user-only.

The default placement of the application at 0x80000000 is fine,
and will avoid the default placement for most other guests.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agos390x: Avoid _llseek.
Richard Henderson [Fri, 4 Jun 2010 19:14:10 +0000 (12:14 -0700)]
s390x: Avoid _llseek.

There's no _llseek on s390x either.  Replace the existing
test for __x86_64__ with a functional test for __NR_llseek.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-s390: Allocate the code_gen_buffer near the main program.
Richard Henderson [Fri, 4 Jun 2010 19:14:14 +0000 (12:14 -0700)]
tcg-s390: Allocate the code_gen_buffer near the main program.

This allows the use of direct calls to the helpers,
and a direct branch back to the epilogue.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-s390: Icache flush is a no-op.
Richard Henderson [Fri, 4 Jun 2010 19:14:13 +0000 (12:14 -0700)]
tcg-s390: Icache flush is a no-op.

Before gcc 4.2, __builtin___clear_cache doesn't exist, and
afterward the gcc s390 backend implements it as nothing.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: fix andi r, r, 0xff
Aurelien Jarno [Thu, 10 Jun 2010 18:52:47 +0000 (20:52 +0200)]
tcg-i386: fix andi r, r, 0xff

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: remove use of _Bool that slipped code review
Aurelien Jarno [Thu, 10 Jun 2010 18:40:24 +0000 (20:40 +0200)]
tcg-i386: remove use of _Bool that slipped code review

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoesp: lower IRQ on soft reset
Blue Swirl [Thu, 10 Jun 2010 17:57:39 +0000 (17:57 +0000)]
esp: lower IRQ on soft reset

42f1ced228c9b616cfa2b69846025271618e4ef5 removed irq lowering
during reset. However, for chip reset command and DMA reset signal,
its actually the correct thing to do.

Lower IRQ on soft reset only.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoqbus: fix memory leak in qbus_free()
Isaku Yamahata [Thu, 27 May 2010 05:35:58 +0000 (14:35 +0900)]
qbus: fix memory leak in qbus_free()

BusState::name is allocated in qbus_create_inplace().
So it should be freed by qbus_free().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomultiboot: compilation fix with DEBUG_MULTIBOOT enabled.
Isaku Yamahata [Thu, 27 May 2010 05:37:09 +0000 (14:37 +0900)]
multiboot: compilation fix with DEBUG_MULTIBOOT enabled.

This patch fixes the following compilation errors in multiboot.c
when DEBUG_MULTIBOOT is defined.
Use TARGET_FMT_plx instead of %x for target_phys_addr_t.

  CC    i386-softmmu/multiboot.o
cc1: warnings being treated as errors
qemu/hw/multiboot.c: In function 'mb_add_mod':
qemu/hw/multiboot.c:121: error: format '%08x' expects type 'unsigned int', but argument 4 has type 'target_phys_addr_t'
qemu/hw/multiboot.c:121: error: format '%08x' expects type 'unsigned int', but argument 5 has type 'target_phys_addr_t'
qemu/hw/multiboot.c: In function 'load_multiboot':
qemu/hw/multiboot.c:279: error: format '%#x' expects type 'unsigned int', but argument 5 has type 'target_phys_addr_t'
qemu/hw/multiboot.c:307: error: format '%x' expects type 'unsigned int', but argument 3 has type 'target_phys_addr_t'
qemu/hw/multiboot.c:308: error: format '%x' expects type 'unsigned int', but argument 3 has type 'target_phys_addr_t'
make[1]: *** [multiboot.o] Error 1

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovga-isa-mm: remove one #ifdef CONFIG_BOCHS_VBE.
Isaku Yamahata [Thu, 27 May 2010 05:37:53 +0000 (14:37 +0900)]
vga-isa-mm: remove one #ifdef CONFIG_BOCHS_VBE.

remove one #ifdef CONFIG_BOCHS_VBE.
Call vga_init_vbe() instead.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomain: allocate gui_timer only once.
Isaku Yamahata [Thu, 27 May 2010 05:38:47 +0000 (14:38 +0900)]
main: allocate gui_timer only once.

fix memory leak.
there is no need to allocate more than one gui_timer.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMerge remote branch 'mst/for_anthony' into staging
Anthony Liguori [Thu, 10 Jun 2010 14:21:43 +0000 (09:21 -0500)]
Merge remote branch 'mst/for_anthony' into staging

14 years agocris: Break out image loading to hw/cris-boot.c.
Edgar E. Iglesias [Thu, 10 Jun 2010 12:45:46 +0000 (14:45 +0200)]
cris: Break out image loading to hw/cris-boot.c.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
14 years agos390: Disassemble some general-instruction-extension insns.
Richard Henderson [Fri, 4 Jun 2010 19:14:17 +0000 (12:14 -0700)]
s390: Disassemble some general-instruction-extension insns.

The full general-instruction-extension facility was added to binutils
after the change to GPLv3.  This is not the entire extension, just
what we're using in TCG.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agos390: Update disassembler to the last GPLv2 from binutils.
Richard Henderson [Fri, 4 Jun 2010 19:14:16 +0000 (12:14 -0700)]
s390: Update disassembler to the last GPLv2 from binutils.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Merge 64-bit generation.
Richard Henderson [Fri, 4 Jun 2010 00:35:17 +0000 (17:35 -0700)]
tcg-i386: Merge 64-bit generation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: display sysconfdir in summary
Aurelien Jarno [Wed, 9 Jun 2010 22:14:02 +0000 (00:14 +0200)]
configure: display sysconfdir in summary

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agomove computation of tools and roms outside of config-host.mak generation
Paolo Bonzini [Wed, 26 May 2010 14:08:29 +0000 (16:08 +0200)]
move computation of tools and roms outside of config-host.mak generation

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: move directory defaults earlier
Paolo Bonzini [Wed, 26 May 2010 14:08:28 +0000 (16:08 +0200)]
configure: move directory defaults earlier

Unify with existing special-purpose configure code for win32.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: ignore unknown --xyzdir options
Paolo Bonzini [Wed, 26 May 2010 14:08:27 +0000 (16:08 +0200)]
configure: ignore unknown --xyzdir options

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: introduce more --xyzdir options
Paolo Bonzini [Wed, 26 May 2010 14:08:26 +0000 (16:08 +0200)]
configure: introduce more --xyzdir options

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: expand ${prefix} in create_config
Paolo Bonzini [Wed, 26 May 2010 14:08:25 +0000 (16:08 +0200)]
configure: expand ${prefix} in create_config

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: move all directory entries in config-host.mak close
Paolo Bonzini [Wed, 26 May 2010 14:08:24 +0000 (16:08 +0200)]
configure: move all directory entries in config-host.mak close

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: unify handling of xyzdir variables
Paolo Bonzini [Wed, 26 May 2010 14:08:23 +0000 (16:08 +0200)]
configure: unify handling of xyzdir variables

Making an xyzdir variable for each directory prepares for the next
patches introducing config-host.h defines and configure options for them.
It also fixes the problem where overriding prefix at "make install"
time did not override it for sysconfdir.

Removes some of the differences between sysconfdir and other variables,
the rest will go away later.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agorename CONFIG_QEMU_PREFIX
Paolo Bonzini [Wed, 26 May 2010 14:08:22 +0000 (16:08 +0200)]
rename CONFIG_QEMU_PREFIX

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: introduce confdir and confsuffix
Paolo Bonzini [Wed, 26 May 2010 14:08:21 +0000 (16:08 +0200)]
configure: introduce confdir and confsuffix

confsuffix was write-only, flesh it out.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: introduce sysconfsuffix
Paolo Bonzini [Wed, 26 May 2010 14:08:20 +0000 (16:08 +0200)]
configure: introduce sysconfsuffix

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: delete duplicate create_config case stanza
Paolo Bonzini [Wed, 26 May 2010 14:08:19 +0000 (16:08 +0200)]
configure: delete duplicate create_config case stanza

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: dyngen is long time gone
Paolo Bonzini [Wed, 26 May 2010 14:08:18 +0000 (16:08 +0200)]
configure: dyngen is long time gone

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: avoid using expr
Paolo Bonzini [Wed, 26 May 2010 14:08:17 +0000 (16:08 +0200)]
configure: avoid using expr

Just a personal preference against duplicating hieroglyphics.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: bail out early on invalid -cpu option
Paolo Bonzini [Wed, 26 May 2010 14:08:16 +0000 (16:08 +0200)]
configure: bail out early on invalid -cpu option

It would fail later anyway.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: remove some bashisms
Aurelien Jarno [Wed, 9 Jun 2010 22:06:55 +0000 (00:06 +0200)]
configure: remove some bashisms

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: Fix compilation
Stefan Weil [Wed, 9 Jun 2010 20:09:40 +0000 (22:09 +0200)]
target-mips: Fix compilation

TCGv t1 needs tcg_temp_free instead of tcg_temp_free_i32.

Cc: Nathan Froyd <froydnj@codesourcery.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw: honor low bit in mipssim machine
Nathan Froyd [Tue, 8 Jun 2010 20:30:03 +0000 (13:30 -0700)]
hw: honor low bit in mipssim machine

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: honor low bit of entry PC for MIPS
Nathan Froyd [Tue, 8 Jun 2010 20:30:02 +0000 (13:30 -0700)]
linux-user: honor low bit of entry PC for MIPS

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: add microMIPS exception handler support
Nathan Froyd [Tue, 8 Jun 2010 20:30:01 +0000 (13:30 -0700)]
target-mips: add microMIPS exception handler support

Unlike MIPS16, microMIPS lets you choose the ISA mode for your exception
handlers.  The ISA mode is selectable via a user-writable CP0.Config3
flag.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: microMIPS ASE support
Nathan Froyd [Tue, 8 Jun 2010 20:29:59 +0000 (13:29 -0700)]
target-mips: microMIPS ASE support

Add instruction decoding for the microMIPS ASE.  All we do is decode and
then forward to the existing gen_* routines.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: mips16 cleanups
Nathan Froyd [Tue, 8 Jun 2010 20:29:58 +0000 (13:29 -0700)]
target-mips: mips16 cleanups

Change code handling mips16-specific branches to use ISA-neutral special
opcodes.  Since there are several places where the delay slot
requirements for microMIPS branches differ from mips16 branches, using
opcodes is easier than checking hflags, then checking mips16
vs. microMIPS.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: refactor c{, abs}.cond.fmt insns
Nathan Froyd [Tue, 8 Jun 2010 20:29:57 +0000 (13:29 -0700)]
target-mips: refactor c{, abs}.cond.fmt insns

Move all knowledge about coprocessor-checking and register numbering
into the gen_cmp* helper functions.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: move FP FMT comments closer to the definitions
Aurelien Jarno [Wed, 9 Jun 2010 13:13:17 +0000 (15:13 +0200)]
target-mips: move FP FMT comments closer to the definitions

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: define constants for magic numbers
Nathan Froyd [Tue, 8 Jun 2010 20:29:56 +0000 (13:29 -0700)]
target-mips: define constants for magic numbers

Add FMT_* constants for the floating-point format field in opcodes and
tweak a few places to use them.  Add enums for various invocations of
FOP and tweak gen_farith and its lone caller accordingly.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: get rid of DEF2 in tcg-opc.h
Aurelien Jarno [Thu, 3 Jun 2010 17:40:04 +0000 (19:40 +0200)]
tcg: get rid of DEF2 in tcg-opc.h

Now that tcg-opc.h is only used in TCG code, get rid of DEF2 in
tcg-opc.h.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: get rid of copy_size in TCGOpDef
Aurelien Jarno [Thu, 3 Jun 2010 17:29:31 +0000 (19:29 +0200)]
tcg: get rid of copy_size in TCGOpDef

copy_size is a left-over from the dyngen era, remove it.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix multiboot compilation
Alexander Graf [Tue, 1 Jun 2010 23:56:50 +0000 (01:56 +0200)]
Fix multiboot compilation

Commit dd4239d6574ca41c94fc0d0f77ddc728510ffc57 broke multiboot. It replaced the
instruction "rep insb (%dx), %es:(%edi)" by the binary output of
"addr32 rep insb (%dx), %es:(%di)".

Linuxboot calls the respective helper function in a code16 section. So the
original instruction was automatically translated to its "addr32" equivalent.
For multiboot, we're running in code32 so gcc didn't add the "addr32" which
breaks the instruction.

This patch splits that helper function in one which uses addr32 and one which
does not, so everyone's happy.

The good news is that nobody probably cared so far. The bundled multiboot.bin
binary was built before the change and is thus correct.

Please also put this patch into -stable.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agonet: Fix hotplug with pci_add
Amit Shah [Tue, 8 Jun 2010 15:43:58 +0000 (21:13 +0530)]
net: Fix hotplug with pci_add

The correct model type wasn't getting added when hotplugging nics with
pci_add.

Testcase: start VM with default nic type. In the qemu_monitor:

(qemu) pci_add auto nic model=virtio

This results in a nic hot-plug of the same nic type as the default.

This was broken in 5294e2c774f120e10b44652ac143abda356f44eb

Also changes the behaviour where no .init is defined for a
net_client_type. Previously, 0 was returned, which indicated the init
was successful and that 0 was the index into the nd_tables[] array.
Return -1, indicating unsuccessful init, in such a case.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agotcg: Make some tcg-target.c routines static.
Richard Henderson [Thu, 3 Jun 2010 00:26:56 +0000 (17:26 -0700)]
tcg: Make some tcg-target.c routines static.

Both tcg_target_init and tcg_target_qemu_prologue
are unused outside of tcg.c.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Add TYPE parameter to tcg_out_mov.
Richard Henderson [Thu, 3 Jun 2010 00:26:55 +0000 (17:26 -0700)]
tcg: Add TYPE parameter to tcg_out_mov.

Mirror tcg_out_movi in having a TYPE parameter.  This allows x86_64
to perform the move at the proper width, which may elide a REX prefix.

Introduce a TCG_TYPE_REG enumerator to represent the "native width"
of the host register, and to distinguish the usage from "pointer data"
as represented by the existing TCG_TYPE_PTR.

Update all targets to match.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: break out [ls][wd]c1 and rdhwr insn generation
Nathan Froyd [Mon, 24 May 2010 16:19:35 +0000 (09:19 -0700)]
target-mips: break out [ls][wd]c1 and rdhwr insn generation

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix --enable-user-pie compilation.
Richard Henderson [Fri, 21 May 2010 17:04:46 +0000 (10:04 -0700)]
Fix --enable-user-pie compilation.

We forgot to propagate -fpie to the libdis-user directory.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agovirtio-net: truncating packet
Michael S. Tsirkin [Sun, 6 Jun 2010 15:53:10 +0000 (18:53 +0300)]
virtio-net: truncating packet

virtio net attempts to peek into virtio queue to
determine that we have enough space for the complete
packet to fit. However, it fails to account for space
consumed by virtio net header when it does this,
under stress this results in a failure
with the message 'truncating packet'.

redhat bz 591494.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agomicroblaze: Make MSR_UM and MSR_VM part of the tb flags
Edgar E. Iglesias [Mon, 7 Jun 2010 09:54:27 +0000 (11:54 +0200)]
microblaze: Make MSR_UM and MSR_VM part of the tb flags

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
14 years agopetlogix-3adsp: Tweak displacement of cmdline and fdt blob.
Edgar E. Iglesias [Mon, 7 Jun 2010 09:53:09 +0000 (11:53 +0200)]
petlogix-3adsp: Tweak displacement of cmdline and fdt blob.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
14 years agomigration-exec: fix OpenBSD build warning
Blue Swirl [Fri, 4 Jun 2010 20:01:07 +0000 (20:01 +0000)]
migration-exec: fix OpenBSD build warning

Add include directives to get WIFEXITED() and WEXITSTATUS() macros defined.

Fixes warnings:
  CC    migration-exec.o
/src/qemu/migration-exec.c: In function `exec_close':
/src/qemu/migration-exec.c:53: warning: implicit declaration of function `WIFEXITED'
/src/qemu/migration-exec.c:54: warning: implicit declaration of function `WEXITSTATUS'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-i386: fix decoding of negative 4-byte displacements
Paolo Bonzini [Fri, 4 Jun 2010 14:27:33 +0000 (16:27 +0200)]
target-i386: fix decoding of negative 4-byte displacements

Negative four byte displacements need to be sign-extended after
c086b783eb7a578993d6d2ab62c4c2666800b63d.  Do so.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoblock: Fix serial number assignment
Luiz Capitulino [Wed, 2 Jun 2010 20:46:31 +0000 (17:46 -0300)]
block: Fix serial number assignment

We should use 'dinfo->serial' length, 'serial' is a pointer, so
the serial number length is currently limited to the pointer size.

This fixes https://bugs.launchpad.net/qemu/+bug/584143 and is also
valid for stable.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblockdev: Collect block device code in new blockdev.c
Markus Armbruster [Wed, 2 Jun 2010 16:48:27 +0000 (18:48 +0200)]
blockdev: Collect block device code in new blockdev.c

Anything that moves hundreds of lines out of vl.c can't be all bad.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoqdev: Move declaration of qdev_init_bdrv() into qdev.h
Markus Armbruster [Wed, 2 Jun 2010 11:31:56 +0000 (13:31 +0200)]
qdev: Move declaration of qdev_init_bdrv() into qdev.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblockdev: Hide QEMUMachine from drive_init()
Markus Armbruster [Wed, 2 Jun 2010 11:31:55 +0000 (13:31 +0200)]
blockdev: Hide QEMUMachine from drive_init()

To pave the way for moving it out of vl.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: call the snapshot handlers of the protocol drivers
MORITA Kazutaka [Fri, 28 May 2010 02:44:58 +0000 (11:44 +0900)]
block: call the snapshot handlers of the protocol drivers

When snapshot handlers are not defined in the format driver, it is
better to call the ones of the protocol driver.  This enables us to
implement snapshot support in the protocol driver.

We need to call bdrv_close() and bdrv_open() handlers of the format
driver before and after bdrv_snapshot_goto() call of the protocol.  It is
because the contents of the block driver state may need to be changed
after loading vmstate.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoclose all the block drivers before the qemu process exits
MORITA Kazutaka [Fri, 28 May 2010 02:44:57 +0000 (11:44 +0900)]
close all the block drivers before the qemu process exits

This patch calls the close handler of the block driver before the qemu
process exits.

This is necessary because the sheepdog block driver releases the lock
of VM images in the close handler.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Assume raw for drives without media
Kevin Wolf [Tue, 1 Jun 2010 16:37:31 +0000 (18:37 +0200)]
block: Assume raw for drives without media

qemu -cdrom /dev/cdrom with an empty CD-ROM drive doesn't work any more because
we try to guess the format and when this fails (because there is no medium) we
exit with an error message.

This patch should restore the old behaviour by assuming raw format for such
drives.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoFix error message in drive_init
Kevin Wolf [Tue, 1 Jun 2010 11:20:57 +0000 (13:20 +0200)]
Fix error message in drive_init

The real error is the return value of bdrv_open. errno might be overwritten or
not even set to that value in the first place.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoscsi: Fix info qtree for scsi-disk.ver
Markus Armbruster [Tue, 1 Jun 2010 18:32:35 +0000 (20:32 +0200)]
scsi: Fix info qtree for scsi-disk.ver

Show the actual default value instead of <null> when the property has
not been set.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoscsi: Turn drive serial into a qdev property scsi-disk.serial
Markus Armbruster [Tue, 1 Jun 2010 18:32:34 +0000 (20:32 +0200)]
scsi: Turn drive serial into a qdev property scsi-disk.serial

It needs to be a qdev property, because it belongs to the drive's
guest part.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Fix info qtree for ide-drive.ver
Markus Armbruster [Tue, 1 Jun 2010 18:32:33 +0000 (20:32 +0200)]
ide: Fix info qtree for ide-drive.ver

Show the actual default value instead of <null> when the property has
not been set.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Turn drive serial into a qdev property ide-drive.serial
Markus Armbruster [Tue, 1 Jun 2010 18:32:32 +0000 (20:32 +0200)]
ide: Turn drive serial into a qdev property ide-drive.serial

It needs to be a qdev property, because it belongs to the drive's
guest part.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoqdev: Don't leak string property value on hot unplug
Markus Armbruster [Tue, 1 Jun 2010 18:32:31 +0000 (20:32 +0200)]
qdev: Don't leak string property value on hot unplug

parse_string() qemu_strdup()s the property value.  It is never freed.
It needs to be freed along with the device.  Otherwise, the value of
scsi-disk property "ver" gets leaked when hot-unplugging the disk, for
instance.

Call new PropertyInfo method free() from qdev_free().  Implement it
for qdev_prop_string.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoqdev: New qdev_prop_set_string()
Markus Armbruster [Tue, 1 Jun 2010 18:32:30 +0000 (20:32 +0200)]
qdev: New qdev_prop_set_string()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Split non-qdev code off ide_init2()
Markus Armbruster [Tue, 1 Jun 2010 18:32:29 +0000 (20:32 +0200)]
ide: Split non-qdev code off ide_init2()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Change ide_init_drive() to require valid dinfo argument
Markus Armbruster [Tue, 1 Jun 2010 18:32:28 +0000 (20:32 +0200)]
ide: Change ide_init_drive() to require valid dinfo argument

IDEState members drive_serial_str and version are now left empty until
an actual drive is connected.  Before, they got a default value that
was overwritten when a drive got connected.  Doesn't matter, because
they're used only while a drive is connected.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Split ide_init1() off ide_init2()
Markus Armbruster [Fri, 28 May 2010 13:38:47 +0000 (15:38 +0200)]
ide: Split ide_init1() off ide_init2()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Remove redundant IDEState member conf
Markus Armbruster [Fri, 28 May 2010 13:38:46 +0000 (15:38 +0200)]
ide: Remove redundant IDEState member conf

Commit 428c149b added IDEState member conf to let commit 0009baf1 find
the BlockConf from there.  It exists only for qdev drives, created via
ide_drive_initfn(), not for drives created via ide_init2().

But for a qdev drive, we can just as well reach its IDEDevice, which
contains the BlockConf.  Do that, and revert the parts of commit
428c149b that add IDEState member conf.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Remove useless IDEDeviceInfo members unit, drive
Markus Armbruster [Fri, 28 May 2010 13:38:45 +0000 (15:38 +0200)]
ide: Remove useless IDEDeviceInfo members unit, drive

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agousb: Remove unused usb_device_add() parameter is_hotplug
Markus Armbruster [Fri, 28 May 2010 13:38:44 +0000 (15:38 +0200)]
usb: Remove unused usb_device_add() parameter is_hotplug

Unused since commit b3e461d3.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblockdev: Belatedly remove driveopts
Markus Armbruster [Fri, 28 May 2010 13:38:43 +0000 (15:38 +0200)]
blockdev: Belatedly remove driveopts

Unused since commit 9dfd7c7a.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblockdev: Belatedly remove MAX_DRIVES
Markus Armbruster [Fri, 28 May 2010 13:38:42 +0000 (15:38 +0200)]
blockdev: Belatedly remove MAX_DRIVES

Unused since commit 751c6a17.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoqemu-io: Fix error messages
Kevin Wolf [Fri, 28 May 2010 18:10:48 +0000 (20:10 +0200)]
qemu-io: Fix error messages

The truncate and getlength commands passed a negative error number to strerror.
They also happen to be the two functions that are lacking a newline at the end
of their error message.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoCleanup: virtio-blk.c: Be more consistent using BDRV_SECTOR_SIZE instead
Jes Sorensen [Thu, 27 May 2010 14:20:33 +0000 (16:20 +0200)]
Cleanup: virtio-blk.c: Be more consistent using BDRV_SECTOR_SIZE instead

Clean up virtio-blk.c to be more consistent using BDRV_SECTOR_SIZE
instead of hard coded 512 values.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoCleanup: raw-posix.c: Be more consistent using BDRV_SECTOR_SIZE instead of 512
Jes Sorensen [Thu, 27 May 2010 14:20:32 +0000 (16:20 +0200)]
Cleanup: raw-posix.c: Be more consistent using BDRV_SECTOR_SIZE instead of 512

Clean up raw-posix.c to be more consistent using BDRV_SECTOR_SIZE
instead of hard coded 512 values.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoCleanup: Be consistent and use BDRV_SECTOR_SIZE instead of 512
Jes Sorensen [Thu, 27 May 2010 14:20:31 +0000 (16:20 +0200)]
Cleanup: Be consistent and use BDRV_SECTOR_SIZE instead of 512

Clean up block.c and use BDRV_SECTOR_SIZE rather than hard coded
numbers (512) when referring to sector size throughout the code.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoCleanup: bdrv_open() no need to shift total_size just to shift back.
Jes Sorensen [Thu, 27 May 2010 14:20:30 +0000 (16:20 +0200)]
Cleanup: bdrv_open() no need to shift total_size just to shift back.

In bdrv_open() there is no need to shift total_size >> 9 just to
multiply it by 512 again just a few lines later, since this is the
only place the variable is used.

Mask with BDRV_SECTOR_MASK to protect against case where we are
passed a corrupted image.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Thu, 3 Jun 2010 19:55:49 +0000 (14:55 -0500)]
Merge remote branch 'kwolf/for-anthony' into staging

14 years agomigration: respect exit status with exec:
Anthony Liguori [Wed, 2 Jun 2010 19:55:25 +0000 (14:55 -0500)]
migration: respect exit status with exec:

This patch makes sure that if the exec: process exits with a non-zero return
status, we treat the migration as failed.

This fixes https://bugs.launchpad.net/qemu/+bug/391879

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotcg-i386: fix a typo
Aurelien Jarno [Wed, 2 Jun 2010 22:02:30 +0000 (00:02 +0200)]
tcg-i386: fix a typo

Fix a typo introduced by c28b14c694d759f39fe3ae4f8d03b567da5b93f8.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: declare tcg_out_tlb_load() inline
Aurelien Jarno [Tue, 1 Jun 2010 11:55:18 +0000 (13:55 +0200)]
tcg-i386: declare tcg_out_tlb_load() inline

Declare tcg_out_tlb_load() inline so that we don't loose optimisations
with commit 8516a04467cb7954cdc32e8b79b4b7df56dccb16.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>