configure: rename $datadir to $qemu_datadir
The variable is used for the qemu-specific directory and has a differentmeaning of the autoconf "datadir" variable (that's used for the$prefix/share directory, not for $prefix/share/PACKAGE).
This doesn't change behavior or interfaces, it's just an internal...
configure: rename $docdir to $qemu_docdir
The autoconf "docdir" variable is used for the program-specificsubdirectory, but anyway it's better to make it clear that the variableis used for the qemu-specific subdirectory path.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
configure: rename $confdir to $qemu_confdir
There's no "confdir" variable on Autoconf, but it's good to make itclear that it's a variable for the Qemu-specific subdirectory inside$sysconfdir.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
create_config: separate section for qemu_*dir variables (v2)
The generic dir section will eventually go away and be replaced withqemu_ section. By now, both sections will be kept, while the variablesget renamed on config-host.mak.
With this patch, a XXXdir variable will become a CONFIG_QEMU_XXXDIR...
config-host.mak: rename datadir to qemu_datadir
Autoconf concept of "datadir" is supposed to be "$prefix/share", not"$prefix/share/PACKAGE", so using datadir for the Qemu-specificdirectory is confusing.
The current C code that uses CONFIG_QEMU_DATADIR should be safe, as now...
config-host.mak: rename confdir to qemu_confdir
$confdir is a confusing name, as it's not clear if it's "the systemconfig dir" or "the Qemus-specific directory inside the config dir".$qemu_confdir makes it more clear.
The current C code that uses CONFIG_QEMU_CONFDIR should be safe, as now...
Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemu
Instead of hardcoding the directory suffix, use the qemu-specificdirectory variable.
target-cris: QOM'ify CPU
Embed CPUCRISState as first member of QOM CRISCPU.
Let CPUClass::reset() call cpu_state_reset() for now.
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-cris: QOM'ify CPU reset
Move code from cpu_state_reset() into QOM cris_cpu_reset().Let CPU init call cpu_reset().
target-cris: Start QOM'ifying CPU init
Move VR-independent code from cpu_cris_init() into an initfn.
target-microblaze: QOM'ify CPU
Embed CPUMBState as first member of QOM MicroBlazeCPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
target-microblaze: QOM'ify CPU reset
Move code from cpu_state_reset() to QOM mb_cpu_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
target-microblaze: QOM'ify CPU init
Move code from cpu_mb_init() to a QOM initfn.
Signed-off-by: Andreas Färber <afaerber@suse.de>Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>[AF: Leave cpu_reset() call in cpu_mb_init()]
Merge remote-tracking branch 'origin/master' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
qtest: fix memread and memwrite on 32 bit hosts
Use PRIx64 to print 64 bit values to avoid truncationon 32 bit hosts.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'kwolf/for-anthony' into staging
fix BCD mask for date (Solaris 2.5 guest hang fix)
Fix BCD mask for date. The most visible effect of this patch isSolaris 2.5.1 doesn't hang at boot if the day of month is >21.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qapi: g_hash_table_find() instead of GHashTableIter.
GHashTableIter was first introduced in glib 2.16.This patch removes it in favor of older g_hash_table_find()for better compatibility with RHEL5.
Signed-off-by: NODA, Kai <nodakai@gmail.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qmp: make block job command naming consistent
The block streaming and job commands used '_' instead of '-' for reasonsof compatibility with libvirt, which already included support for the'_' naming. However, the semantics of block_job_cancel have changed and...
Merge remote-tracking branch 'sstabellini/build_fix' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'mdroth/qga-pull-4-19-12' into staging
Merge remote-tracking branch 'bonzini/nbd-next' into staging
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'stefanha/tracing' into staging
target-arm: Move reset handling to arm_cpu_reset
Now that cpu_reset_model_id() has gone we can move thereset code over to the class reset function and have cpu_state_resetsimply do a reset on the CPU QOM object.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: Drop cpu_reset_model_id()
cpu_reset_model_id() is now empty and we can remove it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Andreas Färber <afaerber@suse.de>
target-arm: Move cache ID register setup to cpu specific init fns
Move cache ID register reset out of cpu_reset_model_id() bycreating a field for the reset value in ARMCPU and setting itup in the cpu specific init functions.
target-arm: Move OMAP cp15_i_{max,min} reset to cpu_state_reset
Move the OMAP-specific cp15_i_{max,min} reset to cpu_state_reset;since these registers are only accessible on CPUs with theOMAPCP feature set there's no need to guard this reset witheither a CPUID or feature bit check....
target-arm: Move feature register setup to per-CPU init fns
Move feature register value setup to per-CPU init functions.
target-arm: Move iWMMXT wCID reset to cpu_state_reset
Move the iWMMXT wCID reset to cpu_state_reset(). Sincewe use the same value for all CPUs with this feature(with the major/minor revision fields set to the QEMUspecific 'Q' value) there's no need to create an ARMCPU...
target-arm: Drop JTAG_ID documentation
None of the machines in QEMU offer a JTAG debug interface, so this infowas unused. Further, the PXA250 ID contradicts the February 2002Developer's Manual, which has it as 0xn9264013 with n the MIDR Revision.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
target-arm: Move SCTLR reset value setup to per cpu init fns
Move the reset value of SCTLR to ARMCPU, initialised inthe per-cpu init functions. It can then be reset by asimple copy, and we can drop the code from cpu_reset_model_id().
target-arm: Move CTR setup to per cpu init fns
Move CTR (cache type register) value to an ARMCPU fieldset up by per-cpu init fns.
target-arm: Move MVFR* setup to per cpu init fns
Move the MVFR* VFP feature register values to ARMCPU,so they are set up by the implementation-specific instanceinit functions rather than in cpu_reset_model_id().
target-arm: Move FPSID config to cpu init fns
Move the reset FPSID to the ARMCPU struct, and set it in theper-implementation instance init function. At reset we thenjust copy the reset value into the CPUARMState field.
target-arm: Move feature bit settings to CPU init fns
Move the setting of the feature bits from cpu_reset_model_id()to each CPU's instance init function. This requires us to movethe features field in CPUARMState so that it is not clearedon reset.
target-arm: Add QOM subclasses for each ARM cpu implementation
Register subclasses for each ARM CPU implementation.
Let arm_cpu_list() enumerate CPU subclasses in alphabetical order,except for special value "any".
Replace cpu_arm_find_by_name()'s string -> CPUID lookup by storing the...
target-arm: remind to keep arm features in sync with linux-user/elfload.c
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
tci: GETPC macro must return an uintptr_t
Change the data type of tci_tb_ptr, so GETPC returns anuintptr_t now (like for all other TCG targets).
This completes commit 2050396801ca0c8359364d61eaadece951006057and fixes builds with TCI.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pc
Synchronize the CPU state via cpu_sychronize_state() unconditionallyin gdb_set_cpu_pc() rather than only in some of the target ifdefladder cases.
We can divide the CPUs into three categories:...
softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile
This change makes it compile and return the same value than the #undef one.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Andreas Färber <afaerber@suse.de>...
target-xtensa: add tests for LOOPNEZ and LOOPGTZ
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: fix LOOPNEZ/LOOPGTZ translation
Translation of LOOP instructions used to call LEND SR write handler toupdate LEND and invalidate relevant TBs. Now that LEND SR write handlerends TB, LOOPNEZ and LOOPGTZ generate wrong code (same as for simple...
qtest: add m48t59 tests for Sparc
Add simple m48t59 qtests, enable test only for Sparc32and Sparc64. On PPC, the device is behind PCI bus.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
versatiblepb: add NOR flash support
- add support for the 64MB NOR CFI01 flash available at0x34000000 on the versatilepb boardhttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0225d/BBAJIHEC.html
- tested with barebox bootloader
Signed-off-by: Eric Bénard <eric@eukrea.com>...
realview: break out versatile i2c controller code
The versatile i2c controller implementation was separated toits own file called versatile_i2c.c. This is done as a preparationfor adding i2c support to the versatilepb board.
Signed-off-by: Oskar Andero <oskar.andero@gmail.com>...
versatilepb: add ds1338 rtc device
Add ds1338 rtc attached on i2c.
Signed-off-by: Oskar Andero <oskar.andero@gmail.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm_mptimer: Reset the qemu_timer at reset
On reset of the mpcore timer/watchdog block we need todelete the qemu_timer in case it was running.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
qemu-iotests: add a simple test for write_zeroes
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-iotests: Test backing file COW with zero clusters
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Zero write support
qemu-iotests: Add -o and make v3 the default for qcow2
This adds an -o option to qemu-iotests, which is an option string thatis passed through to qemu-img create -o... This allows testing differentsubformat with a command like './check -qcow2 -o compat=0.10'....
qemu-iotests: Fix test 031 for qcow2 v3 support
qcow2.py must be updated to work with version 3 images at all, theoutput has changed since the feature table extension has been added, andversion 2 and version 3 images can't possibly have the same test output....
qcow2: Ignore reserved bits in refcount table entries
qcow2: Ignore reserved bits in check_refcounts
Also don't infer the cluster type directly from the L2 entries, but useqcow2_get_cluster_type() to keep everything in a single place.
qcow2: Version 3 images
This adds the basic infrastructure to qcow2 to handle version 3 images.It includes code to create v3 images, allow header updates for v3 imagesand checks feature bits.
It still misses support for zero clusters, so this is not a fully...
qcow2: Support reading zero clusters
This adds support for reading zero clusters in version 3 images.
qcow2: Support for feature table header extension
Instead of printing an ugly bitmask, qemu can now print a more helpfulstring even for yet unknown features.
qcow2: Ignore reserved bits in L1/L2 entries
This changes the still existing places that assume that the only flagsare QCOW_OFLAG_COPIED and QCOW_OFLAG_COMPRESSED to properly mask outreserved bits.
It does not convert bdrv_check yet.
qcow2: Refactor qcow2_free_any_clusters
Zero clusters will add another cluster type. Refactor the open-codedcluster type detection into a switch of QCOW2_CLUSTER_* options so thatthe detection is in a single place. This makes it easier to add newcluster types....
qcow2: Simplify count_cow_clusters
count_cow_clusters() tries to reuse existing functions, and all itachieves is to make things much more complicated than they really are:Everything needs COW, unless it's a normal cluster with refcount 1.
This patch implements the obvious way of doing this, and by using...
Specification for qcow2 version 3
This updates the qcow2 specification to cover version 3. It contains thefollowing changes:
- Added compatible/incompatible/auto-clear feature bits plus an optional feature name table to allow useful error messages even if an older...
qcow2: Save disk size in snapshot header
This allows that different snapshots of an image can have differentsizes, which is a requirement for enabling image resizing even withimages that have internal snapshots.
We don't do the actual support for it now, but make sure that the...
qcow2: Ignore reserved bits in get_cluster_offset
With this change, reading from a qcow2 image ignores all reserved bitsthat are set in an L1 or L2 table entry.
Now get_cluster_offset() assigns *cluster_offset only the offset withoutany other flags. The cluster type is not longer encoded in the offset,...
qcow2: Ignore reserved bits in count_contiguous_clusters()
Until now, count_contiguous_clusters() has an argument that allowed tospecify flags that should be ignored in the comparison, i.e. that areallowed to change between contiguous clusters.
This patch changes the function so that it ignores all flags by default...
qcow2: Fail write_compressed when overwriting data
qcow2_alloc_compressed_cluster_offset() already fails if the copied flagis set, because qcow2_write_compressed() doesn't perform COW as it wouldhave to do to allow this.
However, what we really want to check here is whether the cluster is...
qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at()
Refcount block allocation and refcount table growth rely ons->free_cluster_index pointing to somewhere after the currentallocation. Change qcow2_alloc_cluster_at() to fulfill thisassumption....
Add .gitignore for tests/
The new autotests in tests/ generate a number of files, bothexecutable and source, which are not caught by the existing .gitignorefiles. This patch adds a new .gitignore in tests/ which covers these.
[Changed 'rtc-test' to '*-test' so future tests do not need to be added...
e1000: Fix spelling (segmentaion -> segmentation) in debug output
This was reported by https://bugs.launchpad.net/qemu/+bug/984476.
I also changed the case for 'error'.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
error.c: don't return value for void function
It is invalid to return a value from a functionreturning void.
[C99 6.8.6.4 says "A return statement with an expression shall notappear in a function whose return type is void" but gcc 4.6.3 with QEMUcompile flags does not complain. It's still worth fixing this. Stefan]...
fix block_job_set_speed name in documentation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qxl: Add missing GCC_FMT_ATTR and fix format specifier
val is an uint64_t, therefore %d was not correct.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
pflash_cfi01: remove redundant line
Signed-off-by: Eric Bénard <eric@eukrea.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
spice-qemu-char.c: Show what name is unsupported
Signed-off-by: Eduardo Elias Ferreira <edusf@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
iotests: Resolve test failures caused by hostname
`hostname -s` may output an errror:hostname: Name or service not knownThis causes all tests to fail for `make check-block`.
Suppress such error messages, letting the tests succeed.
qemu-img: let 'qemu-img convert' flush data
The 'qemu-img convert -h' advertise that the default cache mode is'writeback', while in fact it is 'unsafe'.
This patch 1) fix the help manual and 2) let bdrv_close() call bdrv_flush()
2) is needed because some backend storage doesn't have a self-flush...
sparc: fix qtest
Initialize TCG only when enabled.
qtest: add dummy functions for user emulators
Allow qtest to be used also in files used for user emulators byintroducing dummy functions.
qtest: add register fuzzing to RTC test
qemu-ga: fix help output
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
qemu-ga: generate missing stubs for fsfreeze
When linux-specific commands (including guest-fsfreeze-*) were consolidatedunder defined(linux), we forgot to account for the case wheredefined(linux) && !defined(FIFREEZE). As a result stubs are no longer...
nbd: do not include block_int.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
nbd: obey FUA on reads
aio: simplify qemu_aio_wait
The do...while loop can never loop, because select will just not return0 when invoked with infinite timeout.
aio: return "AIO in progress" state from qemu_aio_wait
The definition of when qemu_aio_flush should loop is much simplerthan it looks. It just has to call qemu_aio_wait until it makesno progress and all flush callbacks return false. qemu_aio_waitis the logical place to tell the caller about this....
aio: remove process_queue callback and qemu_aio_process_queue
Both unused after the previous patch.
nbd: consistently use ssize_t
GCC (pedantically, but correctly) considers that a negative ssize_t maybecome positive when casted to int. This may cause uninitialized variablewarnings when a function returns such a negative ssize_t and is inlined.Propagate ssize_t return types to avoid this....
nbd: consistently check for <0 or >=0
This prepares for the following patch, which changes -1 return valuesto negative errno.
nbd: consistently return negative errno values
In the next patch we need to look at the return code of nbd_wr_sync.To avoid percolating the socket_error() ugliness all around, let'shandle errors by returning negative errno values.
nbd: do not block in nbd_wr_sync if no data at all is available
Right now, nbd_wr_sync will hang if no data at all is available on thesocket and the other side is not going to provide any. Relax this bymaking it loop only for writes or partial reads. This fixes a race...
nbd: avoid out of bounds access to recv_coroutine array
This can happen with a buggy or malicious server.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
posix-aio: merge posix_aio_process_queue and posix_aio_read
posix_aio_read already calls qemu_aio_process_queue, and duallyqemu_aio_process_queue is always followed by a select loop that callsposix_aio_read.
No races are possible, so there is no need for a separate process_queue...
qemu-tool: map vm_clock to rt_clock
QED uses vm_clock timers so that images are not touched during and aftermigration. This however does not apply to qemu-io and qemu-img.Treat vm_clock as a synonym for rt_clock there, and enable it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qemu-io: use main_loop_wait
This will let timers run during aio_read and aio_write commands,though not during synchronous commands.
scsi: add SANITIZE command