]> git.proxmox.com Git - qemu.git/log
qemu.git
14 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 24 May 2010 15:53:41 +0000 (10:53 -0500)]
Merge remote branch 'kwolf/for-anthony' into staging

14 years agoMerge remote branch 'qmp/for-anthony' into staging
Anthony Liguori [Mon, 24 May 2010 14:00:24 +0000 (09:00 -0500)]
Merge remote branch 'qmp/for-anthony' into staging

14 years agomicroblaze: Handle new elf mach nr for sysemu.
Edgar E. Iglesias [Mon, 24 May 2010 09:14:04 +0000 (11:14 +0200)]
microblaze: Handle new elf mach nr for sysemu.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agolsi: Fix value overflow in request tag processing
Jan Kiszka [Fri, 21 May 2010 16:44:59 +0000 (18:44 +0200)]
lsi: Fix value overflow in request tag processing

This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong
patch version): We need to mask the tag value properly to obtain its
device ID.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agosparc64: flush translations on mmu context change
Igor V. Kovalenko [Sat, 22 May 2010 10:52:40 +0000 (14:52 +0400)]
sparc64: flush translations on mmu context change

- two pairs of softmmu indexes bind softmmu tlb to cpu tlb in fault handlers
  using value of DMMU primary and secondary context registers, so we need to
  flush softmmu translations when context registers are changed

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: fix mmu context at trap levels above zero
Igor V. Kovalenko [Sat, 22 May 2010 10:52:35 +0000 (14:52 +0400)]
sparc64: fix mmu context at trap levels above zero

- cpu_mmu_index return MMU_NUCLEUS_IDX if trap level is not zero
- cpu_get_tb_cpu_state: store trap level and primary context in flags
  this allows to restart code translation when address translation is changed
- stop translation block after writing to pstate and tl registers
- stop translation block after writing to alternate space
  this can be optimized to stop only if address translation can be changed
  by write operation (e.g. by comparing with MMU ASI values)

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: fix dump_mmu to look for global bit in tte value instead of tag
Igor V. Kovalenko [Sat, 22 May 2010 10:52:29 +0000 (14:52 +0400)]
sparc64: fix dump_mmu to look for global bit in tte value instead of tag

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: fix pstate privilege bits
Igor V. Kovalenko [Sat, 22 May 2010 10:52:24 +0000 (14:52 +0400)]
sparc64: fix pstate privilege bits

- refactor code to handle hpstate only if available for current cpu
- conditionally set hypervisor bit in hpstate register
- reorder softmmu indices so user accessable ones go first, translation context
  macros supervisor() and hypervisor() adjusted as well
- disable sparcv8 registers for TARGET_SPARC64
- fix cpu_mmu_index to use sparcv9 bits only

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: generate data access exception on RW violation
Igor V. Kovalenko [Sat, 22 May 2010 10:52:19 +0000 (14:52 +0400)]
sparc64: generate data access exception on RW violation

- separate PRIV and PROT handling
- DPRINTF_MMU macro to clean up debug code
- dump mmu_idx, trap level and mmu context registers
  along with address translation values

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc32 protect read-only bits in DMA CSR registers
Artyom Tarasenko [Sat, 22 May 2010 08:38:56 +0000 (10:38 +0200)]
sparc32 protect read-only bits in DMA CSR registers

On a real hardware changing read-only bits has no effect
Use a mask common for SCSI and Ethernet registers. The crucial
bit is DMA_INTR, because setting or clearing it may produce
spurious interrupts.

This patch allows booting Solaris 2.3

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovmstate: fix breakage by 7e72abc382b700a72549e8147bdea413534eeedc
TeLeMan [Wed, 12 May 2010 02:28:51 +0000 (10:28 +0800)]
vmstate: fix breakage by 7e72abc382b700a72549e8147bdea413534eeedc

cirrus_post_load() will be executed twice when loading vm states and then the
wrong physical memory will be registered. This issue may lead to crash qemu.

Signed-off-by: TeLeMan <geleman@gmail.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix -device help and documentation
Markus Armbruster [Tue, 11 May 2010 12:02:31 +0000 (14:02 +0200)]
Fix -device help and documentation

Commit 6616b2ad reverted commit 40ea285c.  Looks like a mismerge to
me.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix tarbin Makefile rule
Stuart Brady [Wed, 12 May 2010 19:42:04 +0000 (20:42 +0100)]
Fix tarbin Makefile rule

The 'tarbin' Makefile rule doesn't include qemu-system-sparc64, but
should do, now that sparc64-softmmu is in the default target list.

The rule attempts to tar up binaries that were not built if a target
list was passed to the configure script -- in which case, it will
either fail, or otherwise include binaries from previous builds.

Fix both problems once and for all by building a list of binaries to
include in the tarball, using the list of targets to be built.

Signed-off-by: Stuart Brady <sdb@zubnet.me.uk>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agohxtool: Add syntax error detection
Jan Kiszka [Thu, 20 May 2010 07:16:33 +0000 (09:16 +0200)]
hxtool: Add syntax error detection

Add basic imbalance detection for STEXT/ETEXI.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix TEXI section mark imbalance in qemu-img-cmd.hx
Jan Kiszka [Thu, 20 May 2010 07:16:30 +0000 (09:16 +0200)]
Fix TEXI section mark imbalance in qemu-img-cmd.hx

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoPut dependency files in proper subdir
Jan Kiszka [Sat, 15 May 2010 11:03:28 +0000 (13:03 +0200)]
Put dependency files in proper subdir

This seems to resolve subtle breakages of our build system:

Dependency files generated for targets like 'dir/foo.o' were saved as
'foo.d'. Now, if there was also a target 'foo.o', one of the dependency
file was overwritten. Concrete example: libhw*/macio.o vs.
libhw*/ide/macio.o. And this often left a segfaulting build result
behind when changing the "wrong" data structures".

Fix it by generating proper 'dir/foo.d'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoClean libhw subdirs as well
Jan Kiszka [Sat, 15 May 2010 11:03:30 +0000 (13:03 +0200)]
Clean libhw subdirs as well

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix %lld or %llx printf format use
Blue Swirl [Sat, 22 May 2010 08:02:12 +0000 (08:02 +0000)]
Fix %lld or %llx printf format use

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile dma only once
Blue Swirl [Sat, 22 May 2010 08:00:52 +0000 (08:00 +0000)]
Compile dma only once

Use a qemu_irq to request CPU exit.

7 compilations less for the full build.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopckbd: improve debugging
Blue Swirl [Sat, 22 May 2010 07:59:06 +0000 (07:59 +0000)]
pckbd: improve debugging

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile pckbd only once
Blue Swirl [Sat, 22 May 2010 07:59:01 +0000 (07:59 +0000)]
Compile pckbd only once

Use a qemu_irq to indicate A20 line changes. Move I/O port 92
to pckbd.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agolinux-user: do not warn for missing pselect6
Riku Voipio [Fri, 7 May 2010 12:28:05 +0000 (12:28 +0000)]
linux-user: do not warn for missing pselect6

Libc will fallback gracefully if pselect6 is not available. Thus put
pselect6 to nowarn until the atomicity issues of the original pselect6
patch are dealt with.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Cc: Michael Casadevall <mcasadevall@ubuntu.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-ia64: Load GUEST_BASE into a register.
Richard Henderson [Thu, 6 May 2010 15:50:44 +0000 (08:50 -0700)]
tcg-ia64: Load GUEST_BASE into a register.

Saves one bundle per memory operation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-ia64: Fix some register usage issues.
Richard Henderson [Thu, 6 May 2010 15:50:43 +0000 (08:50 -0700)]
tcg-ia64: Fix some register usage issues.

(1) The output registers were not marked call-clobbered, even though
    they can be modified by called functions.
(2) The thread pointer was not marked reserved.
(3) R4-R6 are call-saved, but not saved by the prologue.  Rather than
    save them, mark them reserved so that we don't use them.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-hppa: Load GUEST_BASE as an immediate.
Richard Henderson [Thu, 6 May 2010 15:50:42 +0000 (08:50 -0700)]
tcg-hppa: Load GUEST_BASE as an immediate.

Now that the prologue is generated after GUEST_BASE is fixed,
we can load it as an immediate, and also avoid reserving the
register if it isn't necessary.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Initialize the prologue after GUEST_BASE is fixed.
Richard Henderson [Thu, 6 May 2010 15:50:41 +0000 (08:50 -0700)]
tcg: Initialize the prologue after GUEST_BASE is fixed.

This will allow backends to make intelligent choices about how
to implement GUEST_BASE.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Fix sigprocmask.
Richard Henderson [Mon, 3 May 2010 17:07:55 +0000 (10:07 -0700)]
alpha-linux-user: Fix sigprocmask.

Alpha passes oldset by value in a register, and returns the newset
as the return value; as compared to the standard implementation in
which both are passed by reference.  This requires being able to
distinguish negative return values that are not errors.  Do this in
the same way as the Alpha Linux kernel, by storing a zero in V0 in
the implementation of the syscall.

At the same time, fix a think-o in the regular sigprocmask path in
which we passed the target, rather than the host, HOW value.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Fix sigsuspend parameters.
Richard Henderson [Mon, 3 May 2010 17:07:54 +0000 (10:07 -0700)]
alpha-linux-user: Fix sigsuspend parameters.

Alpha passes the signal set in a register, not by reference.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Fix getxpid.
Richard Henderson [Mon, 3 May 2010 17:07:53 +0000 (10:07 -0700)]
alpha-linux-user: Fix getxpid.

Put ppid in the second return register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Fix pipe return mechanism.
Richard Henderson [Mon, 3 May 2010 17:07:52 +0000 (10:07 -0700)]
alpha-linux-user: Fix pipe return mechanism.

At the same time, tidy the code wrt MIPS and SH4 which have the
same two register return mechanism.  Fix confusion between pipe
and pipe2 with an explicit flags=0, when the guest will not be
using the two register return mechanism.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Add correct sigaction constants.
Richard Henderson [Mon, 3 May 2010 17:07:51 +0000 (10:07 -0700)]
alpha-linux-user: Add correct sigaction constants.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Fix siginfo.si_addr for SIGSEGV and SIGBUS.
Richard Henderson [Mon, 3 May 2010 17:07:50 +0000 (10:07 -0700)]
alpha-linux-user: Fix siginfo.si_addr for SIGSEGV and SIGBUS.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Fix brk error return.
Richard Henderson [Mon, 3 May 2010 17:07:49 +0000 (10:07 -0700)]
alpha-linux-user: Fix brk error return.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Nuke trailing whitespace.
Richard Henderson [Fri, 21 May 2010 15:30:35 +0000 (08:30 -0700)]
tcg-i386: Nuke trailing whitespace.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Use lea for three-operand add.
Richard Henderson [Fri, 21 May 2010 15:30:34 +0000 (08:30 -0700)]
tcg-i386: Use lea for three-operand add.

The result is shorter than the mov+add that TCG would
otherwise generate for us.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy lea.
Richard Henderson [Fri, 21 May 2010 15:30:33 +0000 (08:30 -0700)]
tcg-i386: Tidy lea.

Implement full modrm+sib addressing mode processing.
Use that in qemu_ld/st to output the LEA.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy xchg.
Richard Henderson [Fri, 21 May 2010 15:30:32 +0000 (08:30 -0700)]
tcg-i386: Tidy xchg.

Define and use OPC_XCHG_ax_r32.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy multiply.
Richard Henderson [Fri, 21 May 2010 15:30:31 +0000 (08:30 -0700)]
tcg-i386: Tidy multiply.

Define and use OPC_IMUL_GvEv{,Ib,Iz}.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy unary arithmetic.
Richard Henderson [Fri, 21 May 2010 15:30:30 +0000 (08:30 -0700)]
tcg-i386: Tidy unary arithmetic.

Define OPC_GRP3 and EXT3_FOO to match.  Use them instead of
bare constants.

Define OPC_GRP5 and rename the existing EXT_BAR to EXT5_BAR to
make it clear which extension should be used with which opcode.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy setcc.
Richard Henderson [Fri, 21 May 2010 15:30:29 +0000 (08:30 -0700)]
tcg-i386: Tidy setcc.

Define and use OPC_SETCC.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy ret.
Richard Henderson [Fri, 21 May 2010 15:30:28 +0000 (08:30 -0700)]
tcg-i386: Tidy ret.

Define and use OPC_RET.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy calls.
Richard Henderson [Fri, 21 May 2010 15:30:27 +0000 (08:30 -0700)]
tcg-i386: Tidy calls.

Define OPC_CALL_Jz, generated by tcg_out_calli; use the later
throughout.  Unify the calls within qemu_st; adjust the stack
with a single pop if applicable.

Define and use EXT_CALLN_Ev for indirect calls.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy push/pop.
Richard Henderson [Fri, 21 May 2010 15:30:26 +0000 (08:30 -0700)]
tcg-i386: Tidy push/pop.

Move tcg_out_push/pop up in the file so that they can be used
by qemu_ld/st.  Define a tcg_out_pushi to be used as well.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy movi.
Richard Henderson [Fri, 21 May 2010 15:30:25 +0000 (08:30 -0700)]
tcg-i386: Tidy movi.

Define and use OPC_MOVL_Iv.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy non-immediate arithmetic operations.
Richard Henderson [Fri, 21 May 2010 15:30:24 +0000 (08:30 -0700)]
tcg-i386: Tidy non-immediate arithmetic operations.

Add more OPC values, and tgen_arithr.  Use the later throughout.

Note that normal reg/reg arithmetic now uses the Gv,Ev opcode form
instead of the Ev,Gv opcode form used previously.  Both forms
disassemble properly, and so there's no visible change when diffing
log files before and after the change.  This change makes the operand
ordering within the output routines more natural, and avoids the need
to define an OPC_ARITH_EvGv since a read-modify-write with memory is
not needed within TCG.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy immediate arithmetic operations.
Richard Henderson [Fri, 21 May 2010 15:30:23 +0000 (08:30 -0700)]
tcg-i386: Tidy immediate arithmetic operations.

Define OPC_ARITH_EvI[bz]; use throughout.  Use tcg_out_ext8u
directly in setcond.  Use tgen_arithi in qemu_ld/st.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy ext8s and ext16s operations.
Richard Henderson [Fri, 21 May 2010 15:30:22 +0000 (08:30 -0700)]
tcg-i386: Tidy ext8s and ext16s operations.

Define OPC_MOVSBL and OPC_MOVSWL.  Factor opcode emission to
separate functions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy ext8u and ext16u operations.
Richard Henderson [Fri, 21 May 2010 15:30:21 +0000 (08:30 -0700)]
tcg-i386: Tidy ext8u and ext16u operations.

Define OPC_MOVZBL and OPC_MOVZWL.  Factor opcode emission to
separate functions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoaxisdev88: Fix passing of kernel cmdline.
Edgar E. Iglesias [Fri, 21 May 2010 14:09:10 +0000 (16:09 +0200)]
axisdev88: Fix passing of kernel cmdline.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
14 years agoReplace \0s with spaces before sending strings to curses.
Bernhard Kauer [Fri, 21 May 2010 12:05:55 +0000 (14:05 +0200)]
Replace \0s with spaces before sending strings to curses.

Signed-off-by: Bernhard Kauer <kauer@tudos.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agoarm_timer: fix oneshot mode
Rabin Vincent [Sun, 2 May 2010 09:50:52 +0000 (15:20 +0530)]
arm_timer: fix oneshot mode

In oneshot mode, the delta needs to come from the TimerLoad register,
not the maximum limit.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoarm_timer: reload timer when enabled
Rabin Vincent [Sun, 2 May 2010 09:50:51 +0000 (15:20 +0530)]
arm_timer: reload timer when enabled

Reload the timer when TimerControl is written, if the timer is to be
enabled.  Otherwise, if an earlier write to TimerLoad was done while
periodic mode was not set, s->delta may incorrectly still have the value
of the maximum limit instead of the value written to TimerLoad.

This problem is evident on versatileap on current linux-next, which
enables TIMER_CTRL_32BIT before writing to TimerLoad and then enabling
periodic mode and starting the timer.  This causes the first periodic
tick to be scheduled to occur after 0xffffffff periods, leading to a
perceived hang while the kernel waits for the first timer tick.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agopflash_cfi01: add device ID read command
Michael Walle [Sat, 1 May 2010 17:34:06 +0000 (19:34 +0200)]
pflash_cfi01: add device ID read command

Add support to read manufacturer and device ID. For everything else (eg.
lock bits) 0 is returned.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agovvfat: More build fixes with DEBUG
Kevin Wolf [Thu, 20 May 2010 08:34:50 +0000 (10:34 +0200)]
vvfat: More build fixes with DEBUG

Casting a pointer to an int doesn't work on 64 bit platforms. Use the %p printf
conversion specifier instead.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agovvfat: Fix compilation with DEBUG defined
Riccardo Magliocchetti [Wed, 19 May 2010 20:53:44 +0000 (22:53 +0200)]
vvfat: Fix compilation with DEBUG defined

gcc does not like passing a NULL where an int value is expected:

block/vvfat.c: In function ‘checkpoint’:
block/vvfat.c:2868: error: passing argument 2 of ‘remove_mapping’ makes
  integer from pointer without a cast

Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Add SG_IO device check in refresh_total_sectors()
Nicholas Bellinger [Mon, 17 May 2010 16:46:04 +0000 (09:46 -0700)]
block: Add SG_IO device check in refresh_total_sectors()

This patch adds a special case check for scsi-generic devices in
refresh_total_sectors() to skip the subsequent BlockDriver->bdrv_getlength()
that will be returning -ESPIPE from block/raw-posic.c:raw_getlength() for
BlockDriverState->sg=1 devices.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Make find_image_format() return 'raw' BlockDriver for SG_IO devices
Nicholas Bellinger [Mon, 17 May 2010 16:45:57 +0000 (09:45 -0700)]
block: Make find_image_format() return 'raw' BlockDriver for SG_IO devices

This patch adds a special BlockDriverState->sg check in block.c:find_image_format()
after bdrv_file_open() -> block/raw-posix.c:hdev_open() has been called to determine
if we are dealing with a Linux host scsi-generic device.

The patch then returns the BlockDriver * from bdrv_find_format("raw"), skipping the
subsequent bdrv_read() and rest of find_image_format().

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: fix sector comparism in multiwrite_req_compare
Christoph Hellwig [Wed, 19 May 2010 18:53:10 +0000 (20:53 +0200)]
block: fix sector comparism in multiwrite_req_compare

The difference between the start sectors of two requests can be larger
than the size of the "int" type, which can lead to a not correctly
sorted multiwrite array and thus spurious I/O errors and filesystem
corruption due to incorrect request merges.

So instead of doing the cute sector arithmetics trick spell out the
exact comparisms.

Spotted by Kevin Wolf based on a testcase from Michael Tokarev.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agovirtio-blk: fix barrier support
Christoph Hellwig [Wed, 19 May 2010 10:40:09 +0000 (12:40 +0200)]
virtio-blk: fix barrier support

Before issuing the barrier to the block driver we need to flush our oustanding
queue of write requests, as the flush is supposed to be issued after them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agovirtio-blk: Avoid zeroing every request structure
Stefan Hajnoczi [Fri, 14 May 2010 21:52:30 +0000 (22:52 +0100)]
virtio-blk: Avoid zeroing every request structure

The VirtIOBlockRequest structure is about 40 KB in size.  This patch
avoids zeroing every request by only initializing fields that are read.
The other fields are either written to or may not be used at all.

Oprofile shows about 10% of CPU samples in memset called by
virtio_blk_alloc_request().  The workload is
dd if=/dev/vda of=/dev/null iflag=direct bs=8k running concurrently 4
times.  This patch makes memset disappear to the bottom of the profile.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: fix aio_flush segfaults for read-only protocols (e.g. curl)
Avi Kivity [Sun, 16 May 2010 11:59:57 +0000 (14:59 +0300)]
block: fix aio_flush segfaults for read-only protocols (e.g. curl)

Not all block format drivers expose an io_flush method (reasonable for
read-only protocols), so calling io_flush there will immediately segfault.

Fix by checking for the method's existence before calling it.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agopc: fix segfault introduced by 3d53f5c36ff6
Eduard - Gabriel Munteanu [Thu, 20 May 2010 06:14:04 +0000 (09:14 +0300)]
pc: fix segfault introduced by 3d53f5c36ff6

Commit 3d53f5c36ff6 introduced a segfault by erroneously making fw_cfg a
'void **' and passing it around in different ways.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-sparc: Inline some generation of carry for ADDX/SUBX.
Richard Henderson [Wed, 12 May 2010 18:04:27 +0000 (11:04 -0700)]
target-sparc: Inline some generation of carry for ADDX/SUBX.

Computing carry is trivial for some inputs.  By avoiding an
external function call, we generate near-optimal code for
the common cases of add+addx (double-word arithmetic) and
cmp+addx (a setcc pattern).

Signed-off-by: Richard Henderson <rth@twiddle.net>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg-i386: Tidy jumps.
Richard Henderson [Wed, 14 Apr 2010 15:26:50 +0000 (08:26 -0700)]
tcg-i386: Tidy jumps.

Define OPC_JCC*, OC_JMP*, and EXT_JMPN_Ev.  Use them throughout.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Eliminate extra move from qemu_ld64.
Richard Henderson [Wed, 14 Apr 2010 15:06:00 +0000 (08:06 -0700)]
tcg-i386: Eliminate extra move from qemu_ld64.

If the address register overlaps one of the output registers
simply issue the clobbering load last, rather than emitting
an extra move of the address register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy move operations.
Richard Henderson [Wed, 14 Apr 2010 14:58:59 +0000 (07:58 -0700)]
tcg-i386: Tidy move operations.

Define OPC_MOVB* and OPC_MOVL*; use them throughout.
Use tcg_out_ld/st instead of bare tcg_out_modrm_offset
when it makes sense.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy shift operations.
Richard Henderson [Wed, 28 Apr 2010 17:38:04 +0000 (10:38 -0700)]
tcg-i386: Tidy shift operations.

Define OPC_SHIFT_{1,Ib,cl}.  Factor opcode emission to a function.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Tidy bswap operations.
Richard Henderson [Wed, 28 Apr 2010 17:31:18 +0000 (10:31 -0700)]
tcg-i386: Tidy bswap operations.

Define OPC_BSWAP.  Factor opcode emission to separate functions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoRemove i386 from .gitignore
Aurelien Jarno [Thu, 20 May 2010 19:00:23 +0000 (21:00 +0200)]
Remove i386 from .gitignore

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-sparc: Simplify ICC generation.
Richard Henderson [Wed, 12 May 2010 18:04:26 +0000 (11:04 -0700)]
target-sparc: Simplify ICC generation.

Use int32 types instead of target_ulong when computing ICC.  This
simplifies the generated code for 32-bit host and 64-bit guest.
Use the same simplified expressions for ICC as were already used
for XCC in carry flag generation.

Simplify the ADD carry generation to not consider a possible carry-in.
Use the more complex carry computation for ADDX only.  Use the same
carry algorithm for the XCC result of ADDX.  Similarly for SUB/SUBX.

Use the ADD carry generation functions for TADD/TADDTV.  Similarly
for SUB and TSUB/TSUBTV.

Tidy the code with respect to CODING_STYLE.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-sparc: Fix compilation with --enable-debug.
Richard Henderson [Wed, 12 May 2010 18:04:25 +0000 (11:04 -0700)]
target-sparc: Fix compilation with --enable-debug.

Return a target_ulong from compute_C_icc to match the width of the users.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix __VA__ARGS__ typo in cris mmu.c
Riccardo Magliocchetti [Wed, 19 May 2010 16:49:29 +0000 (18:49 +0200)]
Fix __VA__ARGS__ typo in cris mmu.c

Fix compilation with DEBUG defined

Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agolinux-user: fix 32-bit host breakage
Aurelien Jarno [Wed, 19 May 2010 16:30:53 +0000 (18:30 +0200)]
linux-user: fix 32-bit host breakage

Fix breakage introduced by commit 81bbe906c89b6b7af58a1eeb96ec5a0bfdc3386f.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix qtypes' licenses
Luiz Capitulino [Wed, 12 May 2010 19:34:42 +0000 (16:34 -0300)]
Fix qtypes' licenses

- Change from GPL to LGPL
- Add license text when missing
- Minor cosmetic changes to make all headers look the same

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoMonitor: Return before exiting with 'quit'
Luiz Capitulino [Tue, 11 May 2010 21:08:20 +0000 (18:08 -0300)]
Monitor: Return before exiting with 'quit'

This is a new version of the (now reverted) following commit:

0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d

The 'quit' Monitor command (implemented by do_quit()) calls
exit() directly, this is problematic under QMP because QEMU
exits before having a chance to send the ok response.

Clients don't know if QEMU exited because of a problem or
because the 'quit' command has been executed.

This commit fixes that by making do_quit() use
qemu_system_shutdown_request(), so that we exit gracefully.

Thanks to Paolo Bonzini <pbonzini@redhat.com> for suggesting
this solution.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agosysemu: Export 'no_shutdown'
Luiz Capitulino [Tue, 11 May 2010 21:07:04 +0000 (18:07 -0300)]
sysemu: Export 'no_shutdown'

It's a global variable already, do_quit() will use it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoRevert "Monitor: Return before exiting with 'quit'"
Luiz Capitulino [Tue, 11 May 2010 20:50:50 +0000 (17:50 -0300)]
Revert "Monitor: Return before exiting with 'quit'"

This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d.

Next commits will do the same thing in a better way.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoRevert "monitor: Convert do_pci_device_hot_remove() to QObject"
Markus Armbruster [Wed, 12 May 2010 08:53:01 +0000 (10:53 +0200)]
Revert "monitor: Convert do_pci_device_hot_remove() to QObject"

We don't want pci_del in QMP.  Use device_del instead.

This reverts commit 6848d827162fea039f2658414a4adb6164a4f9b0.

Conflicts:

hw/pci-hotplug.c
sysemu.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
14 years agoRevert "PCI: Convert pci_device_hot_add() to QObject"
Markus Armbruster [Wed, 12 May 2010 08:53:00 +0000 (10:53 +0200)]
Revert "PCI: Convert pci_device_hot_add() to QObject"

Short story: We don't want pci_add in QMP.  Long story follows.

pci_add can do two things:

* Hot plug a PCI NIC.  device_add is more general.

* Hot plug a PCI disk controller, and a drive connected to it.

  The controller is either virtio-blk-pci (if=virtio) or lsi53c895a
  (if=scsi).  With the latter, the drive is optional.  Use drive_add to
  hotplug additional SCSI drives.  Except drive_add is not available in
  QMP.

  device_add is more general for controllers and the guest part of
  drives.  I'm working on a more general alternative for the host part
  of drives.

Why am I proposing to remove pci_add from QMP before its replacement is
ready?  I want it out sooner rather than later, because it isn't fully
functional (errors and drive_add are missing), and we do not plan to
complete the job.  In other words, it's not really usable over QMP now,
and it's not what we want for QMP anyway.  Since we don't want it to be
used over QMP, we should take it out, not leave it around as a trap for
the uninitiated.

Dan Berrange confirmed that libvirt has no need for pci_add & friends
over QMP.

This reverts commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949.

Conflicts:

hw/pci-hotplug.c
sysemu.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
14 years agoQMP: Add "Downstream extension of QMP" to spec
Markus Armbruster [Mon, 10 May 2010 07:16:05 +0000 (09:16 +0200)]
QMP: Add "Downstream extension of QMP" to spec

Signed-off-by: Markus Armbruster <armbru@redhat.com>
14 years agomicroblaze: Update elf machine nums.
Edgar E. Iglesias [Wed, 19 May 2010 13:24:17 +0000 (15:24 +0200)]
microblaze: Update elf machine nums.

189 was allocated in upstream binutils.

0xbaab was the old temporary value. Still used by some tools and the
linux kernel.

I've seen 115 in older gdb versions, but lets ignore that one.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Add linux-user core dumping support.
Edgar E. Iglesias [Wed, 19 May 2010 13:09:28 +0000 (15:09 +0200)]
microblaze: Add linux-user core dumping support.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agotcg-i386: Tidy initialization of tcg_target_call_clobber_regs.
Richard Henderson [Tue, 13 Apr 2010 22:26:17 +0000 (15:26 -0700)]
tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.

Setting the registers one by one is easier to read, and gets
optimized by the compiler just the same.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Allocate call-saved registers first.
Richard Henderson [Tue, 13 Apr 2010 22:23:53 +0000 (15:23 -0700)]
tcg-i386: Allocate call-saved registers first.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix cross compilation
Stefan Weil [Sun, 11 Apr 2010 16:44:18 +0000 (18:44 +0200)]
Fix cross compilation

This patch enhances the algorithm which finds the correct settings for SDL.
For cross compilations (when cross_prefix is set), it looks for sdl-config
with cross prefix. Here is the complete search order:

$(cross_prefix}pkg-config              (old, only used for cross compilation)
${cross_prefix}sdl_config              (new, only used for cross compilation)
pkg-config                             (old, needs PATH)
sdl-config                             (old, needs PATH)

Cross SDL packages (or the user) now can simply set a link (for example
/usr/bin/i586-mingw32msvc-sdl-config -> /usr/i586-mingw32msvc/bin/sdl-config)
which allows cross compilations without PATH modifications.

Without the patch, configure and make (which calls configure) typically
need a non-standard PATH. Failing to set this special PATH results in
broken builds.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-s390: enable SIGP Initial Reset
Alexander Graf [Fri, 14 May 2010 14:14:31 +0000 (16:14 +0200)]
target-s390: enable SIGP Initial Reset

For SMP to work with KVM, we need to properly emulate the SIGP Initial Reset
Command. Recent (2.6.32) kernels issue that before the SIGP Reset command that
actually wakes up the vcpu.

This patch makes -smp work on S390x.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: remove dead code
Thomas Monjalon [Wed, 21 Apr 2010 09:48:11 +0000 (11:48 +0200)]
target-ppc: remove dead code

This function had been disabled from the beginning:
see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5

cpu_reset() function is in target-ppc/helper.c

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-s390: add firmware code
Alexander Graf [Tue, 20 Apr 2010 17:37:13 +0000 (19:37 +0200)]
target-s390: add firmware code

This patch adds a firmware blob to the S390 target. The blob is a simple
implementation of a virtio client that tries to read the second stage
bootloader from sectors described as of offset 0x20 in the MBR.

In combination with an updated zipl this allows for booting from virtio
block devices. This firmware is built from the same sources as the second
stage bootloader. You can find a virtio capable s390-tools in this repo:

git://repo.or.cz/s390-tools.git

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoPPC/KVM: make iothread work
Alexander Graf [Sun, 18 Apr 2010 21:10:17 +0000 (23:10 +0200)]
PPC/KVM: make iothread work

When running with --enable-io-thread the timer we have doesn't help,
because it doesn't wake up the CPU thread. So instead we need to
actually kick it.

While at it I refined the logic a bit to not dumbly trigger a timer
every 500ms, but rather do it more often after an interrupt got injected.
If there's no level based interrupt to be expected, we don't need the
timer anyways.

This makes qemu-system-ppc with --enable-io-thread work when using KVM.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agofix chardev_init for win32
TeLeMan [Thu, 15 Apr 2010 04:37:55 +0000 (12:37 +0800)]
fix chardev_init for win32

chardev_init functions use socket,so socket_init() shoud be placed at
the front of chardev_init on win32.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-sockets: avoid strlen of NULL pointer
Jens Osterkamp [Mon, 12 Apr 2010 08:51:01 +0000 (10:51 +0200)]
qemu-sockets: avoid strlen of NULL pointer

If the user wants to create a chardev of type socket but forgets to give a
host= option, qemu_opt_get returns NULL. This NULL pointer is then fed into
strlen a few lines below without a check which results in a segfault.
This fixes it.

Signed-off-by: Jens Osterkamp <jens@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: rlimit conversion between host and target.
takasi-y@ops.dti.ne.jp [Sun, 11 Apr 2010 19:07:35 +0000 (04:07 +0900)]
linux-user: rlimit conversion between host and target.

rlim_t conversion between host and target added.
Otherwise there are some incorrect case like
- RLIM_INFINITY on 32bit target -> 64bit host.
- RLIM_INFINITY on 64bit host -> mips and sparc target ?
- Big value(for 32bit target) on 64bit host -> 32bit target.

One is added into getrlimit, setrlimit, and ugetrlimit. It converts both
RLIM_INFINITY and value bigger than target can hold(>31bit) to RLIM_INFINITY.

Another one is added to guest_stack_size calculation introduced by
703e0e89. The rule is mostly same except the result on the case is keeping
the value of guest_stack_size.

Slightly tested for SH4, and x86_64 -linux-user on x86_64-pc-linux host.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoCompile acpi_piix4, apm and pm_smbus only once
Blue Swirl [Mon, 17 May 2010 19:32:37 +0000 (19:32 +0000)]
Compile acpi_piix4, apm and pm_smbus only once

12 compilations less for the full build.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 17 May 2010 18:17:34 +0000 (13:17 -0500)]
Merge remote branch 'kwolf/for-anthony' into staging

14 years agoMerge remote branch 'mst/for_anthony' into staging
Anthony Liguori [Mon, 17 May 2010 17:41:39 +0000 (12:41 -0500)]
Merge remote branch 'mst/for_anthony' into staging

14 years agoblock: Remove special case for vvfat
Kevin Wolf [Wed, 12 May 2010 12:03:02 +0000 (14:03 +0200)]
block: Remove special case for vvfat

The special case doesn't really us buy anything. Without it vvfat works more
consistently as a protocol. We get raw on top of vvfat now, which works just
as well as using vvfat directly.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoFix docs for block stats monitor command
Daniel P. Berrange [Thu, 13 May 2010 10:30:50 +0000 (06:30 -0400)]
Fix docs for block stats monitor command

The 'parent' field in the 'query-blockstats' monitor command is
part of the top level block device QDict, not part of the 2nd
level 'stats' QDict.

* block.c: Fix docs for 'parent' field in block stats monitor
  command output

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agouse qemu_free() instead of free()
Bruce Rogers [Thu, 13 May 2010 21:14:33 +0000 (15:14 -0600)]
use qemu_free() instead of free()

There is a call to free() where qemu_free() should instead be used.

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock/vdi: Fix image opening and creation for odd disk sizes
Stefan Weil [Wed, 12 May 2010 18:25:45 +0000 (20:25 +0200)]
block/vdi: Fix image opening and creation for odd disk sizes

The fix is based on a patch from Kevin Wolf. Here his comment:

"The number of blocks needs to be rounded up to cover all of the virtual hard
disk. Without this fix, we can't even open our own images if their size is not
a multiple of the block size."

While Kevin's patch addressed vdi_create, my modification also fixes
vdi_open which now accepts images with odd disk sizes.

v3:
Don't allow reading of disk images with too large disk sizes.
Neither VBoxManage nor old versions of qemu-img read such images.
This change requires rounding of odd disk sizes before we do the checks.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: François Revol <revol@free.fr>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agodmg: use qemu block API
Christoph Hellwig [Wed, 12 May 2010 14:31:49 +0000 (16:31 +0200)]
dmg: use qemu block API

Use bdrv_pwrite to access the backing device instead of pread, and
convert the driver to implementing the bdrv_open method which gives
it an already opened BlockDriverState for the underlying device.

Dmg actually does an lseek to a negative offset in the open routine,
which we replace with offset arithmetics after doing a bdrv_getlength.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>