Commit graph

20561 commits

Author SHA1 Message Date
Paolo Bonzini 0fd05e8dd1 qemu-iotests: start vms in qtest mode
This way, they will not execute any VM code at all.  However, right now
the cancellation test is "relying" on being slowed down by TCG executing
BIOS code.  So, change the timeouts.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:43 +02:00
Paolo Bonzini ab68cdfaa9 qemu-iotests: fill streaming test image with data
The TestStreamStop test case is racy; if the job completes before we can
cancel it, it fails.  If we remove the sleep the job will be canceled
before it has even started, and the test succeeds but it is also not
testing anything interesting.

But if the image is left sparse, then the job has really nothing to do.
For qcow2 it will read one L2-table, for raw it will issue a bunch of
ioctls.  This also falls under "not testing anything interesting", and
this may be happening right now (depending on the filesystem) since the
file protocol got an is_allocated method.

Filling the test image with data ensures that the test covers the
intended case.  It also slows down the test, which will be particularly
important after the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:43 +02:00
Markus Armbruster 137745c5c6 scsi-disk: Don't peek behind the BlockDriverState abstraction
Use the appropriate interface instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:43 +02:00
Markus Armbruster c843328783 block: New bdrv_get_flags()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:43 +02:00
Pavel Dovgaluk b75a02829d Prevent disk data loss when closing qemu
Prevent disk data loss when closing qemu console window
under Windows 7.

v3. Comment for Sleep() parameter was updated.

Signed-off-by: Pavel Dovgalyuk<pavel.dovgaluk@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Markus Armbruster 79d21d5b8d block: Simplify how drive_init() computes default ID
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
MORITA Kazutaka e0d93a89b9 sheepdog: add coroutine_fn markers to coroutine functions
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Josh Durgin b11f38fcdf rbd: hook up cache options
Writeback caching was added in Ceph 0.46, and writethrough will be in
0.47. These are controlled by general config options, so there's no
need to check for librbd version.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Kevin Wolf 166acf546f qcow2: Support for fixing refcount inconsistencies
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Kevin Wolf ccf34716ee qemu-img check: Print fixed clusters and recheck
When any inconsistencies have been fixed, print the statistics and run
another check to make sure everything is correct now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Kevin Wolf 4534ff5426 qemu-img check -r for repairing images
The QED block driver already provides the functionality to not only
detect inconsistencies in images, but also fix them. However, this
functionality cannot be manually invoked with qemu-img, but the
check happens only automatically during bdrv_open().

This adds a -r switch to qemu-img check that allows manual invocation
of an image repair.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Markus Armbruster dfc65f1f78 Un-inline fdctrl_init_isa()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Max Filippov 8aab031fc6 xtensa_lx60: add missing #include "blockdev.h"
This should fix the following build failure:

/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c: In function 'lx_init':
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: implicit declaration of function 'drive_get'
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: nested extern declaration of 'drive_get'
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: 'IF_PFLASH' undeclared (first use in this function)
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: (Each undeclared identifier is reported only once
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: for each function it appears in.)
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:216: error: dereferencing pointer to incomplete type

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Paolo Bonzini 6ef228fc0d stream: move rate limiting to a separate header file
Make the code reusable.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Paolo Bonzini 188a7bbf94 stream: move is_allocated_above to block.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Paolo Bonzini f9749f28b7 stream: tweak usage of bdrv_co_is_allocated
is_allocated_base has complex semantics that are not really usable
outside streaming.  Split the check in two parts, where the allocated
state for the top bs is moved to the caller.  The resulting function
is more generally useful.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Paolo Bonzini 5500316ded block: implement is_allocated for raw
Either FIEMAP, or SEEK_DATA+SEEK_HOLE can be used to implement the
is_allocated callback for raw files.  On Linux ext4, btrfs and XFS
all support it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Zhi Yong Wu 87267753a3 qcow2: fix endianness conversion
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
Zhi Yong Wu 833e40858c qcow2: remove a line of unnecessary code
Commit 3948d1d4 removed the pointer argument we filled in with l2_offset
but forgot to remove the unnecessary l2_offset assignment.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15 14:03:42 +02:00
malc 63bb682a18 Merge branch 'master' of git://git.qemu.org/qemu 2012-06-15 15:53:34 +04:00
Kevin Wolf 1417d7e40e qcow2: Silence false warning
Some gcc versions seem not to be able to figure out that the switch
statement covers all possible values and that c is therefore always
initialised. Add a default branch for them.

Reported-by: malc <av1474@comtv.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
2012-06-15 15:52:45 +04:00
Lars Persson 8219314be6 cris: Fix NMI-flag handling on crisv10.
- The M-flag is encoded in different bits on cris v10 and cris v32.

Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:21:32 +02:00
Peter A. G. Crosthwaite da9fa17ee9 xilinx_axidma: changed device name
Changed device name to xlnx,axi-dma. This is the exact name of the device in the
Xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite cec6f8ca5b xilinx_axienet: changed device name
Changed device name to xlnx,axi-ethernet. This is the exact name of the
device in the xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite ab034c26de xilinx_axienet: droped the c_ on parameters
Even though the xilinx tools do have C_ on all params by default, drop this
for consistency with all the other xilinx IP (I.E. param names are the xilinx
names without the C_ prefix)

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite 7f4d67552e xilinx_ethlite: changed device name
Changed device name to xlnx,xps-ethernetlite. This is the exact name of the
device in the xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite b2d85c3492 xilinx_ethlite: tweaked naming of ping-pong props
Changed "txpingpong" prop to "tx-ping-pong". Same for rx. This is done to
make the property name exactly match what is output by the xilinx tools for
this IP.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite 24739ab4bb xilinx_intc: changed device name
Changed device name to xlnx,xps-intc. This is the exact name of the device
in the xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite a61e4b07a3 xilinx_timer: changed device name
Changed device name to xlnx,xps-timer. This is the exact name of the device
in the xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite abe098e4f9 xilinx_timer: changed nr_timers to one_timer_only
The configurable property for this IP in the Xilinx tools is a boolean switch
"one-timer-only" that flicks this timer from being dual channel to single.
Updated QEMU to work the same way for better match with the IP core and its TRM.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite 8d4eb373f7 xilinx_timer: added default frequency
Added a reasonable default frequency for the xilinx timer (the 62MHz from
s3adsp machine model).

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite 23d6055eb4 xilinx_uartlite: changed device name
Changed device name to xlnx,xps-uartlite. This is the exact name of the device
in the xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Peter A. G. Crosthwaite d85ba787c5 xilinx_axidma: (un)reversed irq initialisation
The axidma irq orders are reversed in both the device model and the instantion.
Undid both reversal (for no net change). Also needs to be reversed for
consistency with Xilinx tools IRQ listing.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:08:13 +02:00
Andreas Färber 07f9fd4864 xilinx_axi*: Share devices between microblaze and microblazeel
Speeds up the build.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 12:44:27 +02:00
Andreas Färber 3b82321090 qemu-log: Allow usage in libhw
Add #ifdef to avoid complaint about use of poisoned "env".

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 12:44:26 +02:00
Andreas Färber 9bbfbb61af hw/xilinx_*: Share Xilinx devices between ppc and microblaze
Speeds up the build.

xilinx_ethlite uses tswap32() and is thus target-dependent.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 12:44:26 +02:00
Edgar E. Iglesias f756c7a723 cris: Add break support for v10.
Still no retb

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2012-06-14 15:29:11 +02:00
Stefan Weil fc0608ac14 Fix some more license versions (GPL2+ instead of GPL2)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
2012-06-11 22:20:21 +02:00
Stefan Weil 352666e2d9 dump: Fix license version (GPL2+ instead of GPL2)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
2012-06-11 22:20:21 +02:00
Stefan Weil acc55ba8b1 configure: Fix build for some versions of glibc (9pfs)
Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH.
Extend the check in configure to test both preconditions.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-06-11 22:20:21 +02:00
Stefan Weil fc9fa4bd0a monitor: Fix memory leak with readline completion
Each string which is shown during readline completion in the QEMU monitor
is allocated dynamically but currently never deallocated.

Add the missing loop which calls g_free for the allocated strings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-06-11 22:20:00 +02:00
Jason Baron 80aa796bf3 pci_bridge_dev: fix error path in pci_bridge_dev_initfn()
Currently, we do not properly cleanup, if pci_bridge_dev_initfn
fails to initialize properly. Make sure to call pci_bridge_exitfn()
in the error path.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-06-11 22:55:13 +03:00
Jason Baron 266ca11a04 qdev: release parent properties on dc->init failure
While looking into hot-plugging bridges, I can create a qemu segfault via:

$ device_add pci-bridge

Bridge chassis not specified. Each bridge is required to be assigned a unique chassis id > 0.
**
ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0)

I'm proposing to fix this by adding a call to 'object_unparent()', before the
call to qdev_free(). I see there is already a precedent for this usage pattern as
seen in qdev_simple_unplug_cb():

/* can be used as ->unplug() callback for the simple cases */
int qdev_simple_unplug_cb(DeviceState *dev)
{
    /* just zap it */
    object_unparent(OBJECT(dev));
    qdev_free(dev);
    return 0;
}

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-06-11 22:55:13 +03:00
Anthony Liguori 7677e24f3d Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
* qemu-kvm/uq/master:
  kvm: i8254: Fix conversion of in-kernel to userspace state
  kvm/apic: correct short memset
2012-06-11 12:15:52 -05:00
Anthony Liguori 248bfdc9f5 Merge remote-tracking branch 'sstabellini/for_1.1.1' into staging
* sstabellini/for_1.1.1:
  qemu/xendisk: set maximum number of grants to be used
2012-06-11 12:15:51 -05:00
Anthony Liguori e4d40816f1 Merge remote-tracking branch 'afaerber-or/qom-cpu-3a' into staging
* afaerber-or/qom-cpu-3a: (27 commits)
  target-s390x: Pass S390CPU to s390_cpu_restart()
  s390-virtio: Let s390_cpu_addr2state() return S390CPU
  s390-virtio: Use cpu_s390x_init() to obtain S390CPU
  target-s390x: Let cpu_s390x_init() return S390CPU
  xen_machine_pv: Use cpu_x86_init() to obtain X86CPU
  arm_pic: Pass ARMCPU to arm_pic_init_cpu()
  arm_boot: Pass ARMCPU to arm_load_kernel()
  xilinx_zynq: Use cpu_arm_init() to obtain ARMCPU
  pxa2xx_gpio: Store ARMCPU in PXA2xxGPIOInfo
  pxa2xx_pic: Store ARMCPU in PXA2xxPICState
  pxa2xx: Pass ARMCPU to pxa2xx_pic_init()
  exynos4210: Use cpu_arm_init() to store ARMCPU
  vexpress: Use cpu_arm_init() to obtain ARMCPU
  realview: Use cpu_arm_init() to obtain ARMCPU
  arm_boot: Pass ARMCPU to arm_boot_info::secondary_cpu_reset_hook()
  arm_boot: Pass ARMCPU to arm_boot_info::write_secondary_boot()
  versatilepb: Use cpu_arm_init() to obtain ARMCPU
  musicpal: Use cpu_arm_init() to obtain ARMCPU
  integratorcp: Use cpu_arm_init() to obtain ARMCPU
  strongarm: Use cpu_arm_init() to store ARMCPU in StrongARMState
  ...
2012-06-11 12:15:51 -05:00
Anthony Liguori df33219191 Merge remote-tracking branch 'afaerber-or/qom-next-1' into staging
* afaerber-or/qom-next-1:
  target-i386: Use uint32 visitor for [x]level properties
  qdev: Remove PropertyInfo range checking
  qdev: Switch property accessors to fixed-width visitor interfaces
  qdev: Use int32_t container for devfn property
  qapi: Add String visitor coverage to serialization unit tests
  qapi: String visitor, use %f representation for floats
  qapi: Unit tests for visitor-based serialization
  qapi: Add Visitor interfaces for uint*_t and int*_t
2012-06-11 12:15:51 -05:00
Anthony Liguori 3525c42fd3 Merge remote-tracking branch 'stefanha/trivial-patches' into staging
* stefanha/trivial-patches:
  configure: report missing libraries for virtfs
  trace/simple.c: fix deprecated glib2 interface
  Clarify comments of tb_invalidate_phys_[page_]range
2012-06-11 12:15:51 -05:00
Anthony Liguori 39cde84517 Merge remote-tracking branch 'kraxel/usb.52' into staging
* kraxel/usb.52: (37 commits)
  ehci: rework frame skipping
  ehci: adaptive wakeup rate.
  ehci: create ehci_update_frindex
  ehci: remove unused attach_poll_counter
  ehci: fix halt status handling
  ehci: update status bits in ehci_set_state
  ehci: add ehci_*_enabled() helpers
  ehci: fix reset
  ehci: kick async schedule on wakeup
  ehci: schedule async bh on async packet completion
  ehci: move async schedule to bottom half
  ehci: add async field to EHCIQueue
  ehci: tweak queue initialization
  ehci: add queuing support
  ehci: move ehci_flush_qh
  ehci: cache USBDevice in EHCIQueue
  ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue
  ehci: add EHCIPacket
  xhci: trace: slots
  xhci: trace: transfers
  ...
2012-06-11 12:07:00 -05:00
Jan Kiszka 0cdd3d1444 kvm: i8254: Fix conversion of in-kernel to userspace state
Due to a offset between the clock used to generate the in-kernel
count_load_time (CLOCK_MONOTONIC) and the clock used for processing this
in userspace (vm_clock), reading back the output of PIT channel 2 via
port 0x61 was broken. One use cases that suffered from it was the CPU
frequency calibration of SeaBIOS, which also affected IDE/AHCI timeouts.

This fixes it by calibrating the offset between both clocks on
kvm_pit_get and adjusting the kernel value before saving it in the
userspace state. As the calibration only works while the vm_clock is
running, we cache the in-kernel state across stopped phases.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-06-11 14:18:23 +03:00