Anthony Liguori [Mon, 18 Jun 2012 15:35:13 +0000 (10:35 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp:
build: install qmp-commands.txt
Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events
Add event notification for guest balloon changes
Fix some more license versions (GPL2+ instead of GPL2)
monitor: Fix memory leak with readline completion
qmp: do not include monitor.h from qapi-types-core.h
qmp: include monitor.h when needed
kvm: add missing include files
Anthony Liguori [Mon, 18 Jun 2012 15:34:59 +0000 (10:34 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony: (39 commits)
qemu-iotests: add 036 autoclear feature bit test
qemu-iotests: add qcow2.py set-feature-bit command
fdc-test: introduced qtest read_without_media
fdc: fix implied seek while there is no media in drive
qcow2: fix autoclear image header update
xen: Don't peek behind the BlockDriverState abstraction
xen: Don't change -drive if=xen device name during machine init
block: Replace bdrv_get_format() by bdrv_get_format_name()
qemu-img: document qed format on qemu-img man page
qemu-iotests: COW with many AIO requests on the same cluster
qemu-iotests: Some backing file COW tests
qcow2: Fix avail_sectors in cluster allocation code
qcow2: Simplify calculation for COW area at the end
qcow2: always operate caches in writeback mode
ide: support enable/disable write cache
block: always open drivers in writeback mode
block: add bdrv_set_enable_write_cache
block: copy enable_write_cache in bdrv_append
savevm: flush after saving vm state
block: flush in writethrough mode after writes
...
Anthony Liguori [Mon, 18 Jun 2012 15:18:44 +0000 (10:18 -0500)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
* mst/tags/for_anthony:
pci_bridge_dev: fix error path in pci_bridge_dev_initfn()
qdev: release parent properties on dc->init failure
msi: Use msi/msix_present more consistently
msi: Invoke msi/msix_write_config from PCI core
msi: Guard msi/msix_write_config with msi_present
msi: Invoke msi/msix_reset from PCI core
msi: Guard msi_reset with msi_present
ahci: Clean up reset functions
intel-hda: Fix reset of MSI function
ahci: Fix reset of MSI function
rtl8139: honor RxOverflow flag in can_receive method
shpc: unparent device before free
Anthony Liguori [Mon, 18 Jun 2012 15:18:26 +0000 (10:18 -0500)]
Merge remote-tracking branch 'sweil/for-anthony' into staging
* sweil/for-anthony:
Fix some more license versions (GPL2+ instead of GPL2)
dump: Fix license version (GPL2+ instead of GPL2)
configure: Fix build for some versions of glibc (9pfs)
monitor: Fix memory leak with readline completion
malc [Fri, 15 Jun 2012 16:58:54 +0000 (20:58 +0400)]
audio/winwave: Fix typo
Signed-off-by: malc <av1474@comtv.ru>
Bruce Rogers [Wed, 13 Jun 2012 22:29:17 +0000 (16:29 -0600)]
build: install qmp-commands.txt
File is targeted for install, but is never installed.
Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Daniel P. Berrange [Thu, 14 Jun 2012 17:12:57 +0000 (18:12 +0100)]
Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events
Allow certain event types to be rate limited to avoid flooding
monitor clients. The monitor_protocol_event() method is changed
such that instead of immediately emitting the event to Monitor
instances, it will call a new monitor_protocol_event_queue()
method.
This will check to see if the rate limit for the event has been
exceeded, and if so schedule a timer to wakeup at the end of the
rate limit period. If further events arrive before the timer fires,
the previously queued event will be discarded in favour of the new
event. The event will eventually be emitted when the timer fires.
This logic is applied to RTC_CHANGE, BALLOON_CHANGE & WATCHDOG
events, since the data associated with these events is stateless
* monitor.c: Add support for rate limiting
* monitor.h: Define monitor_global_init for one-time setup tasks
* vl.c: Invoke monitor_global_init
* trace-events: Add hooks for monitor event tracing
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Daniel P. Berrange [Thu, 14 Jun 2012 17:12:56 +0000 (18:12 +0100)]
Add event notification for guest balloon changes
After setting a balloon target value, applications have to
continually poll 'query-balloon' to determine whether the
guest has reacted to this request. The virtio-balloon backend
knows exactly when the guest has reacted though, and thus it
is possible to emit a JSON event to tell the mgmt application
whenever the guest balloon changes.
This introduces a new 'qemu_balloon_changed()' API which is
to be called by balloon driver backends, whenever they have
a change in balloon value. This takes the 'actual' balloon
value, as would be found in the BalloonInfo struct.
The qemu_balloon_change API emits a JSON monitor event which
looks like:
{"timestamp": {"seconds":
1337162462, "microseconds": 814521},
"event": "BALLOON_CHANGE", "data": {"actual":
944766976}}
* balloon.c, balloon.h: Introduce qemu_balloon_changed() for
emitting balloon change events on the monitor
* hw/virtio-balloon.c: Invoke qemu_balloon_changed() whenever
the guest changes the balloon actual value
* monitor.c, monitor.h: Define QEVENT_BALLOON_CHANGE
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Stefan Weil [Mon, 11 Jun 2012 05:49:18 +0000 (07:49 +0200)]
Fix some more license versions (GPL2+ instead of GPL2)
Cc: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Stefan Weil [Mon, 14 May 2012 19:47:20 +0000 (21:47 +0200)]
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>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Paolo Bonzini [Thu, 7 Jun 2012 02:02:22 +0000 (04:02 +0200)]
qmp: do not include monitor.h from qapi-types-core.h
The comment is stale, monitor.h is not needed anymore (only qerror.h
is, because it contains the schema for errors).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Paolo Bonzini [Thu, 7 Jun 2012 02:02:21 +0000 (04:02 +0200)]
qmp: include monitor.h when needed
This is needed to get file descriptors from SCM_RIGHTS.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Paolo Bonzini [Thu, 7 Jun 2012 02:02:20 +0000 (04:02 +0200)]
kvm: add missing include files
These are included via monitor.h right now, add them explicitly.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Stefan Hajnoczi [Thu, 14 Jun 2012 12:58:18 +0000 (13:58 +0100)]
qemu-iotests: add 036 autoclear feature bit test
This new test validates the autoclear feature bit behavior. When QEMU
opens a qcow2v3 image file with an unknown autoclear feature bit the bit
should be cleared in the image file header.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Stefan Hajnoczi [Thu, 14 Jun 2012 12:58:17 +0000 (13:58 +0100)]
qemu-iotests: add qcow2.py set-feature-bit command
This new command sets feature bits in the image file header:
qcow2.py set-feature-bit incompatible|compatible|autoclear <bit>
The bit number must be in the range [0, 64).
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Pavel Hrdina [Wed, 13 Jun 2012 13:43:12 +0000 (15:43 +0200)]
fdc-test: introduced qtest read_without_media
If you try to read from a floppy drive without a media, you should get
an abnormal termination error.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Pavel Hrdina [Wed, 13 Jun 2012 13:43:11 +0000 (15:43 +0200)]
fdc: fix implied seek while there is no media in drive
The Windows uses 'READ' command at the start of an instalation
without checking the 'dir' register. We have to abort the transfer
with an abnormal termination if there is no media in the drive.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Stefan Hajnoczi [Thu, 14 Jun 2012 10:42:23 +0000 (11:42 +0100)]
qcow2: fix autoclear image header update
The autoclear feature bits can be used for qcow2 file format features
that are safe to "drop" by old programs that do not understand the
feature. Upon opening the image file unknown autoclear feature bits are
cleared and the image file header is rewritten, but this was happening
too early in the code when critical header fields were not yet loaded.
Process autoclear feature bits after all necessary header information
has been loaded.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Wed, 13 Jun 2012 08:11:50 +0000 (10:11 +0200)]
xen: Don't peek behind the BlockDriverState abstraction
First offender is xen_config_dev_blk()'s use of disk->bdrv->filename.
Get the filename from disk->opts instead. Same result, except for
snapshots: there, we now get the filename specified by the user
instead of the name of the temporary image created by bdrv_open().
Should be an improvement.
Second offender is blk_init()'s use of blkdev->bs->drv->format_name.
Simply use the appropriate interface to get the format name.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Wed, 13 Jun 2012 08:11:49 +0000 (10:11 +0200)]
xen: Don't change -drive if=xen device name during machine init
A "top" BlockDriverState has a non-empty device_name. If the user
doesn't specify one with -drive parameter id, the system supplies a
default name.
xen_config_dev_blk() changes this name, during machine initialization.
Naughty. Don't do that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Wed, 13 Jun 2012 08:11:48 +0000 (10:11 +0200)]
block: Replace bdrv_get_format() by bdrv_get_format_name()
So callers don't need to know anything about maximum name length.
Returning a pointer is safe, because the name string lives as long as
the block driver it names, and block drivers don't die.
Requested by Peter Maydell.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Stefan Hajnoczi [Wed, 13 Jun 2012 13:29:15 +0000 (14:29 +0100)]
qemu-img: document qed format on qemu-img man page
The qemu-img.1 man page is missing the qed format from its list of
supported formats. Document the image creation options for qed.
Suggested-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Wed, 13 Jun 2012 15:15:14 +0000 (17:15 +0200)]
qemu-iotests: COW with many AIO requests on the same cluster
This one is a bit more interesting. The COW operation isn't performed
completely synchronously, and therefore dependencies must be handled
correctly when multiple requests write to the same unallocated cluster.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Kevin Wolf [Wed, 13 Jun 2012 14:01:31 +0000 (16:01 +0200)]
qemu-iotests: Some backing file COW tests
Looks like we're still missing these very basic tests for backing file
handling.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Kevin Wolf [Tue, 22 May 2012 15:01:20 +0000 (17:01 +0200)]
qcow2: Fix avail_sectors in cluster allocation code
avail_sectors should really be the number of sectors from the start of
the allocation, not from the start of the write request.
We're lucky enough that this mistake didn't cause any real bug.
avail_sectors is only used in the intialiser of QCowL2Meta:
.nb_available = MIN(requested_sectors, avail_sectors),
m->nb_available in turn is only used for COW at the end of the
allocation. A COW occurs only if the request wasn't cluster aligned,
which in turn would imply that requested_sectors was less than
avail_sectors (both in the original and in the fixed version). In this
case avail_sectors is ignored and therefore the mistake doesn't cause
any misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Tue, 22 May 2012 14:58:48 +0000 (16:58 +0200)]
qcow2: Simplify calculation for COW area at the end
copy_sectors() always uses the sum (cluster_offset + n_start) or
(start_sect + n_start), so if some value is added to both cluster_offset
and start_sect, and subtracted from n_start, it's cancelled out anyway.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:55 +0000 (00:04 +0200)]
qcow2: always operate caches in writeback mode
Writethrough does not need special-casing anymore in the qcow2 caches.
The block layer adds flushes after every guest-initiated data write,
and these will also flush the qcow2 caches to the OS.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:54 +0000 (00:04 +0200)]
ide: support enable/disable write cache
Enabling or disabling the write cache is done with the SET FEATURES
command. The command can be issued with sg_sat_set_features from
sg3-utils.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:53 +0000 (00:04 +0200)]
block: always open drivers in writeback mode
Formats are entirely in charge of flushes for metadata writes. For
guest-initiated writes, a writethrough cache is faked in the block layer.
So we can always open in writeback mode.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:52 +0000 (00:04 +0200)]
block: add bdrv_set_enable_write_cache
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:51 +0000 (00:04 +0200)]
block: copy enable_write_cache in bdrv_append
Because the guest will be able to flip enable_write_cache, the actual
state may not match what is used to open the new snapshot.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:50 +0000 (00:04 +0200)]
savevm: flush after saving vm state
Writing vm state uses bdrv_pwrite, so it will automatically get flushes
in writethrough mode. But doing a flush at the end in writeback mode
is probably a good idea anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:49 +0000 (00:04 +0200)]
block: flush in writethrough mode after writes
We want to make the formats handle their own flushes
autonomously, while keeping for guests the ability to use a writethrough
cache. Since formats will write metadata via bs->file, bdrv_co_do_writev
is the only place where we need to add a flush.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Wed, 6 Jun 2012 14:23:27 +0000 (16:23 +0200)]
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>
Paolo Bonzini [Wed, 6 Jun 2012 14:23:26 +0000 (16:23 +0200)]
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>
Markus Armbruster [Tue, 5 Jun 2012 14:49:25 +0000 (16:49 +0200)]
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>
Markus Armbruster [Tue, 5 Jun 2012 14:49:24 +0000 (16:49 +0200)]
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>
Pavel Dovgaluk [Wed, 30 May 2012 06:08:04 +0000 (10:08 +0400)]
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>
Markus Armbruster [Tue, 5 Jun 2012 12:52:53 +0000 (14:52 +0200)]
block: Simplify how drive_init() computes default ID
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
MORITA Kazutaka [Wed, 30 May 2012 00:03:55 +0000 (09:03 +0900)]
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>
Josh Durgin [Thu, 17 May 2012 20:42:29 +0000 (13:42 -0700)]
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>
Kevin Wolf [Fri, 11 May 2012 16:18:36 +0000 (18:18 +0200)]
qcow2: Support for fixing refcount inconsistencies
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Fri, 11 May 2012 16:16:54 +0000 (18:16 +0200)]
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>
Kevin Wolf [Fri, 11 May 2012 14:07:02 +0000 (16:07 +0200)]
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>
Markus Armbruster [Fri, 11 May 2012 15:22:19 +0000 (17:22 +0200)]
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>
Max Filippov [Fri, 8 Jun 2012 09:50:34 +0000 (13:50 +0400)]
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>
Paolo Bonzini [Wed, 9 May 2012 14:09:46 +0000 (16:09 +0200)]
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>
Paolo Bonzini [Tue, 8 May 2012 14:52:01 +0000 (16:52 +0200)]
stream: move is_allocated_above to block.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 8 May 2012 14:52:00 +0000 (16:52 +0200)]
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>
Paolo Bonzini [Wed, 9 May 2012 14:49:58 +0000 (16:49 +0200)]
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>
Zhi Yong Wu [Sat, 28 Apr 2012 07:38:08 +0000 (15:38 +0800)]
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>
Zhi Yong Wu [Sat, 28 Apr 2012 07:37:42 +0000 (15:37 +0800)]
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>
malc [Fri, 15 Jun 2012 11:53:34 +0000 (15:53 +0400)]
Merge branch 'master' of git://git.qemu.org/qemu
Kevin Wolf [Fri, 15 Jun 2012 11:43:18 +0000 (13:43 +0200)]
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>
Lars Persson [Thu, 14 Jun 2012 14:23:55 +0000 (16:23 +0200)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:51 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:49 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:48 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:47 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:46 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:45 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:44 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:43 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:42 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:41 +0000 (14:46 +1000)]
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>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:50 +0000 (14:46 +1000)]
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>
Andreas Färber [Sat, 9 Jun 2012 01:54:31 +0000 (03:54 +0200)]
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>
Andreas Färber [Sat, 9 Jun 2012 01:54:30 +0000 (03:54 +0200)]
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>
Andreas Färber [Sat, 9 Jun 2012 01:54:29 +0000 (03:54 +0200)]
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>
Edgar E. Iglesias [Tue, 5 Jul 2011 10:56:41 +0000 (12:56 +0200)]
cris: Add break support for v10.
Still no retb
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Stefan Weil [Sun, 10 Jun 2012 19:49:18 +0000 (19:49 +0000)]
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>
Stefan Weil [Sun, 10 Jun 2012 19:34:04 +0000 (19:34 +0000)]
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>
Stefan Weil [Wed, 6 Jun 2012 19:35:57 +0000 (19:35 +0000)]
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>
Stefan Weil [Mon, 14 May 2012 09:47:20 +0000 (09:47 +0000)]
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>
Jason Baron [Thu, 3 May 2012 02:42:15 +0000 (22:42 -0400)]
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>
Jason Baron [Thu, 3 May 2012 02:42:10 +0000 (22:42 -0400)]
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>
Anthony Liguori [Mon, 11 Jun 2012 17:15:52 +0000 (12:15 -0500)]
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
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
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
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
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
...
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
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
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
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
Anthony Liguori [Mon, 11 Jun 2012 17:07:00 +0000 (12:07 -0500)]
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
...
Jan Kiszka [Wed, 6 Jun 2012 14:28:42 +0000 (16:28 +0200)]
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>
Jan Beulich [Mon, 11 Jun 2012 09:52:27 +0000 (09:52 +0000)]
qemu/xendisk: set maximum number of grants to be used
Legacy (non-pvops) gntdev drivers may require this to be done when the
number of grants intended to be used simultaneously exceeds a certain
driver specific default limit.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Jim Meyering [Thu, 10 May 2012 16:19:47 +0000 (18:19 +0200)]
kvm/apic: correct short memset
kvm_put_apic_state's attempt to clear *kapic before setting its
bits cleared sizeof(void*) bytes (no more than 8) rather than the
intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Andreas Färber [Thu, 3 May 2012 02:32:00 +0000 (04:32 +0200)]
target-s390x: Pass S390CPU to s390_cpu_restart()
Needed for qemu_cpu_kick().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Thu, 3 May 2012 02:28:14 +0000 (04:28 +0200)]
s390-virtio: Let s390_cpu_addr2state() return S390CPU
Convert ipi_states to S390CPU**.
Needed for s390_cpu_restart() in handle_sigp().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Thu, 3 May 2012 02:16:07 +0000 (04:16 +0200)]
s390-virtio: Use cpu_s390x_init() to obtain S390CPU
Needed to store S390CPU in ipi_states[].
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Thu, 3 May 2012 02:13:04 +0000 (04:13 +0200)]
target-s390x: Let cpu_s390x_init() return S390CPU
Let cpu_init() return CPUS390XState for backwards compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Tue, 22 May 2012 23:51:57 +0000 (01:51 +0200)]
xen_machine_pv: Use cpu_x86_init() to obtain X86CPU
Needed for moving halted field to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Andreas Färber [Mon, 14 May 2012 02:21:52 +0000 (04:21 +0200)]
arm_pic: Pass ARMCPU to arm_pic_init_cpu()
Pass it through to arm_pic_cpu_handler().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)
Andreas Färber [Mon, 14 May 2012 00:39:57 +0000 (02:39 +0200)]
arm_boot: Pass ARMCPU to arm_load_kernel()
In particular this simplifies the &s->mpu->cpu->env expression again.
first_cpu and ->next_cpu are expected to be QOM'ified later.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Mon, 14 May 2012 00:55:25 +0000 (02:55 +0200)]
xilinx_zynq: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_load_kernel().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com>
Andreas Färber [Thu, 3 May 2012 22:23:14 +0000 (00:23 +0200)]
pxa2xx_gpio: Store ARMCPU in PXA2xxGPIOInfo
Prepares for moving halted field into CPUState.
Add missing braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Thu, 3 May 2012 22:05:29 +0000 (00:05 +0200)]
pxa2xx_pic: Store ARMCPU in PXA2xxPICState
Prepares for moving halted field to CPUState.
Add missing braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Thu, 3 May 2012 22:01:27 +0000 (00:01 +0200)]
pxa2xx: Pass ARMCPU to pxa2xx_pic_init()
Cleans up after storing ARMCPU in PXA2xxState.
Prepares for storing ARMCPU in PXA2xxPICState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Mon, 14 May 2012 02:09:55 +0000 (04:09 +0200)]
exynos4210: Use cpu_arm_init() to store ARMCPU
Needed for arm_pic_init_cpu().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
Andreas Färber [Mon, 14 May 2012 01:58:46 +0000 (03:58 +0200)]
vexpress: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_pic_init_cpu().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Mon, 14 May 2012 01:50:56 +0000 (03:50 +0200)]
realview: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_pic_init_cpu().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:05:40 +0000 (01:05 +0200)]
arm_boot: Pass ARMCPU to arm_boot_info::secondary_cpu_reset_hook()
Adapt highbank accordingly.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>