Makefile: Remove macro qapi-dir
As qapi-dir was now a constant, it can be replaced by its value.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Install 'bepo' keymap already included in Qemu source
The 'bepo' layout (a french dvorak-like keyboard layout) was addedabout one year ago, (see commit 2a3c633c1eb8692716220195b6d3fe78b7e411d0),but I missed to declare to install it.
Signed-off-by: Frédéric Boiteux <fboiteux@free.fr>...
Makefile: Remove BUILD_DIR from qapi-dir
qapi-dir does not need an absolute path. All other build directoriesare relative. When BUILD_DIR is removed, the build output looks better(no long lines with absolute paths when everything else uses shortlines):...
libcacard: build fixes
Link trace objects to fix these errors: LINK vscclientoslib-posix.o: In function `trace_qemu_vfree':/src/qemu/obj-amd64/./trace.h:39: undefined reference to `trace1'oslib-posix.o: In function `trace_qemu_memalign':/src/qemu/obj-amd64/./trace.h:31: undefined reference to `trace3'...
qtest: add a fuzz test to fdc-test
Add a simple register fuzzing test to floppy controller tests.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: use LOG_UNIMP logging
Convert uses of FLOPPY_ERROR to either FLOPPY_DPRINTF(for implemented cases) or to use LOG_UNIMP (unimplemented).
qemu-log: use LOG_UNIMP for some target CPU cases
Use LOG_UNIMP for some target CPU cases.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Acked-by: Alexander Graf <agraf@suse.de>
qemu-log: add log category for unimplemented functionality
Add new log category (LOG_UNIMP) for unimplemented functionality.
qemu-log: cleanup
Don't use global variables directly but via accessor functions. Rename globals.
Convert macros to functions, add GCC format attributes.
qemu-log: move logging to qemu-log.c
Move logging functions from exec.c to qemu-log.c,compile it only once.
xilinx_timer: Removed include of qemu-timer
The Xilinx timer does not interact with the qemu_timer API, so dont include it.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx_timer: Fixed deadlock issue
The timer was deadlocking when the interval was set too low. It would cause aflood of timer events and the CPU would halt indefinately. This is a known issueand theres a generic workaround in place in ptimer on ptimer_set_limit(),...
Add PIIX4 properties to control PM system states.
This patch adds two things. First it allows QEMU to distinguish betweenregular powerdown and S4 powerdown. Later separate QMP notification willbe added for S4 powerdown. Second it allows S3/S4 states to be disabled...
Allow machines to configure the QEMU_VERSION that's exposed via hardware
QEMU exposes its version to the guest's hardware and in some cases that is wrong(e.g. Windows prints messages about driver updates when you switchthe QEMU version).There is a new field now on the struct QEmuMachine, hw_version, which may...
make: automatically include dependencies in recursive subdir rules (v2)
I think I understand enough of what's going on in these rules to ensure this isright. But I could certainly use a second or third opinion...
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
configure: fix -enable-debug with newer toolchains
Fedora 17's toolchain wants optimization enabled for _FORTIFY_SOURCE;so disable _FORTIFY_SOURCE when debugging.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'afaerber-or/qom-next-2' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
Merge remote-tracking branch 'sweil/for-anthony' into staging
qdev: Remove qdev_prop_set_defaults
Instead, qdev_property_add_static can set the default.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Use wrapper for qdev_get_path
This makes it easier to remove it from BusInfo.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Drop now unnecessary NULL initialization in scsibus_get_dev_path()]...
qdev: Move SysBus initialization to sysbus.c
TYPE_SYSTEM_BUS will be local to hw/sysbus.c, so move existing referencesto main_system_bus and system_bus_info there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Convert busses to QEMU Object Model
This is far less interesting than it sounds. We simply add an Object to eachBusState and then register the types appropriately. Most of the interestingrefactoring will follow in the next patches.
Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...
qdev: Connect busses with their parent devices
This makes SysBus part of the root hierarchy and all busses children oftheir respective parent DeviceState.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qbus: Make child devices links
Make qbus children show up as link<> properties. There is no stableaddressing for qbus children so we use an unstable naming convention.
This is okay in QOM though because the composition name is expected tobe what's stable....
qbus: Initialize in standard way
Move code to an initfn and finalizer.Replace do_qbus_create_inplace() with qbus_realize().
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Remove qdev_prop_exists()
Can be replaced everywhere with object_property_find().
qom: Push error reporting to object_property_find()
Avoids duplicated error_set().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Also drop error_set() in object_property_del().]Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Add class_base_init
The class_base_init TypeInfo callback was present in one of the earlyQOM versions but removed (on my request...) before committing. Wewill need it soon, add it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qom: Make Object a type
Right now the base Object class has a special NULL type. Change this sothat we will be able to add class_init and class_base_init callbacks.To do this, remove some special casing of ObjectClass that is not reallynecessary.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qom: Drop type_register_static_alias() macro
It's unused.
qom: Assert that public types have a non-NULL parent field
This protects against unwanted effects of changing TYPE_OBJECT fromNULL to a string.
Suggested-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
m48t59: Rename "type" property to "model"
This resolves a name conflict with the qdev "type" property that isabout to move into Object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Add braces missing in original code.]Signed-off-by: Andreas Färber <afaerber@suse.de>
arm_l2x0: Rename "type" property to "cache-type"
Resolves a name conflict with the qdev "type" property that is about tobe moved to Object.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
qdev: Push "type" property up to Object
Now that Object is a type, add an instance_init function and pushthe "type" property from qdev to there.
qdev: Move bus properties to a separate global
Simple code movement in order to simplify future refactoring.
qdev: Move bus properties to abstract superclasses
In qdev, each bus in practice identified an abstract superclass, butthis was mostly hidden. In QOM, instead, these abstract classes areexplicit so we can move bus properties there.
All bus property walks are removed, and all device property walks...
qdev: Clean up global properties
Now that global properties do not depend on buses anymore, setthem directly in the device instance_init function.
qom: Add object_class_get_parent()
This simple bit of functionality was missing and we'll need it soon,so add it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>[AF: Document possible NULL return value]...
qom: Introduce object_property_is_{child,link}()
Avoids hardcoding partial string comparisons.
Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com>Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
qom: Add object_child_foreach()
A utility function that will be used to implement hierarchical realization.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>[AF: Drop unrelated whitespace change, add Returns: in documentation]...
audio/winwave: Fix typo
Signed-off-by: malc <av1474@comtv.ru>
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>
Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events
Allow certain event types to be rate limited to avoid floodingmonitor clients. The monitor_protocol_event() method is changedsuch that instead of immediately emitting the event to Monitor...
Add event notification for guest balloon changes
After setting a balloon target value, applications have tocontinually poll 'query-balloon' to determine whether theguest has reacted to this request. The virtio-balloon backendknows exactly when the guest has reacted though, and thus it...
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>
qmp: include monitor.h when needed
This is needed to get file descriptors from SCM_RIGHTS.
qmp: do not include monitor.h from qapi-types-core.h
The comment is stale, monitor.h is not needed anymore (only qerror.his, because it contains the schema for errors).
monitor: Fix memory leak with readline completion
Each string which is shown during readline completion in the QEMU monitoris 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>...
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>
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>...
qemu-iotests: add 036 autoclear feature bit test
This new test validates the autoclear feature bit behavior. When QEMUopens a qcow2v3 image file with an unknown autoclear feature bit the bitshould be cleared in the image file header.
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>
scsi-disk: Don't peek behind the BlockDriverState abstraction
Use the appropriate interface instead.
qemu-iotests: fill streaming test image with data
The TestStreamStop test case is racy; if the job completes before we cancancel it, it fails. If we remove the sleep the job will be canceledbefore it has even started, and the test succeeds but it is also not...
qemu-iotests: start vms in qtest mode
This way, they will not execute any VM code at all. However, right nowthe cancellation test is "relying" on being slowed down by TCG executingBIOS code. So, change the timeouts.
block: flush in writethrough mode after writes
We want to make the formats handle their own flushesautonomously, while keeping for guests the ability to use a writethroughcache. Since formats will write metadata via bs->file, bdrv_co_do_writevis the only place where we need to add a flush....
savevm: flush after saving vm state
Writing vm state uses bdrv_pwrite, so it will automatically get flushesin writethrough mode. But doing a flush at the end in writeback modeis probably a good idea anyway.
block: copy enable_write_cache in bdrv_append
Because the guest will be able to flip enable_write_cache, the actualstate 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>
block: add bdrv_set_enable_write_cache
block: always open drivers in writeback mode
Formats are entirely in charge of flushes for metadata writes. Forguest-initiated writes, a writethrough cache is faked in the block layer.So we can always open in writeback mode.
ide: support enable/disable write cache
Enabling or disabling the write cache is done with the SET FEATUREScommand. The command can be issued with sg_sat_set_features fromsg3-utils.
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.
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_offsetand start_sect, and subtracted from n_start, it's cancelled out anyway....
qcow2: Fix avail_sectors in cluster allocation code
avail_sectors should really be the number of sectors from the start ofthe 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:...
qemu-iotests: Some backing file COW tests
Looks like we're still missing these very basic tests for backing filehandling.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-iotests: COW with many AIO requests on the same cluster
This one is a bit more interesting. The COW operation isn't performedcompletely synchronously, and therefore dependencies must be handledcorrectly when multiple requests write to the same unallocated cluster....
qemu-img: document qed format on qemu-img man page
The qemu-img.1 man page is missing the qed format from its list ofsupported 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>...
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 asthe block driver it names, and block drivers don't die.
Requested by Peter Maydell....
xen: Don't change -drive if=xen device name during machine init
A "top" BlockDriverState has a non-empty device_name. If the userdoesn't specify one with -drive parameter id, the system supplies adefault name.
xen_config_dev_blk() changes this name, during machine initialization....
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 forsnapshots: there, we now get the filename specified by the user...
qcow2: fix autoclear image header update
The autoclear feature bits can be used for qcow2 file format featuresthat are safe to "drop" by old programs that do not understand thefeature. Upon opening the image file unknown autoclear feature bits arecleared and the image file header is rewritten, but this was happening...
fdc: fix implied seek while there is no media in drive
The Windows uses 'READ' command at the start of an instalationwithout checking the 'dir' register. We have to abort the transferwith an abnormal termination if there is no media in the drive.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>...
fdc-test: introduced qtest read_without_media
If you try to read from a floppy drive without a media, you should getan abnormal termination error.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: remove a line of unnecessary code
Commit 3948d1d4 removed the pointer argument we filled in with l2_offsetbut 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>...
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>
block: implement is_allocated for raw
Either FIEMAP, or SEEK_DATA+SEEK_HOLE can be used to implement theis_allocated callback for raw files. On Linux ext4, btrfs and XFSall support it.
stream: tweak usage of bdrv_co_is_allocated
is_allocated_base has complex semantics that are not really usableoutside streaming. Split the check in two parts, where the allocatedstate for the top bs is moved to the caller. The resulting functionis more generally useful....
stream: move is_allocated_above to block.c
stream: move rate limiting to a separate header file
Make the code reusable.
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'...
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>
qemu-img check -r for repairing images
The QED block driver already provides the functionality to not onlydetect inconsistencies in images, but also fix them. However, thisfunctionality cannot be manually invoked with qemu-img, but thecheck happens only automatically during bdrv_open()....
qemu-img check: Print fixed clusters and recheck
When any inconsistencies have been fixed, print the statistics and runanother check to make sure everything is correct now.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Support for fixing refcount inconsistencies
rbd: hook up cache options
Writeback caching was added in Ceph 0.46, and writethrough will be in0.47. These are controlled by general config options, so there's noneed to check for librbd version.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
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>
block: Simplify how drive_init() computes default ID
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Prevent disk data loss when closing qemu
Prevent disk data loss when closing qemu console windowunder 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>
Merge branch 'master' of git://git.qemu.org/qemu
qcow2: Silence false warning
Some gcc versions seem not to be able to figure out that the switchstatement covers all possible values and that c is therefore alwaysinitialised. Add a default branch for them.
Reported-by: malc <av1474@comtv.ru>Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
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>
xilinx_intc: changed device name
Changed device name to xlnx,xps-intc. This is the exact name of the devicein the xilinx EDK development tools.
xilinx_ethlite: tweaked naming of ping-pong props
Changed "txpingpong" prop to "tx-ping-pong". Same for rx. This is done tomake the property name exactly match what is output by the xilinx tools forthis IP.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
xilinx_ethlite: changed device name
Changed device name to xlnx,xps-ethernetlite. This is the exact name of thedevice in the xilinx EDK development tools.
xilinx_axienet: droped the c_ on parameters
Even though the xilinx tools do have C_ on all params by default, drop thisfor consistency with all the other xilinx IP (I.E. param names are the xilinxnames without the C_ prefix)
xilinx_axienet: changed device name
Changed device name to xlnx,axi-ethernet. This is the exact name of thedevice in the xilinx EDK development tools.
xilinx_axidma: changed device name
Changed device name to xlnx,axi-dma. This is the exact name of the device in theXilinx EDK development tools.