Richard Henderson [Mon, 14 Dec 2009 01:50:46 +0000 (17:50 -0800)]
target-alpha: Fix float32_to_s vs zero exponent.
There was a bug in float32_to_s that incorrectly mapped a zero exponent
to 0x38. This meant 0.0f != 0. At the same time, fix a generic type
punning bug in helper_memory_to_s and helper_s_to_memory.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 14 Dec 2009 01:48:55 +0000 (17:48 -0800)]
target-alpha: Fix cvtlq.
We were missing the 0xc0000000 mask, leading to incorrect results.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 14 Dec 2009 01:47:25 +0000 (17:47 -0800)]
target-alpha: Fix generic ctz64.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 14 Dec 2009 01:46:17 +0000 (17:46 -0800)]
target-alpha: Implement fp branch/cmov inline.
The old fcmov implementation had a typo:
- tcg_gen_mov_i64(cpu_fir[rc], cpu_fir[ra]);
which moved the condition, not the second source, to the destination.
But it's also easy to implement the simplified fp comparison inline.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 14 Dec 2009 01:18:47 +0000 (17:18 -0800)]
target-alpha: Add placeholders for missing userspace PALcalls.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Tue, 15 Dec 2009 13:03:03 +0000 (14:03 +0100)]
target-mips: No MIPS16 support for 4Kc, 4KEc cores
Fix regression introduced by
d19954f46dfc262612c30e9534e660e953049487.
4Kc and 4KEc don't support MIPS16.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Mon, 14 Dec 2009 09:54:49 +0000 (10:54 +0100)]
target-alpha: Fix compiler warning for gcc-4.3 (and older)
"Old" compilers obviously are not able to recognise
that all cases are handled here:
qemu/target-alpha/helper.c:70: error: ‘round_mode’ may be used uninitialized in this function
A small modification helps the compiler to do its jobs.
gcc-4.4 does not need this, but is still not standard on all platforms.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Mon, 14 Dec 2009 09:39:12 +0000 (10:39 +0100)]
s390: Fix buggy assignment
nd->model keeps dynamically allocated model names.
So casting of a constant string is wrong here.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Tue, 15 Dec 2009 13:43:40 +0000 (14:43 +0100)]
target-mips: 4Kc, 4KEc cores do not support MIPS16
4Kc, 4KEc cores do not support MIPS16, so not only the
CP0_Config1 had to be fixed (see previous patch),
but also MIPS16 instructions must not be executed.
(Hint from Nathan Froyd, thanks).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Michal Simek [Mon, 7 Dec 2009 13:12:49 +0000 (14:12 +0100)]
microblaze: Print content of EAR register
I need to see EAR register in output because I need to parse irqsoff problem.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Edgar E. Iglesias [Wed, 16 Dec 2009 11:52:56 +0000 (12:52 +0100)]
microblaze: Update debug logs.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
malc [Tue, 15 Dec 2009 16:44:20 +0000 (19:44 +0300)]
tcg/ppc64: Fix loading of 32bit constants
Signed-off-by: malc <av1474@comtv.ru>
Richard Henderson [Fri, 11 Dec 2009 21:23:52 +0000 (13:23 -0800)]
target-alpha: Fix double log_cpu_state.
The proper logging is handled by generic code.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 11 Dec 2009 21:21:02 +0000 (13:21 -0800)]
target-alpha: Fix FMOV.
Properly handle move from the zero register.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Sat, 12 Dec 2009 00:31:29 +0000 (16:31 -0800)]
target-alpha: Expand ins*h inline.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 11 Dec 2009 19:58:29 +0000 (11:58 -0800)]
target-alpha: Expand msk*h inline.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 11 Dec 2009 19:51:45 +0000 (11:51 -0800)]
target-alpha: Expand msk*l inline.
Similar in difficulty to ext*l, already expanded.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 11 Dec 2009 18:39:56 +0000 (10:39 -0800)]
target-alpha: Expand ins*l inline.
Similar in difficulty to ext*l, already expanded.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 11 Dec 2009 17:38:23 +0000 (09:38 -0800)]
target-alpha: Implement RD/WRUNIQUE in the translator
When emulating user-mode only, there's no reason to exit
the translation block to effect a call_pal. We can generate
a move to/from the unique slot directly.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 11 Dec 2009 17:07:29 +0000 (09:07 -0800)]
target-alpha: Fix fbcond branch offset.
The instructions use a disp21 like all other branch insns,
not the disp16 that was being passed.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Thu, 10 Dec 2009 22:00:18 +0000 (14:00 -0800)]
target-alpha: Rewrite gen_ext_[hl] in terms of zapnot.
The architecture manual specifies the EXT instructions
in terms of the ZAPNOT operation; writing it that way in
the translator makes things a bit clearer.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Thu, 10 Dec 2009 21:43:58 +0000 (13:43 -0800)]
target-alpha: Expand zap/zapnot with immediate inline.
The vast majority of zap instructions have an immediate operand,
since zapnot is the canonical method to zero-extend from u16 or u32.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Thu, 10 Dec 2009 20:54:04 +0000 (12:54 -0800)]
target-alpha: Fix -d in_asm
Generic disassembly was incorrectly keyed on ALPHA_DEBUG_DISAS
rather than the generic DEBUG_DISAS. Use qemu_log_mask for
additional LOG_DISAS output. Delete some random insn_count
logging noise from gen_intermediate_code_internal.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Thu, 10 Dec 2009 20:04:42 +0000 (12:04 -0800)]
target-alpha: Implement missing MVI instructions.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Fri, 11 Dec 2009 17:29:20 +0000 (09:29 -0800)]
target-mips: fix user-mode emulation startup
Running programs with the MIPS user-mode emulator fails during dynamic
loading, as floating-point instructions are not enabled in in
env->hflags. Move the code for doing so from fpu_init to cpu_reset so
the MIPS_HFLAG_{FPU,F64} setting doesn't get clobbered by cpu_reset
setting env->hflags to MIPS_HFLAG_UM.
The same end can be achieved by swapping the ordering of fpu_init and
cpu_reset in cpu_mips_init, but it seemed better to consolidate the
CONFIG_USER_ONLY code into a single location.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Andre Przywara [Mon, 7 Dec 2009 11:05:38 +0000 (12:05 +0100)]
target-i386: Update CPUID feature set for TCG
The CPUID features QEMU presented to the guest were not up-to-date
with QEMU's emulated feature set.
Add the missing bits of recent (and not so recent) additions to
QEMU's emulation engine.
For stability reasons only the user mode usable bits are exposed for
now, features like Monitor or CR8LEG are left out.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 9 Dec 2009 23:56:29 +0000 (15:56 -0800)]
target-alpha: Fixes for alpha-linux syscalls.
1. Add correct definitions of error numbers.
2. Implement SYS_osf_sigprocmask
3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL.
This last requires exposing the FPCR value to do_syscall.
Since this value is actually split up into the float_status,
expose routines from helper.c to access it.
Finally, also add a float_exception_mask field to float_status.
We don't actually use it to control delivery of exceptions to
the emulator yet, but simply hold the value that we placed there
when loading/storing the FPCR.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 9 Dec 2009 23:48:02 +0000 (15:48 -0800)]
target-alpha: Enable softfloat.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 9 Dec 2009 23:46:36 +0000 (15:46 -0800)]
target-alpha: Honor the -cpu command line argument.
Also change the default cpu to ev67.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 9 Dec 2009 23:44:08 +0000 (15:44 -0800)]
target-alpha: Remove bogus DO_TB_FLUSH code from translator.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 9 Dec 2009 23:40:11 +0000 (15:40 -0800)]
target-alpha: Add binfmt entry.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 9 Dec 2009 23:39:42 +0000 (15:39 -0800)]
target-alpha: Drop bogus UNIQ initial value on Linux.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:32 +0000 (08:06 -0800)]
target-mips: set Config1.CA for MIPS16-aware CPUs
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:31 +0000 (08:06 -0800)]
target-mips: add copyright notice for mips16 work
Also cross off mips16 ASE in TODO.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:30 +0000 (08:06 -0800)]
gdbstub: add MIPS16 support
The only thing to do here is to expose the current processor mode to GDB
and to set the processor mode properly when we change the PC.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:29 +0000 (08:06 -0800)]
target-mips: add mips16 instruction decoding
There's no good way to add this incrementally, so we do it all at once.
The only changes to shared code are in handle_delay_slot. We need to
flip ISAMode when doing a jump-and-exchange. We also need to set
ISAMode the low bit of the target address for jump-to-register.
Also, since we're now adding bits that can be in MIPS_HFLAG_BMASK_EXT,
make sure we use MIPS_HFLAG_BMASK_BASE in the places where we just want
basic information about a branch.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:28 +0000 (08:06 -0800)]
target-mips: add enums for MIPS16 opcodes
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:27 +0000 (08:06 -0800)]
target-mips: split out delay slot handling
Move delay slot handling to common code whose invocation can be
controlled from gen_intermediate_code_internal.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 18:01:01 +0000 (10:01 -0800)]
target-mips: add gen_base_offset_addr
This is a common pattern in existing code. We'll also use it to
implement the mips16 SAVE/RESTORE instructions.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:25 +0000 (08:06 -0800)]
target-mips: make gen_compute_branch 16/32-bit-aware
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:24 +0000 (08:06 -0800)]
target-mips: move ROTR and ROTRV inside gen_shift_{imm, }
It's easier to implement mips16 shift instructions if we're not
examining the opcode inside gen_shift_{imm,}. So move ROTR and ROTRV
and do the special-case handling of SRL and SRLV inside decode_opc.
Likewise for their 64-bit counterparts.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:23 +0000 (08:06 -0800)]
target-mips: change interrupt bits to be mips16-aware
We need to stash the operating mode into the low bit of the error PC and
restore it on return from interrupts.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 8 Dec 2009 16:06:22 +0000 (08:06 -0800)]
target-mips: add new HFLAGs for JALX and 16/32-bit delay slots
We create separate masks for the "basic" branch hflags and the
"extended" branch hflags and define MIPS_HFLAG_BMASK as the logical or
of those two. This is done to avoid churning the codebase in lots of
different places.
We also make the execution mode an hflag under MIPS_HFLAG_TMASK
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Igor V. Kovalenko [Sun, 13 Dec 2009 19:03:31 +0000 (19:03 +0000)]
workaround for cmd646 bmdma register access while no dma is active
This is a workaround only, and is a partial revert
of a few changes to BMDMAState which removed pci_dev
field on the way.
- cmd646 pci_from_bm() expects bm->unit value to
correspond with bm data being passed to callback
as opaque pointer. This breaks when write to dma
control register of second channel happens when no
dma operation is in progress, so bm->unit is zero
for second channel, and pci_from_bm() returns garbage
pointer. Crash happens shortly after that while
dereferencing that pointer.
v0->v1: cleaned up dead code from pci_from_bm.
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Michael S. Tsirkin [Sun, 13 Dec 2009 14:45:47 +0000 (16:45 +0200)]
s390: typo fix
s390 code has an obvious typo, which results in:
hw/s390-virtio.c: At top level:
hw/s390-virtio.c:249: error: request for member ‘no_vga’ in something not a structure or union
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Michael S. Tsirkin [Sun, 13 Dec 2009 14:44:33 +0000 (16:44 +0200)]
s390: fix build on 32 bit host
Building on 32 bit host we get:
hw/s390-virtio.c: In function ‘s390_init’:
hw/s390-virtio.c:184: error: integer constant is too large for ‘unsigned long’ type
64 bit values must be ULL.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Blue Swirl [Sun, 13 Dec 2009 15:41:43 +0000 (15:41 +0000)]
qemu-io: add 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Andreas Färber [Sat, 12 Dec 2009 19:10:56 +0000 (20:10 +0100)]
Silence softfloat warnings on OpenSolaris
Don't define C99 math functions on OpenSolaris (Solaris 11),
which still ships GCC 3.4.3. This fixes redefinition warnings.
Spotted by Palle Lyckegaard.
Signed-off-by: Andreas Färber <afaerber@opensolaris.org>
Cc: Palle Lyckegaard <palle@lyckegaard.dk>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Andreas Färber [Sat, 12 Dec 2009 19:10:55 +0000 (20:10 +0100)]
tap: Compilation fix for Solaris
Avoid an unresolved symbol error for TFR,
which is defined in sysemu.h.
Based on patch by Palle Lyckegaard.
Signed-off-by: Andreas Färber <afaerber@opensolaris.org>
Cc: Palle Lyckegaard <palle@lyckegaard.dk>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Artyom Tarasenko [Sun, 13 Dec 2009 13:30:44 +0000 (13:30 +0000)]
fdc/sparc32: don't hang on detection under OBP
Stepping through the SS-5's OBP initialization routines
it looks like reading fdc main status register should
clear the fd interrupt.
The patch doesn't fix problems with fdc on sparc platform,
it only fixes fdc detection.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Artyom Tarasenko [Sun, 13 Dec 2009 13:30:19 +0000 (13:30 +0000)]
Sparc32: implement AFX for SS-5
Implement a stub for the AFX register on SparcStation-5.
This stub is needed for running the original SS-5 OBP
instead of OpenBIOS (which allows to boot Solaris 2.5.1
and Solaris 2.6 kernels).
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Artyom Tarasenko [Sun, 13 Dec 2009 10:32:36 +0000 (11:32 +0100)]
scsi-disk: Inquiry with allocation length of CDB < 36 (v4)
According to the SCSI-2 specification,
http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2-08.html#8.2.5 ,
"if the allocation length of the command descriptor block (CDB) is too
small to transfer all of the parameters, the additional length shall
not be adjusted to reflect the truncation."
The 36 mandatory bytes of response are written to outbuf, and then
only the length requested in CDB is transferred.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Edgar E. Iglesias [Sun, 13 Dec 2009 08:10:08 +0000 (09:10 +0100)]
microblaze: Handle wdc flush and clear.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Paul Hartke [Sun, 13 Dec 2009 02:22:24 +0000 (03:22 +0100)]
microblaze: Correct branch to registers.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Glauber Costa [Thu, 22 Oct 2009 12:26:56 +0000 (10:26 -0200)]
v2: properly save kvm system time msr registers
Currently, the msrs involved in setting up pvclock are not saved over
migration and/or save/restore. This patch puts their value in special
fields in our CPUState, and deal with them using vmstate.
kvm also has to account for it, by including them in the msr list
for the ioctls.
This is a backport from qemu-kvm.git
[v2: sucessfully build without kerneldir ]
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:10 +0000 (17:16 -0200)]
VNC: Convert do_info_vnc() to QObject
Return a QDict with server information. Connected clients are returned
as a QList of QDicts.
The new functions (vnc_qdict_remote_addr(), vnc_qdict_local_addr() and
put_addr_qdict()) are used to insert 'host' and 'service' information
in the returned QDict.
This patch is big, but I don't see how to split it.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:09 +0000 (17:16 -0200)]
PCI: Convert pci_device_hot_add() to QObject
Return a QDict with information about the just added device.
This commit should not change user output.
Please, note that this patch does not do error handling
conversion. In error conditions the handler still calls
monitor_printf().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:08 +0000 (17:16 -0200)]
char: Convert qemu_chr_info() to QObject
Each device is represented by a QDict. The returned QObject is a QList
of all devices.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:07 +0000 (17:16 -0200)]
block: Convert bdrv_info_stats() to QObject
Each device statistic information is stored in a QDict and
the returned QObject is a QList of all devices.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:06 +0000 (17:16 -0200)]
block: Convert bdrv_info() to QObject
Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:05 +0000 (17:16 -0200)]
migration: Convert do_info_migrate() to QObject
Return a QDict, which may contain up to more two QDicts, depending
on the type of migration we're performing.
IMPORTANT: as a QInt stores a int64_t integer, RAM values are going
to be stored as int64_t and not as uint64_t as they are today. If
this is a problem QInt will have to be changed.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:04 +0000 (17:16 -0200)]
monitor: Convert do_info_mice() to QObject
Each mouse is represented by a QDict, the returned QObject is a QList of
all mice.
This commit should not change user output.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:03 +0000 (17:16 -0200)]
monitor: Convert do_info_uuid() to QObject
snprintf() is used because the UUID_FMT is too complex for
qobject_from_jsonf().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:02 +0000 (17:16 -0200)]
monitor: Convert do_info_hpet() to QObject
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:01 +0000 (17:16 -0200)]
monitor: Convert do_info_name() to QObject
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:16:00 +0000 (17:16 -0200)]
monitor: Convert do_info_kvm() to QObject
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:59 +0000 (17:15 -0200)]
monitor: Convert do_info_status() to QObject
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:58 +0000 (17:15 -0200)]
monitor: do_info_version(): Use QDict
All 'info' commands should use QDict, this commit also kills
monitor_print_qobject() as do_info_version() doesn't use it
anymore (and no handler will).
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:57 +0000 (17:15 -0200)]
monitor: do_info_cpus(): Use QBool
While there update the documentation as well.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:56 +0000 (17:15 -0200)]
monitor: Fix do_info_commands() output
Should return a QDict and should not print the user protocol bits
(eg. "c|cont").
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:55 +0000 (17:15 -0200)]
monitor: Fix do_info_balloon() output
Monitor commands should always return values in bytes and info
commands should always return a QDict.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:54 +0000 (17:15 -0200)]
QDict: Introduce qdict_get_qlist()
A helper function to get a QList from a QDict.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:53 +0000 (17:15 -0200)]
QDict: Introduce qdict_get_qbool()
This is a helper function that does type checking before retrieving
a QBool from the dictionary.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:52 +0000 (17:15 -0200)]
Makefile: move QObject objs to their own entry
Other subsystems will need to link against them.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Thu, 10 Dec 2009 19:15:51 +0000 (17:15 -0200)]
Introduce qemu-objects.h header file
An easy way to include all QEMU objects.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Fri, 11 Dec 2009 10:25:07 +0000 (11:25 +0100)]
vnc: fix capslock tracking logic.
The capslock tracking logic added by commit
6b1325029d80455b9da7cd7bd84a88cb915b867c doesn't work correctly for vnc
clients without EXT_KEY_EVENT support. The reason is that qemu converts
keysyms for letters to lowercase for the keysym2scancode lookup. It
then also passes the lowercase value down to do_key_event(), but the
capslock tracking code needs it with the correct case to work properly.
This patch adds a new variable for the lowercase keysym so we'll keep
the unmodified value for do_key_event().
The keysym2scancode is not needed with EXT_KEY_EVENT capable clients
like any app based on the gtk-vnc widget, so I missed that case in
testing ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:08 +0000 (11:11 +0100)]
QemuOpts: allow larger option values.
Use case: loooooooooooooooooong file names for -drive file=...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:07 +0000 (11:11 +0100)]
scsi: fix drive hotplug.
This patch fills the DriveInfo->unit after hotplugging a scsi disk.
It makes a difference when auto-assigning a scsi id, where unit was
left filled with '-1' instead of the actual scsi id.
With this patch applied the the drive naming logic in drive_init() works
as good as it did in previous releases. Which means it works fine with
a single scsi bus.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:06 +0000 (11:11 +0100)]
pci: don't hw_error() when no slot is available.
Current PCI code will simply hw_error() and thus abort in case no free
PCI slot is available or the requested PCI slot is already in use by
another device. For the hotplug case this behavior is not acceptable.
This patch makes qemu pass up the error properly, so the calling code
can decide whenever it wants to exit with an error (on startup) or
whenever it wants to continue (hotplug).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:05 +0000 (11:11 +0100)]
pci: don't abort() when trying to hotplug with acpi off.
The PCI bus on x86 requires ACPI for hotplug support, thus disbling ACPI
also disables hotplug for the PCI bus. This patch makes qemu check
whenever the PCI bus in question can handle hotplug before trying to add
devices. This is needed because qdev will abort() on any attempt to
hotplug devices into a non-hotpluggable bus.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:54 +0000 (13:11 +0100)]
Set default console to virtio on S390x
All "normal" system emulation targets in qemu I'm aware of display
output on either VGA or serial output.
Our S390x virtio machine doesn't have such kind of legacy hardware. So
instead we need to default to a virtio console.
Add flags to QEMUMachine to indicate which kind of default devices make
sense for the machine in question. Use it for S390x: enable virtcon,
disable serial, parallel and vga.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:53 +0000 (13:11 +0100)]
default devices: virtio consoles.
This patch adds a variable default_virtcon which says whenever a default
virtio console should be added. It is disabled by default, followup
patch will enable it for s390. It is cleared when qemu finds
'-virtiocon', '-device virtio-console-s390' or '-device
virtio-console-pci' on the command line.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:52 +0000 (13:11 +0100)]
add -qmp convinience switch
Acts like -monitor but switched into qmp mode.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:51 +0000 (13:11 +0100)]
add new -mon switch
Add -mon switch which maps pretty straight forward into the QemuOpts
internal representation:
-mon chardev=<name>[,mode=[control|readline]][,[no]default]
Via config file:
[mon]
chardev = "<name>"
mode = "readline"
default = "on"
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:50 +0000 (13:11 +0100)]
rework -monitor handling, switch to QemuOpts
This patch reworks the -monitor handling:
- It adds a new "mon" QemuOpts list for the monitor(s).
- It adds a monitor_parse() function to parse the -monitor switch.
- It adds a mon_init function to initialize the monitor(s) from the
"mon" QemuOpts list.
- It winds up everything and removes the old bits.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:49 +0000 (13:11 +0100)]
un-static qemu_chr_parse_compat()
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:48 +0000 (13:11 +0100)]
default devices: drives
Add a default_drive variable which specified whenever the default drives
(cdrom, floppy, sd) should be created. It is cleared when the new
-nodefaults switch is specified on the command line.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:47 +0000 (13:11 +0100)]
default devices: network
Add a default_net variable which specified whenever a default network
should be created. It is cleared in case any -net option is specified
and it is also added to the new -nodefaults switch.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:46 +0000 (13:11 +0100)]
default devices: add global cmd line option.
Add global command line option to disable default devices.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:45 +0000 (13:11 +0100)]
default devices: vga adapter.
Qemu creates a vga display for you in case you didn't specify one on the
command line. Right now this is tied to the '-vga <type>' command line
switch, which in turn causes trouble if you are creating your gfx card
using '-device VGA,<props>'.
This patch adds a variable default_vga which says whenever a default
serial line should be added. It is enabled by default. It is cleared
when qemu finds '-vga' or '-device {VGA,Cirrus VGA,QEMUware SVGA}' on
the command line.
'-device VGA' still doesn't work though due to a initialization order
issue (vga must init before calling i440fx_init_memory_mappings).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:44 +0000 (13:11 +0100)]
zap serial_monitor_mux
The logic in this code obviously predates the multiple monitor
capability of qemu and looks increasingly silly these days.
I think the intention of this piece of code is to get a reasonable
default for the -nographic case: have monitor and serial line muxed
on stdio.
With the new default_serial and default_monitor variables we have now
doing just that became much easier ;)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:43 +0000 (13:11 +0100)]
default devices: qemu monitor.
This patch makes the monitor default device configuration work like the
default serial and parallel port devices. It adds a variable
default_monitor which says whenever a default monitor should be added.
It is enabled by default. It is cleared when qemu finds '-monitor' on
the command line.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:42 +0000 (13:11 +0100)]
default devices: parallel port.
Qemu creates a default parallel port for you in case you didn't specify
one on the command line. Right now this is tied to the '-parallel
<chardev>' command line switch, which in turn causes trouble if you are
creating your parallel port via '-device isa-parallel,<props>'.
This patch adds a variable default_parallel which says whenever a default
parallel port should be added. It is enabled by default. It is cleared
when qemu finds '-parallel' or '-device isa-parallel' on the command line.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:41 +0000 (13:11 +0100)]
default devices: core code & serial lines.
Qemu creates a default serial line for you in case you didn't specify
one on the command line. Right now this is tied to the '-serial
<chardev>' command line switch, which in turn causes trouble if you are
creating your serial line via '-device isa-serial,<props>'.
This patch adds a variable default_serial which says whenever a default
serial line should be added. It is enabled by default. It is cleared
when qemu finds '-serial' or '-device isa-serial' on the command line.
Part of the patch is some infrastructure for the '-device $driver'
checking (default_driver_check function) which will also be used by the
other patches of this series.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:40 +0000 (13:11 +0100)]
vc: colorize chardev title line with blue background.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:39 +0000 (13:11 +0100)]
chardev: move greeting into vc backend.
Make the 'vc' chardev backend print a title line with the chardev name
after initialization, using CharDriverState->label.
This replaces the banner printing code in vl.c.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:38 +0000 (13:11 +0100)]
Revert "Set default console to virtio on S390x"
This reverts commit
93d434b4aec0702b87ebf52449a3cdf2c3596825.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:37 +0000 (13:11 +0100)]
Revert "monitor: Command-line flag to enable control mode"
This reverts commit
adcb181afe5a951c521411c7a8e9d9b791aa6742.
Conflicts:
monitor.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:36 +0000 (13:11 +0100)]
chardev: make chardevs specified in config file work.
The patch decuples the -chardev switch and the actual chardev
initialization. Without this patch qemu ignores chardev entries
coming via -readconfig.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:35 +0000 (13:11 +0100)]
qdev: also match bus name for global properties
i.e. -global PCI.<property>=<value> will set a default property for all
PCI devices. Also works for the compat properties used by machine
types.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>