summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* blockdev: rename block_stream_cb to a generic block_job_cbJeff Cody2012-09-282-4/+4
| | | | | | Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: add live block commit functionalityJeff Cody2012-09-284-0/+286
| | | | | | | | | | | | | | | This adds the live commit coroutine. This iteration focuses on the commit only below the active layer, and not the active layer itself. The behaviour is similar to block streaming; the sectors are walked through, and anything that exists above 'base' is committed back down into base. At the end, intermediate images are deleted, and the chain stitched together. Images are restored to their original open flags upon completion. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: add support functions for live commit, to find and delete images.Jeff Cody2012-09-282-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | Add bdrv_find_overlay(), and bdrv_drop_intermediate(). bdrv_find_overlay(): given 'bs' and the active (topmost) BDS of an image chain, find the image that is the immediate top of 'bs' bdrv_drop_intermediate(): Given 3 BDS (active, top, base), drop images above base up to and including top, and set base to be the backing file of top's overlay node. E.g., this converts: bottom <- base <- intermediate <- top <- active to bottom <- base <- active Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Support GlusterFS as a QEMU block backend.Bharata B Rao2012-09-282-0/+625
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds gluster as the new block backend in QEMU. This gives QEMU the ability to boot VM images from gluster volumes. Its already possible to boot from VM images on gluster volumes using FUSE mount, but this patchset provides the ability to boot VM images from gluster volumes by by-passing the FUSE layer in gluster. This is made possible by using libgfapi routines to perform IO on gluster volumes directly. VM Image on gluster volume is specified like this: file=gluster[+transport]://[server[:port]]/volname/image[?socket=...] 'gluster' is the protocol. 'transport' specifies the transport type used to connect to gluster management daemon (glusterd). Valid transport types are tcp, unix and rdma. If a transport type isn't specified, then tcp type is assumed. 'server' specifies the server where the volume file specification for the given volume resides. This can be either hostname, ipv4 address or ipv6 address. ipv6 address needs to be within square brackets [ ]. If transport type is 'unix', then 'server' field should not be specifed. The 'socket' field needs to be populated with the path to unix domain socket. 'port' is the port number on which glusterd is listening. This is optional and if not specified, QEMU will send 0 which will make gluster to use the default port. If the transport type is unix, then 'port' should not be specified. 'volname' is the name of the gluster volume which contains the VM image. 'image' is the path to the actual VM image that resides on gluster volume. Examples: file=gluster://1.2.3.4/testvol/a.img file=gluster+tcp://1.2.3.4/testvol/a.img file=gluster+tcp://1.2.3.4:24007/testvol/dir/a.img file=gluster+tcp://[1:2:3:4:5:6:7:8]/testvol/dir/a.img file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir/a.img file=gluster+tcp://server.domain.com:24007/testvol/dir/a.img file=gluster+unix:///testvol/dir/a.img?socket=/tmp/glusterd.socket file=gluster+rdma://1.2.3.4:24007/testvol/a.img Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* configure: Add a config option for GlusterFS as block backendBharata B Rao2012-09-281-0/+35
| | | | | | | | GlusterFS support in QEMU depends on libgfapi, libgfrpc and libgfxdr provided by GlusterFS. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* aio: Another fix to the walking_handlers logicPaolo Bonzini2012-09-281-5/+5
| | | | | | | | | The AIO dispatch loop will call QLIST_REMOVE and g_free even if there are other pending calls to qemu_aio_wait outside the current one. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu: URI parsing libraryPaolo Bonzini2012-09-283-1/+2363
| | | | | | | | | Add a new URI parsing library to QEMU. The code has been borrowed from libxml2 and libvirt. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* aio: Fix qemu_aio_wait() to maintain correct walking_handlers countPaolo Bonzini2012-09-281-4/+4
| | | | | | | | | | Fix qemu_aio_wait() to ensure that registered aio handlers don't get deleted when they are still active. This is ensured by maintaning the right count of walking_handlers. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: after creating a live snapshot, make old image read-onlyJeff Cody2012-09-281-0/+5
| | | | | | | | | | | | | | Currently, after a live snapshot of a drive, the image that has been 'demoted' to be below the new active layer remains r/w. This patch reopens it read-only. Note that we do not check for error on the reopen(), because we will not abort the snapshots if the reopen fails. This patch depends on the bdrv_reopen() series. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block-migration: Flush requests in blk_mig_cleanupKevin Wolf2012-09-281-0/+2
| | | | | | | | | When cancelling block migration, all in-flight requests of the block migration must be completed before the data can be freed. This was visible as failing assertions and segfaults. Reported-by: Peter Lieven <pl@dlhnet.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge branch 'arm-devs.for-upstream' of ↵Aurelien Jarno2012-09-273-14/+40
|\ | | | | | | | | | | | | | | | | | | git://git.linaro.org/people/pmaydell/qemu-arm * 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm: Versatile Express: Add modelling of NOR flash Versatile Express: Fix NOR flash 0 address and remove flash alias hw/armv7m_nvic: Correctly register GIC region when setting up NVIC pl190: fix read of VECTADDR
| * Versatile Express: Add modelling of NOR flashFrancesco Lavra2012-09-261-2/+24
| | | | | | | | | | | | | | | | | | This patch adds modelling of the two NOR flash banks found on the Versatile Express motherboard. Tested with U-Boot running on an emulated Versatile Express, with either A9 or A15 CoreTile. Signed-off-by: Francesco Lavra <francescolavra.fl@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * Versatile Express: Fix NOR flash 0 address and remove flash aliasFrancesco Lavra2012-09-261-5/+2
| | | | | | | | | | | | | | | | | | | | | | In the A series memory map (implemented in the Cortex A15 CoreTile), the first NOR flash bank (flash 0) is mapped to address 0x08000000, while address 0x00000000 can be configured as alias to either the first or the second flash bank. This patch fixes the definition of flash 0 address, and for simplicity removes the alias definition. Signed-off-by: Francesco Lavra <francescolavra.fl@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/armv7m_nvic: Correctly register GIC region when setting up NVICMeador Inge2012-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When setting up the NVIC memory regions the memory range 0x100..0xcff is aliased to an IO memory region that belongs to the ARM GIC. This aliased region should be added to the NVIC memory container, but the actual GIC IO memory region was being added instead. This mixup was causing the wrong IO memory access functions to be called when accessing parts of the NVIC memory. Signed-off-by: Meador Inge <meadori@codesourcery.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * pl190: fix read of VECTADDRBrendan Fennell2012-09-261-6/+12
| | | | | | | | | | | | | | | | | | | | Reading VECTADDR was causing us to set the current priority to the wrong value, the most obvious effect of which was that we would return the vector for the wrong interrupt as the result of the read. Signed-off-by: Brendan Fennell <bfennell@skynet.ie> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | target-s390x: Tidy cpu_dump_stateRichard Henderson2012-09-271-12/+10
| | | | | | | | | | | | | | | | | | | | | | The blank lines inside the single dump make it difficult for the eye to pick out the block. Worse, with interior newlines, but no blank line following, the PSW line appears to belong to the next dump block. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-s390x: Avoid double CPU_LOG_TB_CPURichard Henderson2012-09-271-1/+0
| | | | | | | | | | | | | | | | This is already handled generically in cpu_exec. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-s390x: Use CPU_LOG_INTRichard Henderson2012-09-272-4/+6
| | | | | | | | | | | | | | | | Three places in the interrupt code did we not honor the mask. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-unicore32: Call tcg_gen_debug_insn_startRichard Henderson2012-09-271-0/+4
| | | | | | | | | | | | Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-s390x: Call tcg_gen_debug_insn_startRichard Henderson2012-09-271-4/+5
| | | | | | | | | | | | Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-m68k: Call tcg_gen_debug_insn_startRichard Henderson2012-09-271-0/+4
| | | | | | | | | | | | Cc: Paul Brook <paul@codesourcery.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | Emit debug_insn for CPU_LOG_TB_OP_OPT as well.Richard Henderson2012-09-2712-12/+18
| | | | | | | | | | | | | | | | | | | | | | For all targets that currently call tcg_gen_debug_insn_start, add CPU_LOG_TB_OP_OPT to the condition that gates it. This is useful for comparing optimization dumps, when the pre-optimization dump is merely noise. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | tci: Fix for AREG0 free modeStefan Weil2012-09-272-9/+14
|/ | | | | | | | | | | | Support for helper functions with 5 arguments was missing in the code generator and in the interpreter. There is no need to pass the constant TCG_AREG0 from the code generator to the interpreter. Remove that code for the INDEX_op_qemu_st* opcodes. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* add a boot parameter to set reboot timeoutAmos Kong2012-09-254-4/+39
| | | | | | | | | | | | | | | | | | | | | Added an option to let qemu transfer a configuration file to bios, "etc/boot-fail-wait", which could be specified by command -boot reboot-timeout=T T have a max value of 0xffff, unit is ms. With this option, guest will wait for a given time if not find bootabled device, then reboot. If reboot-timeout is '-1', guest will not reboot, qemu passes '-1' to bios by default. This feature need the new seabios's support. Seabios pulls the value from the fwcfg "file" interface, this interface is used because SeaBIOS needs a reliable way of obtaining a name, value size, and value. It in no way requires that there be a real file on the user's host machine. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Clear handler only for valid fdOrit Wasserman2012-09-251-1/+3
| | | | | Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix address handling in inet_nonblocking_connectOrit Wasserman2012-09-254-58/+126
| | | | | | | | | | | | | | | | | getaddrinfo can give us a list of addresses, but we only try to connect to the first one. If that fails we never proceed to the next one. This is common on desktop setups that often have ipv6 configured but not actually working. To fix this make inet_connect_nonblocking retry connection with a different address. callers on inet_nonblocking_connect register a callback function that will be called when connect opertion completes, in case of failure the fd will have a negative value Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Separate inet_connect into inet_connect (blocking) and inet_nonblocking_connectOrit Wasserman2012-09-256-16/+57
| | | | | | | | No need to add non blocking parameters to the blocking inet_connect add block parameter for inet_connect_opts instead of using QemuOpt "block". Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Refactor inet_connect_opts functionMichael S. Tsirkin2012-09-251-63/+85
| | | | | | | | | | refactor address resolution code to fix nonblocking connect remove getnameinfo call Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* configure: Allow builds without any system or user emulationStefan Weil2012-09-252-4/+5
| | | | | | | | | | | | | The old code aborted configure when no emulation target was selected. Even after removing the 'exit 1', it tried to read from STDIN when QEMU was configured with configure' '--disable-user' '--disable-system' This is fixed here. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ivshmem: add 64bit optionGerd Hoffmann2012-09-252-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a "use64" property which will make the ivshmem driver register a 64bit memory bar when set, so you have something to play with when testing 64bit pci bits. It also allows to have quite big shared memory regions, like this: [root@fedora ~]# lspci -vs1:1 01:01.0 RAM memory: Red Hat, Inc Device 1110 Subsystem: Red Hat, Inc Device 1100 Physical Slot: 1-1 Flags: fast devsel Memory at fd400000 (32-bit, non-prefetchable) [disabled] [size=256] Memory at 8040000000 (64-bit, prefetchable) [size=1G] [ v5: rebase, update compat property for post-1.2 merge ] [ v4: rebase & adapt to latest master again ] [ v3: rebase & adapt to latest master ] [ v2: default to on as suggested by avi, turn off for pc-$old using compat property ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* compat: turn off msi/msix on xhci for old machine typesGerd Hoffmann2012-09-251-0/+16
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add pc-1.3 machine typeGerd Hoffmann2012-09-251-2/+10
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Cleanup unused global var qemu_system_powerdownIgor Mammedov2012-09-252-6/+7
| | | | | | | | All deps that used global qemu_system_powerdown var are now converted to notifiers, so remove it. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* target-sparc: use notifier for signaling guest system_powerdown commandIgor Mammedov2012-09-251-1/+13
| | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* target-arm: use notifier for signaling guest system_powerdown commandIgor Mammedov2012-09-251-1/+13
| | | | | | Acked-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi: use notifier for signaling guest system_powerdown commandIgor Mammedov2012-09-251-3/+5
| | | | | | | | | In addition, there is no need to allocate an extra irq just for rising SCI in irq handler. Just rise SCI right from notifier handler instead. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce powerdown_notifiersIgor Mammedov2012-09-252-0/+9
| | | | | | | | | | Notifier will be used for signaling powerdown request to guest in a more general way and intended to replace very specific qemu_irq_rise(qemu_system_powerdown) and will allow to remove global variable qemu_system_powerdown. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori2012-09-257-66/+188
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: tcg/i386: fix build with -march < i686 tcg: Streamline movcond_i64 using movcond_i32 tcg: Streamline movcond_i64 using 32-bit arithmetic tcg: Sanity check goto_tb input tcg: Sanity check deposit inputs tcg: Add tcg_debug_assert tcg: Implement concat*_i64 with deposit_i64 tcg: Emit XORI as NOT for appropriate constants tcg: Optimize initial inputs for ori_i64 tcg: Emit ANDI as EXTU for appropriate constants tcg: Adjust descriptions of *cond opcodes tcg/mips: fix MIPS32(R2) detection
| * tcg/i386: fix build with -march < i686Aurelien Jarno2012-09-261-0/+2
| | | | | | | | | | | | | | | | | | | | The movcond_i32 op has to be protected with TCG_TARGET_HAS_movcond_i32 to fix the build with -march < i686. Thanks to Richard Henderson for the hint. Reported-by: Alex Barcelo <abarcelo@ac.upc.edu> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Streamline movcond_i64 using movcond_i32Richard Henderson2012-09-261-7/+15
| | | | | | | | | | | | | | | | | | When movcond_i32 is available we can further reduce the generated op count from 12 to 6, and the generated code size on i686 from 88 to 74 bytes. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Streamline movcond_i64 using 32-bit arithmeticRichard Henderson2012-09-261-0/+20
| | | | | | | | | | | | | | | | | | Avoiding 64-bit arithmetic (outside of the compare) reduces the generated op count from 15 to 12, and the generated code size on i686 from 105 to 88 bytes. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Sanity check goto_tb inputRichard Henderson2012-09-263-2/+14
| | | | | | | | | | | | | | | | | | | | Checking that we don't try for idx != [01] is trivial. Checking that we don't issue more than one of any index requires a tad more data and some ifdefs protecting that new variable. Signed-off-by: Richard Henderson <rth@twiddle.net> Cc: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Sanity check deposit inputsRichard Henderson2012-09-261-0/+8
| | | | | | | | | | | | | | | | Given these are constants, checking once here means everything after can assume they're correct. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Add tcg_debug_assertRichard Henderson2012-09-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Like the C assert macro, except only enabled for CONFIG_DEBUG_TCG, and without having to set _NDEBUG and disable all other asserts at the same time. The use of __builtin_unreachable (when available) gives the compiler the same information, which may (or may not) help it optimize better. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Implement concat*_i64 with deposit_i64Richard Henderson2012-09-261-30/+30
| | | | | | | | | | | | | | | | | | | | | | For tcg_gen_concat_i32_i64 we only use deposit if the host supports it. For tcg_gen_concat32_i64 even if the host does not, as we get identical code before and after. Note that this relies on the ANDI -> EXTU patch for the identity claim. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Emit XORI as NOT for appropriate constantsRichard Henderson2012-09-261-4/+15
| | | | | | | | | | | | | | | | Note that xori_i64 failed to perform even the minimal optimizations promised by the README. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Optimize initial inputs for ori_i64Richard Henderson2012-09-261-6/+13
| | | | | | | | | | | | | | Copy the same optimizations from ori_i32. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Emit ANDI as EXTU for appropriate constantsRichard Henderson2012-09-261-11/+56
| | | | | | | | | | | | | | | | Note that andi_i64 failed to perform even the minimal optimizations promised by the README. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg: Adjust descriptions of *cond opcodesRichard Henderson2012-09-261-5/+5
| | | | | | | | | | | | | | | | | | | | The README file documented the operand ordering of the tcg_gen_* functions. Since we're documenting opcodes here, use the true operand ordering. Signed-off-by: Richard Henderson <rth@twiddle.net> Cc: malc <av1474@comtv.ru> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * tcg/mips: fix MIPS32(R2) detectionAurelien Jarno2012-09-262-9/+9
| | | | | | | | | | | | | | | | Fix the MIPS32(R2) cpu detection so that it also works with -march=octeon. Thanks to Andrew Pinski for the hint. Cc: Andrew Pinski <apinski@cavium.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
OpenPOWER on IntegriCloud