Anthony Liguori [Wed, 15 Aug 2012 18:25:47 +0000 (13:25 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony:
qemu-iotests: Fix 030 after switch to GenericError
block: Flush parent to OS with cache=unsafe
iscsi: Fix NULL dereferences / races between task completion and abort
monitor: Clean up fd sets on monitor disconnect
block: Enable qemu_open/close to work with fd sets
block: Convert close calls to qemu_close
block: Convert open calls to qemu_open
block: Prevent detection of /dev/fdset/ as floppy
qapi: Introduce add-fd, remove-fd, query-fdsets
qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg
Anthony Liguori [Wed, 15 Aug 2012 16:15:02 +0000 (11:15 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
* qemu-kvm/uq/master:
update-linux-headers.sh: Pull in asm-generic/kvm_para.h
kvmvapic: Disable if there is insufficient memory
kvm: i8254: Finish time conversion fix
kvm: i8254: Cache kernel clock offset in KVMPITState
Anthony Liguori [Wed, 15 Aug 2012 16:14:06 +0000 (11:14 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging
* stefanha/tracing:
trace/simple: Replace asprintf by g_strdup_printf
trace/simple: Fix compiler warning for 32 bit hosts
trace: avoid pointer aliasing in trace_record_finish()
trace: drop unused TraceBufferRecord->next_tbuf_idx field
trace: remove unnecessary write_to_buffer() typecasting
trace: rename TraceRecordHeader to TraceLogHeader
Kevin Wolf [Wed, 15 Aug 2012 12:08:56 +0000 (14:08 +0200)]
qemu-iotests: Fix 030 after switch to GenericError
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Kevin Wolf [Wed, 15 Aug 2012 10:52:45 +0000 (12:52 +0200)]
block: Flush parent to OS with cache=unsafe
Commit
29cdb251 already added a comment that no unnecessary flushes to
disk will occur, this patch makes the code even get to the point of the
comment. This is mostly theoretical because in practice we only stack
one format on top of one protocol, the former implementing flush_to_os
and the latter only flush_to_disk. It starts to matter when drivers that
are not on top implement flush_to_os.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Stefan Priebe [Wed, 15 Aug 2012 07:09:54 +0000 (09:09 +0200)]
iscsi: Fix NULL dereferences / races between task completion and abort
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
Acked-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:48 +0000 (16:43 -0400)]
monitor: Clean up fd sets on monitor disconnect
Fd sets are shared by all monitor connections. Fd sets are considered
to be in use while at least one monitor is connected. When the last
monitor disconnects, all fds that are members of an fd set with no
outstanding dup references are closed. This prevents any fd leakage
associated with a client disconnect prior to using a passed fd.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:47 +0000 (16:43 -0400)]
block: Enable qemu_open/close to work with fd sets
When qemu_open is passed a filename of the "/dev/fdset/nnn"
format (where nnn is the fdset ID), an fd with matching access
mode flags will be searched for within the specified monitor
fd set. If the fd is found, a dup of the fd will be returned
from qemu_open.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:46 +0000 (16:43 -0400)]
block: Convert close calls to qemu_close
This patch converts all block layer close calls, that correspond
to qemu_open calls, to qemu_close.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:45 +0000 (16:43 -0400)]
block: Convert open calls to qemu_open
This patch converts all block layer open calls to qemu_open.
Note that this adds the O_CLOEXEC flag to the changed open paths
when the O_CLOEXEC macro is defined.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:44 +0000 (16:43 -0400)]
block: Prevent detection of /dev/fdset/ as floppy
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:43 +0000 (16:43 -0400)]
qapi: Introduce add-fd, remove-fd, query-fdsets
This patch adds support that enables passing of file descriptors
to the QEMU monitor where they will be stored in specified file
descriptor sets.
A file descriptor set can be used by a client like libvirt to
store file descriptors for the same file. This allows the
client to open a file with different access modes (O_RDWR,
O_WRONLY, O_RDONLY) and add/remove the passed fds to/from an fd
set as needed. This will allow QEMU to (in a later patch in this
series) "open" and "reopen" the same file by dup()ing the fd in
the fd set that corresponds to the file, where the fd has the
matching access mode flag that QEMU requests.
The new QMP commands are:
add-fd: Add a file descriptor to an fd set
remove-fd: Remove a file descriptor from an fd set
query-fdsets: Return information describing all fd sets
Note: These commands are not compatible with the existing getfd
and closefd QMP commands.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Corey Bryant [Tue, 14 Aug 2012 20:43:42 +0000 (16:43 -0400)]
qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg
Set the close-on-exec flag for the file descriptor received
via SCM_RIGHTS.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Peter Maydell [Wed, 25 Jul 2012 15:29:07 +0000 (16:29 +0100)]
update-linux-headers.sh: Pull in asm-generic/kvm_para.h
Add asm-generic/kvm_para.h to the set of non-architecture specific
KVM kernel headers we copy into QEMU. This header may be included
by an architecture's kvm_para.h header.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Tue, 14 Aug 2012 11:43:12 +0000 (13:43 +0200)]
kvmvapic: Disable if there is insufficient memory
We need at least 1M of RAM to map the option ROM. Otherwise, we will
corrupt host memory or even crash:
$ qemu-system-x86_64 -nodefaults --enable-kvm -vnc :0 -m 640k
Segmentation fault (core dumped)
Reported-and-tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Tue, 14 Aug 2012 08:24:47 +0000 (10:24 +0200)]
kvm: i8254: Finish time conversion fix
0cdd3d1444 fixed reading back the counter load time from the kernel
while assuming the kernel would always update its load time on writing
the state. That is only true for channel 1, and so pit_get_channel_info
returned wrong output pin states for high counter values.
Fix this by applying the offset also on kvm_pit_put. Now we also need to
update the offset when we write the state while the VM is stopped as it
keeps on changing in that state.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Tue, 14 Aug 2012 08:24:03 +0000 (10:24 +0200)]
kvm: i8254: Cache kernel clock offset in KVMPITState
To prepare the final fix for clock calibration issues with the in-kernel
PIT, we want to cache the offset between vmclock and the clock used by
the in-kernel PIT. So far, we only need to update it when the VM state
changes between running and stopped because we only read the in-kernel
PIT state while the VM is running.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Anthony Liguori [Tue, 14 Aug 2012 20:19:50 +0000 (15:19 -0500)]
Merge remote-tracking branch 'origin/master' into staging
* origin/master:
linux-user: ARM: Ignore immediate value for svc in thumb mode
linux-user: Use init_guest_space when -R and -B are specified
linux-user: Factor out guest space probing into a function
flatload: fix bss clearing
linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type
linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option
linux-user: pass sockaddr from host to target
x86: switch to AREG0 free mode
x86: avoid AREG0 in segmentation helpers
x86: avoid AREG0 for misc helpers
x86: use wrappers for memory access helpers
x86: avoid AREG0 for SMM helpers
x86: avoid AREG0 for SVM helpers
x86: avoid AREG0 for integer helpers
x86: avoid AREG0 for condition code helpers
x86: avoid AREG0 for FPU helpers
linux-user: Move target_to_host_errno_table[] setup out of ioctl loop
linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions
linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
Blue Swirl [Tue, 14 Aug 2012 19:50:22 +0000 (19:50 +0000)]
Merge branch 'linux-user.next' of git://git.linaro.org/people/pmaydell/qemu-arm
* 'linux-user.next' of git://git.linaro.org/people/pmaydell/qemu-arm:
linux-user: ARM: Ignore immediate value for svc in thumb mode
linux-user: Use init_guest_space when -R and -B are specified
linux-user: Factor out guest space probing into a function
flatload: fix bss clearing
linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type
linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option
linux-user: pass sockaddr from host to target
linux-user: Move target_to_host_errno_table[] setup out of ioctl loop
linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions
linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
Alexander Graf [Tue, 29 May 2012 05:30:26 +0000 (05:30 +0000)]
linux-user: ARM: Ignore immediate value for svc in thumb mode
When running in thumb mode, Linux doesn't evaluate the immediate value
of the svc instruction, but instead just always assumes the syscall number
to be in r7.
This fixes executing go_bootstrap while building go for me.
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Meador Inge [Thu, 26 Jul 2012 16:50:02 +0000 (16:50 +0000)]
linux-user: Use init_guest_space when -R and -B are specified
Roll the code used to initialize the guest memory space when -R
or -B is used into 'init_guest_space' and then call 'init_guest_space'
from the driver. This way the reserved guest memory space can
be probed for. Calling 'mmap' just once as is currently done is not
guaranteed to succeed since the host address space validation might fail.
Signed-off-by: Meador Inge <meadori@codesourcery.com>
[PMM: Fixed minor whitespace errors.]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Meador Inge [Thu, 26 Jul 2012 16:50:01 +0000 (16:50 +0000)]
linux-user: Factor out guest space probing into a function
Signed-off-by: Meador Inge <meadori@codesourcery.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Mike Frysinger [Mon, 9 Jul 2012 03:04:57 +0000 (03:04 +0000)]
flatload: fix bss clearing
The current bss clear logic assumes the target mmap address and host
address are the same. Use g2h to translate from the target address
space to the host so we can call memset on it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Jing Huang [Tue, 24 Jul 2012 14:01:42 +0000 (14:01 +0000)]
linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Jing Huang [Tue, 24 Jul 2012 13:59:23 +0000 (13:59 +0000)]
linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Jing Huang [Tue, 24 Jul 2012 13:58:02 +0000 (13:58 +0000)]
linux-user: pass sockaddr from host to target
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Blue Swirl [Sun, 29 Apr 2012 20:35:48 +0000 (20:35 +0000)]
x86: switch to AREG0 free mode
Add an explicit CPUX86State parameter instead of relying on AREG0.
Remove temporary wrappers and switch to AREG0 free mode.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 19:47:06 +0000 (19:47 +0000)]
x86: avoid AREG0 in segmentation helpers
Add an explicit CPUX86State parameter instead of relying on AREG0.
Rename remains of op_helper.c to seg_helper.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 18:42:47 +0000 (18:42 +0000)]
x86: avoid AREG0 for misc helpers
Add an explicit CPUX86State parameter instead of relying on AREG0.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 19:11:01 +0000 (19:11 +0000)]
x86: use wrappers for memory access helpers
Switch to wrapped versions of memory access functions.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 17:54:21 +0000 (17:54 +0000)]
x86: avoid AREG0 for SMM helpers
Add an explicit CPUX86State parameter instead of relying on AREG0.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 15:51:49 +0000 (15:51 +0000)]
x86: avoid AREG0 for SVM helpers
Add an explicit CPUX86State parameter instead of relying on AREG0.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 14:11:56 +0000 (14:11 +0000)]
x86: avoid AREG0 for integer helpers
Add an explicit CPUX86State parameter instead of relying on AREG0.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sun, 29 Apr 2012 12:45:34 +0000 (12:45 +0000)]
x86: avoid AREG0 for condition code helpers
Add an explicit CPUX86State parameter instead of relying on AREG0.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sat, 28 Apr 2012 21:28:09 +0000 (21:28 +0000)]
x86: avoid AREG0 for FPU helpers
Make FPU helpers take a parameter for CPUState instead
of relying on global env.
Introduce temporary wrappers for FPU load and store ops. Remove
wrappers for non-AREG0 code. Don't call unconverted helpers
directly.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Anthony Liguori [Tue, 14 Aug 2012 18:46:35 +0000 (13:46 -0500)]
Merge remote-tracking branch 'kraxel/seabios-
5a02306' into staging
* kraxel/seabios-
5a02306:
update seabios to latest master
Stefan Hajnoczi [Tue, 14 Aug 2012 09:10:09 +0000 (10:10 +0100)]
MAINTAINERS: Update email address for Stefan Hajnoczi
Switch to my personal email address.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Stefan Weil [Mon, 13 Aug 2012 19:51:16 +0000 (21:51 +0200)]
trace/simple: Replace asprintf by g_strdup_printf
asprintf is not available for all hosts. g_strdup_printf is
more portable and simplifies the code because if does not
need error handling.
The static variable does not need an explicit assignment to be NULL.
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Stefan Weil [Mon, 13 Aug 2012 19:50:56 +0000 (21:50 +0200)]
trace/simple: Fix compiler warning for 32 bit hosts
gcc complains when a 32 bit pointer is casted to a 64 bit integer.
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Harsh Prateek Bora [Fri, 20 Jul 2012 13:22:15 +0000 (18:52 +0530)]
trace: avoid pointer aliasing in trace_record_finish()
Declaring a TraceRecord on the stack works fine. No need for a
uint8_t array and pointer aliasing.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Harsh Prateek Bora [Fri, 20 Jul 2012 13:22:14 +0000 (18:52 +0530)]
trace: drop unused TraceBufferRecord->next_tbuf_idx field
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Harsh Prateek Bora [Fri, 20 Jul 2012 13:22:13 +0000 (18:52 +0530)]
trace: remove unnecessary write_to_buffer() typecasting
The buffer argument is void* so it is not necessary to cast.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Harsh Prateek Bora [Fri, 20 Jul 2012 13:22:12 +0000 (18:52 +0530)]
trace: rename TraceRecordHeader to TraceLogHeader
The TraceRecordHeader is really the header for the entire trace log
file. It's not per-record header so make this obvious by renaming it.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Anthony Liguori [Mon, 13 Aug 2012 21:12:35 +0000 (16:12 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp: (48 commits)
target-ppc: add implementation of query-cpu-definitions (v2)
target-i386: add implementation of query-cpu-definitions (v2)
qapi: add query-cpu-definitions command (v2)
compiler: add macro for GCC weak symbols
qapi: add query-machines command
qapi: mark QOM commands stable
qmp: introduce device-list-properties command
qmp: add SUSPEND_DISK event
qmp: qmp-events.txt: add missing doc for the SUSPEND event
qmp: qmp-events.txt: put events in alphabetical order
qmp: emit the WAKEUP event when the guest is put to run
qmp: don't emit the RESET event on wakeup from S3
scripts: qapi-commands.py: qmp-commands.h: include qdict.h
docs: writing-qmp-commands.txt: update error section
error, qerror: drop QDict member
qerror: drop qerror_table and qerror_format()
error, qerror: pass desc string to error calls
error: drop error_get_qobject()/error_set_qobject()
qemu-ga: switch to the new error format on the wire
qmp: switch to the new error format on the wire
...
Anthony Liguori [Mon, 13 Aug 2012 21:02:11 +0000 (16:02 -0500)]
Merge remote-tracking branch 'quintela/migration-next-
20120808' into staging
* quintela/migration-next-
20120808:
Restart optimization on stage3 update version
Add XBZRLE statistics
Add migration accounting for normal and duplicate pages
Change total_time to total-time in MigrationStats
Add migrate_set_cache_size command
Add XBZRLE to ram_save_block and ram_save_live
Add xbzrle_encode_buffer and xbzrle_decode_buffer functions
Add uleb encoding/decoding functions
Add cache handling functions
Add XBZRLE documentation
Add migrate-set-capabilities
Add migration capabilities
Anthony Liguori [Mon, 13 Aug 2012 20:59:11 +0000 (15:59 -0500)]
Merge remote-tracking branch 'pmaydell/arm-devs.next' into staging
* pmaydell/arm-devs.next:
arm: Move some ARM devices into libhw
ssd0323: abort() instead of exit(1) on error.
hw/sd.c: make sd_wp_addr() return bool
hw/sd.c: make sd_dataready() return bool
hw/sd.c: convert binary variables to bool
hw/sd.c: introduce wrapper for conversion address to wp group
hw/sd.c: make sd_wp_addr() accept 64 bit address argument
hw/sd.c: convert wp_groups in SDState to bitfield
armv7m: Guard against no -kernel argument
hw/armv7m_nvic: Fix incorrect default for num-irqs property
Anthony Liguori [Fri, 10 Aug 2012 16:04:15 +0000 (11:04 -0500)]
target-ppc: add implementation of query-cpu-definitions (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Anthony Liguori [Fri, 10 Aug 2012 16:04:14 +0000 (11:04 -0500)]
target-i386: add implementation of query-cpu-definitions (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Anthony Liguori [Fri, 10 Aug 2012 16:04:13 +0000 (11:04 -0500)]
qapi: add query-cpu-definitions command (v2)
This command attempts to map to the behavior of -cpu ?. Unfortunately, the
output of this command differs wildly across targets.
To accommodate this, we use a weak symbol to implement a default version of the
command that fails with a QERR_NOT_SUPPORTED error code. Targets can then
override and implement this command if it makes sense for them.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Anthony Liguori [Fri, 10 Aug 2012 16:04:12 +0000 (11:04 -0500)]
compiler: add macro for GCC weak symbols
This lets us provide a default implementation of a symbol which targets can
override.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Anthony Liguori [Fri, 10 Aug 2012 16:04:11 +0000 (11:04 -0500)]
qapi: add query-machines command
This provides the same output as -M ? but in a structured way.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Anthony Liguori [Fri, 10 Aug 2012 16:04:10 +0000 (11:04 -0500)]
qapi: mark QOM commands stable
We've had a cycle to tweak. It is time to commit to supporting them.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Anthony Liguori [Fri, 10 Aug 2012 16:04:09 +0000 (11:04 -0500)]
qmp: introduce device-list-properties command
This can be used in conjunction with qom-list-types to determine the supported
set of devices and their parameters.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Luiz Capitulino [Wed, 8 Aug 2012 20:03:01 +0000 (17:03 -0300)]
qmp: add SUSPEND_DISK event
Emitted when the guest makes a request to enter S4 state.
There are three possible ways of having this event, as described here:
http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg02307.html
I've decided to add a new event and make it indepedent of SHUTDOWN.
This means that the SHUTDOWN event will eventually follow the
SUSPEND_DISK event.
I've choosen this way because of two reasons:
1. Having an indepedent event makes it possible to query for its
existence by using query-events
2. In the future, we may allow the user to change what QEMU should
do as a result of the guest entering S4. So it's a good idea to
keep both events separated
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Luiz Capitulino [Thu, 9 Aug 2012 15:02:21 +0000 (12:02 -0300)]
qmp: qmp-events.txt: add missing doc for the SUSPEND event
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Luiz Capitulino [Thu, 9 Aug 2012 14:40:27 +0000 (11:40 -0300)]
qmp: qmp-events.txt: put events in alphabetical order
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Luiz Capitulino [Thu, 9 Aug 2012 14:27:30 +0000 (11:27 -0300)]
qmp: emit the WAKEUP event when the guest is put to run
Today, the WAKEUP event is emitted when a wakeup _request_ is made.
This could be the system_wakeup command, for example.
A better semantic would be to emit the event when the guest is
already running, as that's what matters in the end. This commit does
that change.
In theory, this could break compatibility. In practice, it shouldn't
happen though, as clients shouldn't rely on timing characteristics of
the events. That is, a client relying that the guest is not running
when the event arrives may break if the event arrives after the guest
is already running.
This commit also adds the missing documentation for the WAKEUP event.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Luiz Capitulino [Wed, 8 Aug 2012 20:29:17 +0000 (17:29 -0300)]
qmp: don't emit the RESET event on wakeup from S3
QEMU is basically using reset logic when waking up from S3. This
causes the QMP RESET event to be emitted, which is wrong. Also,
the runstate checks done in reset are not necessary for S3 wakeup.
Fix this by untangling wakeup from reset logic and passing
VMRESET_SILENT to qemu_system_reset() to avoid emitting the RESET
event.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Luiz Capitulino [Mon, 6 Aug 2012 14:35:22 +0000 (11:35 -0300)]
scripts: qapi-commands.py: qmp-commands.h: include qdict.h
qmp-commands.h declares several functions that have arguments of
type QDict. However, qdict.h is not included. This will cause a
build breakage when a file includes qmp-commands.h but doesn't
include qdict.h.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Luiz Capitulino [Mon, 6 Aug 2012 14:35:22 +0000 (11:35 -0300)]
docs: writing-qmp-commands.txt: update error section
Add information about the new error format and improve the text a bit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 1 Aug 2012 21:06:44 +0000 (18:06 -0300)]
error, qerror: drop QDict member
Used to store error information, but it's unused now.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 21:11:16 +0000 (18:11 -0300)]
qerror: drop qerror_table and qerror_format()
They are unused since last commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 20:51:03 +0000 (17:51 -0300)]
error, qerror: pass desc string to error calls
This commit changes all QERR_ macros to contain a human message (ie.
the desc string found in qerr_table[]) instead of a json dictionary
in string format.
Before this commit, error_set() and qerror_report() would receive
a json dictionary in string format and build a qobject from it. Now,
both function receive a human message instead and the qobject is
not built anymore.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 1 Aug 2012 20:59:59 +0000 (17:59 -0300)]
error: drop error_get_qobject()/error_set_qobject()
error_get_qobject() is unused since last commit, error_set_qobject()
has never been used. Also drops error_int.h.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 1 Aug 2012 19:30:13 +0000 (16:30 -0300)]
qemu-ga: switch to the new error format on the wire
IMPORTANT: this BREAKS qemu-ga compatibility for the error response.
Instead of returning something like:
{ "error": { "class": "InvalidParameterValue",
"data": {"name": "mode", "expected": "halt|powerdown|reboot" } } }
qemu-ga now returns:
{ "error": { "class": "GenericError",
"desc": "Parameter 'mode' expects halt|powerdown|reboot" } }
Notice that this is also a bug fix, as qemu-ga wasn't returning the
human message.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 19:18:16 +0000 (16:18 -0300)]
qmp: switch to the new error format on the wire
IMPORTANT: this BREAKS QMP's compatibility for the error response.
This commit changes QMP's wire protocol to make use of the simpler
error format introduced by previous commits.
There are two important (and mostly incompatible) changes:
1. Almost all error classes have been replaced by GenericError. The
only classes that are still supported for compatibility with
libvirt are: CommandNotFound, DeviceNotActive, KVMMissingCap,
DeviceNotFound and MigrationExpected
2. The 'data' field of the error dictionary is gone
As an example, an error response like:
{ "error": { "class": "DeviceNotRemovable",
"data": { "device": "virtio0" },
"desc": "Device 'virtio0' is not removable" } }
Will now be emitted as:
{ "error": { "class": "GenericError",
"desc": "Device 'virtio0' is not removable" } }
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 00:30:40 +0000 (21:30 -0300)]
error: drop unused functions
Besides being unused, they operate on the current error format,
which is going to be replaced soon.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Mon, 6 Aug 2012 18:55:22 +0000 (15:55 -0300)]
hmp: hmp_change(): use error_get_class()
The error_is_type() function is going to be dropped.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 1 Aug 2012 19:29:38 +0000 (16:29 -0300)]
error: add error_get_class()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 18:50:19 +0000 (15:50 -0300)]
qerror: add proper ErrorClass value for QERR_ macros
This commit replaces the place holder value for the ErrorClass
argument with a proper ErrorClass value for all QERR_ macros.
All current errors are mapped to GenericError, except for errors
CommandNotFound, DeviceEncrypted, DeviceNotActive, DeviceNotFound,
KVMMissingCap and MigrationExpected, which are maintained as they
are today.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 17:09:29 +0000 (14:09 -0300)]
error, qerror: add ErrorClass argument to error functions
The new argument is added to functions qerror_report() and error_set().
It's stored in Error and QError. qerror_report_err() is also updated to
take care of it.
The QERR_ macros are changed to contain a place holder value for the
new argument, so that the value is used on all current calls to
qerror_report() and error_set() (and also to initialize qerror_table[]).
Next commit will update the QERR_ macros with a proper ErrorClass
value.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 16:58:30 +0000 (13:58 -0300)]
qerror: qerror_table: don't use C99 struct initializers
This allows for changing QERR_ macros to initialize two struct members
at the same time. See next commit for more details.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 12:34:50 +0000 (09:34 -0300)]
qapi-schema: add ErrorClass enum
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 12:38:05 +0000 (09:38 -0300)]
qapi: don't convert enum strings to lowercase
Next commit will introduce enum strings in camel case.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 18:44:25 +0000 (15:44 -0300)]
qapi: generate correct enum names for camel case enums
An enum like GenericError in the schema, should generate
GENERIC_ERROR and not GENERICERROR.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 13:56:33 +0000 (10:56 -0300)]
qapi: qapi-types.h: don't include qapi/qapi-types-core.h
qapi-types.h needs only qemu-common.h. Including qapi-types-core.h
causes problems when qerror.h or error.h includes qapi-types.h.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 13:55:29 +0000 (10:55 -0300)]
hmp: hmp.h: include qdict.h
hmp.h is relying on qdict.h being provided by qapi-types.h. Fix this,
as a future commit will change qapi-types.h not to provide qdict.h.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 27 Jul 2012 13:52:18 +0000 (10:52 -0300)]
block: block_int: include qerror.h
Several block/ files are relying on qerror.h being provided by
qapi-types.h. Fix this, as a future commit will change qapi-types.h
not to provide qerror.h.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 1 Aug 2012 17:26:53 +0000 (14:26 -0300)]
qerror: drop QERR_SOCKET_CONNECT_IN_PROGRESS
Unused since last commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Mon, 6 Aug 2012 19:26:47 +0000 (16:26 -0300)]
migration: don't rely on any QERR_SOCKET_*
Use the in_progress argument for QERR_SOCKET_CONNECT_IN_PROGRESS. The
other errors are handled the same by checking if the error is set and
then calling migrate_fd_error() if it's.
It's also necessary to change inet_connect_opts() not to set
QERR_SOCKET_CONNECT_IN_PROGRESS. This error is only used by
tcp_start_outgoing_migration() and not changing it along with the
usage of in_progress would break migration.
Furthermore this commit fixes a bug. Today, there's a spurious error
report when migration succeeds:
(qemu) migrate tcp:0:4444
migrate: Connection can not be completed immediately
(qemu)
After this commit no spurious error is reported anymore.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 1 Aug 2012 16:42:47 +0000 (13:42 -0300)]
net: inet_connect(), inet_connect_opts(): add in_progress argument
It's used to indicate the special case where a valid file-descriptor
is returned (ie. success) but the connection can't be completed
w/o blocking.
This is needed because QERR_SOCKET_CONNECT_IN_PROGRESS is not
treated like an error and a future commit will drop it.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Mon, 6 Aug 2012 18:49:34 +0000 (15:49 -0300)]
hmp_change(): don't access DeviceEncrypted's data
It's not needed. As the device name is already known, we can replace
the duplicated password prompting code by monitor_read_block_device_key().
This overly simplifies hmp_change().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Thu, 26 Jul 2012 23:41:53 +0000 (20:41 -0300)]
hmp: hmp_cont(): don't rely on QERR_DEVICE_ENCRYPTED
This commit changes hmp_cont() to loop through all block devices
and proactively set an encryption key for any encrypted device
missing a key.
This change is needed because QERR_DEVICE_ENCRYPTED is going to be
dropped by a future commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Thu, 26 Jul 2012 23:28:44 +0000 (20:28 -0300)]
qmp: query-block: add 'encryption_key_missing' field
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 20 Jul 2012 16:43:37 +0000 (13:43 -0300)]
error: don't delay error message construction
Today, the error message is only constructed when it's used. This commit
changes that to construct the error message when the error object is
built (ie. when the error is reported).
This simplifies the Error object.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 20 Jul 2012 15:02:58 +0000 (12:02 -0300)]
qerror: don't delay error message construction
Today, the error message is only constructed when it's used. This commit
changes qerror to construct the error message when the error object is
built (ie. when the error is reported).
This eliminates the need of storing a pointer to qerror_table[], which
will be dropped soon, and also simplifies the code.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 20 Jul 2012 16:30:18 +0000 (13:30 -0300)]
qerror: qerror_format(): return an allocated string
Simplifies current and future users.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 20 Jul 2012 14:08:17 +0000 (11:08 -0300)]
qerror: QError: drop file, linenr, func
They have never been fully used and conflict with future error
improvements.
Also makes qerror_report() a proper function, as there's no point
in having it as a macro anymore.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Tue, 31 Jul 2012 18:41:13 +0000 (15:41 -0300)]
qerror: avoid passing qerr pointer
Helps dropping/modifying qerror functions.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Fri, 20 Jul 2012 13:35:18 +0000 (10:35 -0300)]
qerror: drop qerror_abort()
qerror_abort() depends on the 'file', 'func' and 'linenr' members of
QError. However, these members are going to be dropped by the next
commit, so let's drop qerror_abort() in favor of printing an error
message to stderr plus a call to abort().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Thu, 19 Jul 2012 20:29:34 +0000 (17:29 -0300)]
qerror: reduce public exposure
qerror will be dropped in a near future, let's reduce its public
exposure by making functions only used in qerror.c static.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 25 Jul 2012 16:16:53 +0000 (13:16 -0300)]
qerror: QERR_DEVICE_ENCRYPTED: change error message
Match what HMP commands print on DeviceEncrypted errors.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Wed, 25 Jul 2012 16:18:41 +0000 (13:18 -0300)]
qerror: QERR_AMBIGUOUS_PATH: drop %(object) from human msg
Actually, renames it to 'object'. This must be what the original author
meant to write, as there's no 'object' in the error's data member.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Luiz Capitulino [Thu, 19 Jul 2012 22:34:38 +0000 (19:34 -0300)]
monitor: drop unused monitor debug code
In the old QMP days, this code was used to find out QMP commands that
might be calling monitor_printf() down its call chain.
This is almost impossible to happen today, because the qapi converted
commands don't even have a monitor object. Besides, it's been more than
a year since I used this last time.
Let's just drop it.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Andreas Färber [Mon, 13 Aug 2012 02:11:12 +0000 (02:11 +0000)]
arm: Move some ARM devices into libhw
Avoids some unnecessary dependencies on cpu.h and prepares for
a future armeb-softmmu where most machines would not be built.
Defer touching the SoC devices since most have implicit or explicit
dependencies on the CPU.
Signed-off-by: Andreas Färber <andreas.faerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Anthony Liguori [Mon, 13 Aug 2012 14:25:48 +0000 (09:25 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
* qemu-kvm/uq/master:
kvm: Add documentation comment for kvm_irqchip_in_kernel()
kvm: Decouple 'GSI routing' from 'kernel irqchip'
kvm: Decouple 'MSI routing via irqfds' from 'kernel irqchip'
kvm: Decouple 'irqfds usable' from 'kernel irqchip'
kvm: Move kvm_allows_irq0_override() to target-i386, fix return type
kvm: Rename kvm_irqchip_set_irq() to kvm_set_irq()
kvm: Decouple 'async interrupt delivery' from 'kernel irqchip'
configure: Don't implicitly hardcode list of KVM architectures
kvm: Check if smp_cpus exceeds max cpus supported by kvm
Peter Maydell [Mon, 23 Jul 2012 08:07:22 +0000 (08:07 +0000)]
linux-user: Move target_to_host_errno_table[] setup out of ioctl loop
The code to initialise the target_to_host_errno_table[] array was
accidentally inside the loop through checking and initialising all
the supported ioctls. This was harmless but meant that we reinitialised the
array several hundred times on startup.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter Maydell [Mon, 23 Jul 2012 08:06:15 +0000 (08:06 +0000)]
linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions
Fix the SNDCTL_DSP_MAP{IN,OUT}BUF ioctl definitions so that they
refer to a suitably defined target struct layout rather than hardcoding
the ioctl number. This fixes complaints from the syscall_init()
consistency check when running an x86_64-to-x86_64 linux-user qemu.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter Maydell [Mon, 23 Jul 2012 08:05:20 +0000 (08:05 +0000)]
linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
The definitions for the ioctl numbers TARGET_BLKBSZGET and
TARGET_BLKBSZSET had the wrong size parameters (they are defined
with size_t, not int, even though the ioctl implementations themselves
read and write integers). Since commit
354a0008 we now have an
ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64
linux-user binary we were triggering the mismatch warning in
syscall_init().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Mon, 13 Aug 2012 10:04:07 +0000 (11:04 +0100)]
ssd0323: abort() instead of exit(1) on error.
To be more consistent with the newer ways of error signalling. That and SIGABT
is easier to debug with than exit(1).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>