summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-08-15block: Convert open calls to qemu_openCorey Bryant6-28/+26
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>
2012-08-15block: Prevent detection of /dev/fdset/ as floppyCorey Bryant1-1/+3
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-15qapi: Introduce add-fd, remove-fd, query-fdsetsCorey Bryant3-0/+409
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>
2012-08-15qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsgCorey Bryant1-2/+10
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>
2012-08-14Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori25-1792/+1978
* 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
2012-08-14Merge branch 'linux-user.next' of git://git.linaro.org/people/pmaydell/qemu-armBlue Swirl8-92/+206
* '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
2012-08-14linux-user: ARM: Ignore immediate value for svc in thumb modeAlexander Graf1-2/+1
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>
2012-08-14linux-user: Use init_guest_space when -R and -B are specifiedMeador Inge3-44/+56
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>
2012-08-14linux-user: Factor out guest space probing into a functionMeador Inge2-33/+90
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>
2012-08-14flatload: fix bss clearingMike Frysinger1-1/+1
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>
2012-08-14linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_typeJing Huang1-4/+16
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>
2012-08-14linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket optionJing Huang1-0/+20
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>
2012-08-14linux-user: pass sockaddr from host to targetJing Huang1-3/+13
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>
2012-08-14x86: switch to AREG0 free modeBlue Swirl11-200/+151
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>
2012-08-14x86: avoid AREG0 in segmentation helpersBlue Swirl4-160/+150
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>
2012-08-14x86: avoid AREG0 for misc helpersBlue Swirl4-83/+84
Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-14x86: use wrappers for memory access helpersBlue Swirl3-103/+126
Switch to wrapped versions of memory access functions. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-14x86: avoid AREG0 for SMM helpersBlue Swirl4-13/+6
Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-14x86: avoid AREG0 for SVM helpersBlue Swirl4-115/+110
Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-14x86: avoid AREG0 for integer helpersBlue Swirl5-71/+88
Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-14x86: avoid AREG0 for condition code helpersBlue Swirl10-169/+179
Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-14x86: avoid AREG0 for FPU helpersBlue Swirl8-876/+968
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>
2012-08-14Merge remote-tracking branch 'kraxel/seabios-5a02306' into stagingAnthony Liguori2-0/+0
* kraxel/seabios-5a02306: update seabios to latest master
2012-08-14MAINTAINERS: Update email address for Stefan HajnocziStefan Hajnoczi1-2/+2
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>
2012-08-13Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori35-1119/+689
* 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 ...
2012-08-13Merge remote-tracking branch 'quintela/migration-next-20120808' into stagingAnthony Liguori16-13/+1451
* 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
2012-08-13Merge remote-tracking branch 'pmaydell/arm-devs.next' into stagingAnthony Liguori8-57/+104
* 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
2012-08-13target-ppc: add implementation of query-cpu-definitions (v2)Anthony Liguori1-0/+26
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-08-13target-i386: add implementation of query-cpu-definitions (v2)Anthony Liguori1-0/+22
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-08-13qapi: add query-cpu-definitions command (v2)Anthony Liguori3-0/+35
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>
2012-08-13compiler: add macro for GCC weak symbolsAnthony Liguori1-0/+1
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>
2012-08-13qapi: add query-machines commandAnthony Liguori3-0/+65
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>
2012-08-13qapi: mark QOM commands stableAnthony Liguori1-15/+4
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>
2012-08-13qmp: introduce device-list-properties commandAnthony Liguori3-0/+85
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>
2012-08-13qmp: add SUSPEND_DISK eventLuiz Capitulino4-0/+18
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>
2012-08-13qmp: qmp-events.txt: add missing doc for the SUSPEND eventLuiz Capitulino1-0/+12
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-13qmp: qmp-events.txt: put events in alphabetical orderLuiz Capitulino1-136/+130
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-13qmp: emit the WAKEUP event when the guest is put to runLuiz Capitulino2-1/+14
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>
2012-08-13qmp: don't emit the RESET event on wakeup from S3Luiz Capitulino1-1/+15
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>
2012-08-13scripts: qapi-commands.py: qmp-commands.h: include qdict.hLuiz Capitulino1-0/+1
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>
2012-08-13docs: writing-qmp-commands.txt: update error sectionLuiz Capitulino1-20/+27
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>
2012-08-13error, qerror: drop QDict memberLuiz Capitulino3-9/+0
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>
2012-08-13qerror: drop qerror_table and qerror_format()Luiz Capitulino2-407/+0
They are unused since last commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2012-08-13error, qerror: pass desc string to error callsLuiz Capitulino4-119/+77
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>
2012-08-13error: drop error_get_qobject()/error_set_qobject()Luiz Capitulino4-50/+0
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>
2012-08-13qemu-ga: switch to the new error format on the wireLuiz Capitulino4-3/+13
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>
2012-08-13qmp: switch to the new error format on the wireLuiz Capitulino4-69/+18
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>
2012-08-13error: drop unused functionsLuiz Capitulino3-65/+0
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>
2012-08-13hmp: hmp_change(): use error_get_class()Luiz Capitulino1-1/+2
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>
2012-08-13error: add error_get_class()Luiz Capitulino2-0/+10
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>