bdrv: Use "Error" for creating images
Add an Error ** parameter to BlockDriver.bdrv_create to allow morespecific error messages.
Signed-off-by: Max Reitz <mreitz@redhat.com>
block: Error parameter for open functions
Add an Error ** parameter to bdrv_open, bdrv_file_open and associatedfunctions to allow more specific error messages.
qemu-iotests: add tests for runtime fd passing via SCM rights
This case will test whether the monitor can receive fd at runtime.To verify better, additional monitor is created to see if qemucan handler two monitor instances correctly.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>...
qemu-iotests: New test case in 061
Add one test case for zero cluster expansion on qcow2 version downgradein shared L2 tables (i.e., L2 tables with a refcount > 1) and one forzero expansion on backed clusters in shared L2 tables.
Signed-off-by: Max Reitz <mreitz@redhat.com>...
snapshot: new function bdrv_snapshot_find_by_id_and_name()
To make it clear about id and name in searching, add this APIto distinguish them. Caller can choose to search by id or name,*errp will be set only for exception.
Some code are modified based on Pavel's patch....
snapshot: distinguish id and name in snapshot delete
Snapshot creation actually already distinguish id and name since it takea structured parameter *sn, but delete can't. Later an accurate deleteis needed in qmp_transaction abort and blockdev-snapshot-delete-sync,...
qmp: add internal snapshot support in qmp_transaction
Unlike savevm, the qmp_transaction interface will not generatesnapshot name automatically, saving trouble to return informationof the new created snapshot.
Although qcow2 support storing multiple snapshots with same name...
qmp: add interface blockdev-snapshot-internal-sync
Snapshot ID can't be specified in this interface.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qmp: add interface blockdev-snapshot-delete-internal-sync
This interface use id and name as optional parameters, to handle thecase that one image contain multiple snapshots with same name whichmay be '', but with different id.
Adding parameter id is for historical compatiability reason, and...
hmp: add interface hmp_snapshot_blkdev_internal
hmp: add interface hmp_snapshot_delete_blkdev_internal
It is hard to make both id and name optional in hmp console as qmpinterface, so this interface require user to specify name.
qemu-iotests: add 057 internal snapshot for block device test case
Create in transaction and deletion in single command will be tested.
bdrv: Use "Error" for opening images
Add an Error ** parameter to BlockDriver.bdrv_open andBlockDriver.bdrv_file_open to allow more specific error messages.
qcow2: Pass discard type to qcow2_discard_clusters()
The function will be used internally instead of only being called forguest discard requests.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Max Reitz <mreitz@redhat.com>
qcow2: Discard VM state in active L1 after creating snapshot
During savevm, the VM state is written to the active L1 of the image andthen a snapshot is taken. After that, the VM state isn't needed any morein the active L1 and should be discarded. This is implemented by this...
raw-win32.c: Fix incorrect handling behaviour of small block files
It is a valid case that the read data's size is smaller than therequested size since there could be files that are smaller thanthe minimum block size (For ex. when a VMDK disk descriptor file)...
block: Image file option amendment
This patch adds the "amend" option to qemu-img which allows changingimage options on existing image files. It also adds the generic bdrvimplementation which is basically just a wrapper for the image formatspecific function....
qcow2-cache: Empty cache
Add a function for emptying a cache, i.e., flushing it and marking allelements invalid.
Signed-off-by: Max Reitz <mreitz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2-cluster: Expand zero clusters
Add functionality for expanding zero clusters. This is necessary fordowngrading the image version to one without zero cluster support.
For non-backed images, this function may also just discard zero clustersinstead of truly expanding them....
qcow2: Save refcount order in BDRVQcowState
Save the image refcount order in BDRVQcowState. This will be relevantfor future code supporting different refcount orders than four and alsofor code that needs to verify a certain refcount order for an opened...
qcow2: Implement bdrv_amend_options
Implement bdrv_amend_options for compat, size, backing_file, backing_fmtand lazy_refcounts.
Downgrading images from compat=1.1 to compat=0.10 is achieved throughhandling all incompatible flags accordingly, clearing all compatible and...
qemu-iotest: qcow2 image option amendment
Add tests for qemu-img amend on qcow2 image files.
qemu-iotests: add unix socket help program
This program can do a sendmsg call to transfer fd with unixsocket, which is not supported in python2.
The built binary will not be deleted in clean, but it is aexisting issue in ./tests, which should be solved in another...
qemu-iotests: add infrastructure of fd passing via SCM
This patch make use of the compiled scm helper program to transferfd via unix socket at runtime.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>...
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20130910' into staging
ARM queue: * aarch64 preparation patchset (excluding the defconfigs, so this doesn't actually enable the new targets yet) * minor bugfixes and cleanups * disable "-cpu any" in system emulation mode...
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Message-id: 1378822364-13887-1-git-send-email-lcapitulino@redhat.comSigned-off-by: Anthony Liguori <anthony@codemonkey.ws>
Merge remote-tracking branch 'spice/spice.v73' into staging
Merge remote-tracking branch 'kraxel/usb.89' into staging
Merge remote-tracking branch 'mdroth/qga-pull-2013-9-9' into staging
Merge remote-tracking branch 'sstabellini/xen-2013-09-09' into staging
Message-id: alpine.DEB.2.02.1309091718030.6397@kaball.uk.xensource.com...
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'stefanha/net' into staging
linux-user: Implement cpu_set_tls() and cpu_clone_regs() for AArch64
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: John Rigby <john.rigby@linaro.org>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1378235544-22290-19-git-send-email-peter.maydell@linaro.org...
linux-user: Add AArch64 termbits.h definitions
Add the AArch64 termbits.h with all the target's termios relatedconstants and structures.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: John Rigby <john.rigby@linaro.org>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
linux-user: Allow targets to specify a minimum uname release
For newer target architectures, glibc can be picky about the kernelversion: for example, it will not run on an aarch64 system unlessthe kernel reports itself as at least 3.8.0. Accommodate this by...
linux-user: Add AArch64 support
This patch adds support for AArch64 in all the small corners oflinux-user (primarily in image loading and startup code).
configure: Add handling code for AArch64 targets
Add the necessary code to configure to handle AArch64 as a targetCPU (we already have some code for supporting it as host). Notethat this doesn't enable the AArch64 targets yet.
Signed-off-by: Alexander Graf <agraf@suse.de>...
target-arm: Export cpu_env
The cpu_env tcg variable will be used by both the AArch32 and AArch64handling code. Unstaticify it, so that both sides can make use of it.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: John Rigby <john.rigby@linaro.org>...
target-arm: Fix target_ulong/uint32_t confusions
Correct a few places that were using uint32_t or a 32 bitonly format string to handle something that should be a target_ulong.
target-arm: Pass DisasContext* to gen_set_pc_im()
We want gen_set_pc_im() to work for both AArch64 and AArch32, butto do this we'll need the DisasContext* so we can tell which modewe're in, so pass it in as a parameter.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: Add new AArch64CPUInfo base class and subclasses
Create a new AArch64CPU class; all 64-bit capable ARMCPUs are subclasses of this. (Currently we only supportone, the "any" CPU used by linux-user.)
target-arm: Disable 32 bit CPUs in 64 bit linux-user builds
If we're building aarch64-linux-user then the 32 bit CPUs areall unwanted, because they can't possibly execute the 64 bitbinaries we will be running; disable them.
target-arm: Prepare translation for AArch64 code
This patch adds all the prerequisites for AArch64 support that didn'tfit into split up patches. It extends important bits in the core cpuheaders to also take AArch64 mode into account.
Add new ARM_TBFLAG_AARCH64_STATE translation buffer flag...
target-arm: Add AArch64 translation stub
We should translate AArch64 mode separately from AArch32 mode. In AArch64 mode,registers look vastly different, instruction encoding is completely different,basically the system turns into a different machine.
So let's do a simple if() in translate.c to decide whether we can handle the...
target-arm: Add AArch64 gdbstub support
We want to be able to debug AArch64 guests. So let's add the respective gdbstub functions and xml descriptions that allow us to do so.
linux-user: Don't treat AArch64 cpu names specially
32-bit ARM has a lot of different names for different types of CPUs it supports.On AArch64, we don't have this, so we really don't want to execute the 32-bitlogic. Stub it out for AArch64 linux-user guests....
linux-user: Add cpu loop for AArch64
Add the main linux-user cpu loop for AArch64. Since AArch64has a different system call interface, doesn't need to worryabout FPA emulation and may in the future keep the prefetch/dataabort information in different system registers, it's simplest...
linux-user: Add syscall number definitions for AArch64
The AArch64 syscall definitions are all publicly available in the Linuxkernel. Let's add them to our linux-user emulation target, so that wecan easily handle AArch64 syscalls.
linux-user: Fix up AArch64 syscall handlers
Some syscall handlers have special code for ARM enabled that we don'tneed on AArch64. Exclude AArch64 in those cases. In other places wecan share struct definitions with other targets or have to provide ourown....
linux-user: Add signal handling for AArch64
This patch adds signal handling for AArch64. The code is based on therespective source in the Linux kernel.
Signed-off-by: Andreas Schwab <schwab@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: John Rigby <john.rigby@linaro.org>...
linux-user: Make sure NWFPE code is 32 bit ARM only
On ARM, linux-user emulation includes NWFPE support for emulating theancient FPA floating point coprocessor. This has long since beensuperseded by VFP and is only required for legacy binaries. TheAArch64 linux-user target doesn't compile in NWFPE support, so make...
target-arm: Abstract out load/store from a vaddr in AArch32
AArch32 code (ie traditional 32 bit world) expects to beable to pass a vaddr in a TCGv_i32. However when QEMU iscompiled with TARGET_LONG_BITS=32 the TCG load/storefunctions take a TCGv_i64. Abstract out load/store with...
target-arm: Extract the disas struct to a header file
We will need to share the disassembly status struct between AArch32 andAArch64 modes. So put it into a header file that both sides can use.
target-arm: Implement qmp query-cpu-definitions
Libvirt uses this to introspect available CPU models.
Signed-off-by: Cole Robinson <crobinso@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Message-id: c0bdcd6c7ea6a085a6902ccaa73180fd771c8267.1378303555.git.crobinso@redhat.com...
pl110: Clarify comment about PL110 ID on VersatilePB
Clarify a comment about the ID register value presented bythe PL110 variant present on the VersatilePB board (basedon testing what the actual hardware does), to indicate thatthis is not an error in our emulation, and to remove an #if-0....
abitypes.h: Remove incorrect ARM ABI_LLONG_ALIGNMENT
The ARM EABI specifies that 64 bit integers should be8 aligned; remove our incorrect setting of 4 alignment.This has no actual effect since it only set the alignmentfor the 'abi_ullong' and 'abi_llong' types, which are used...
target-arm: Make '-cpu any' available in linux-user mode only
Make the 'any' CPU for target-arm available only in linux-user mode.The ARM target provides a CPU named "any", which turns on support forall user-level instruction set extensions we know about. This is...
target-arm: Use sextract32() in branch decode
In the decode of ARM B and BL insns, swap the order of the"append 2 implicit zeros to imm24" and the sign extend, anduse the new sextract32() utility function to do the latter.This avoids a direct dependency on the undefined C behaviour...
target-arm: Avoid "1 << 31" undefined behaviour
Avoid the undefined behaviour of "1 << 31" by using 1U to makethe shift be of an unsigned value rather than shifting into thesign bit of a signed integer. For consistency, we make all theCPSR_* constants unsigned, though the only one which triggers...
target-arm: fix ARMv7M stack alignment on reset
When the initial SP is loaded from the vector table on ARMv7M systems the twoleast significant bits are ignored as the stack is always aligned at a four byteboundary (see ARM DDI 0403C, B1.4.1 and B1.5.5). So far QEMU did not ignore...
qapi-types.py: Fix enum struct sizes on i686
Unlike other list types, enum wasn't adding any padding, which causeda mismatch between the generated struct size and GenericList structsize. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21
This crashed qemu if calling qmp query-tpm-types for example, which...
Remove dev-bluetooth.c dependency from vl.c
Use usb_legacy_register handling to create bt-dongle device and remove codedependency from vl.c so CONFIG_USB_BLUETOOTH can be disabled.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ehci: save device pointer in EHCIState
We'll need a pointer to the actual pci/sysbus device,stick a pointer to it into the EHCIState struct.
https://bugzilla.redhat.com/show_bug.cgi?id=1005495
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: sanity check setup_index+setup_len in post_load
Preparation for usb-bt-dongle conditional build
To allow disable usb-bt-dongle device using CONFIG_BLUETOOTH option, some offunctions in vl.c file has to be made accessible in dev-bluetooth.c. This ispure code moving.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>...
spice-core: Use g_strdup_printf instead of snprintf
Several places in spice-core.c were using either g_malloc+snprintfor snprintf+g_strdup to achieve the same result as g_strdup_printf.
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: trace io port name
qxl: fix local renderer
The local spice renderer assumes the primary surface is located at thestart of the "ram" bar. This used to be a requirement in qxl hardwarerevision 1. In revision 2+ this is relaxed. Nevertheless guest driverscontinued to use the traditional location, for historical and backward...
error: Add error_set_win32 and error_setg_win32
These functions help maintaining homogeneous formatting of error messageswith Windows error code and description (generated byg_win32_error_message()).
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>...
qemu-ga: Add Windows VSS provider and requester as DLL
Adds VSS provider and requester as a qga-vss.dll, which is loaded byWindows VSS service as well as by qemu-ga.
"provider.cpp" implements a basic stub of a software VSS provider.Currently, this module only relays a frozen event from VSS service to the...
qemu-ga: Call Windows VSS requester in fsfreeze command handler
Support guest-fsfreeze-freeze and guest-fsfreeze-thaw commands for Windowsguests. When fsfreeze command is issued, it calls the VSS requester tofreeze filesystems and applications. On thaw command, it again tells the VSS...
qemu-ga: Install Windows VSS provider on `qemu-ga -s install'
Register QGA VSS provider library into Windows when qemu-ga is installed asWindows service ('-s install' option). It is deregistered when the serviceis uninstalled ('-s uninstall' option).
QMP/qemu-ga-client: Make timeout longer for guest-fsfreeze-freeze command
guest-fsfreeze-freeze command can take longer than 3 seconds when heavydisk I/O is running. To avoid unexpected timeout, this changes the timeoutto 60 seconds (timeout of pre-commit phase of VSS)....
configure: Support configuring C++ compiler
Add configuration for C++ compiler in configure and Makefiles.The C++ compiler is choosed as following: - ${CXX}, if it is specified. - ${cross_prefix}g++, if ${cross_prefix} is specified. - Otherwise, c++ is used....
Add c++ keywords to QAPI helper script
Add c++ keywords to avoid errors in compiling with c++ compiler.This also renames class member of PciDeviceInfo to q_class.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>...
checkpatch.pl: Check .cpp files
Enable checkpatch.pl to apply the same checks as C source files forC++ files with .cpp extensions. It also adds some exceptions for C++sources to suppress errors for: - <> used in C++ template arguments (e.g. template <class T>)...
Add a script to extract VSS SDK headers on POSIX system
VSS SDK setup.exe is only runnable on Windows. This adds a scriptto extract VSS SDK headers on POSIX-systems using msitools.
From: Paolo Bonzini <pbonzini@redhat.com>...
qemu-ga: Add configure options to specify path to Windows/VSS SDK
To enable VSS support in qemu-ga for Windows, header files included inVSS SDK are required.The VSS support is enabled by the configure option like below: ./configure --with-vss-sdk="/path/to/VSS SDK"...
mips_malta: support up to 2GiB RAM
A Malta board can support up to 2GiB of RAM. Since the unmapped kseg0/1regions are only 512MiB large & the latter 256MiB of those are taken upby the IO region, access to RAM beyond 256MiB must be done through amapped region. In the case of a Linux guest this means we need to use...
pc_q35: Initialize Xen.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
pc: Initializing ram_memory under Xen.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>CC: qemu-stable@nongnu.org
ne2000: mark I/O as LITTLE_ENDIAN
Now that the memory subsystem is propagating the endianness correctly,the ne2000 device should have its I/O ports marked as LITTLE_ENDIAN, asPCI devices are little endian.
This makes the ne2000 NIC to work again on PowerPC....
vmxnet3: Eliminate __packed redefined warning
This eliminates a warning about __packed being redefined as exposed by thevmxnet3 code. __packed is not used anywhere in the vmxnet3 code.
CC hw/net/vmxnet3.oIn file included from hw/net/vmxnet3.c:29:...
e1000: add interrupt mitigation support
This patch partially implements the e1000 interrupt mitigation mechanisms.Using a single QEMUTimer, it emulates the ITR register (which is the newermitigation register, recommended by Intel) and approximately emulates...
tap: Use numbered tap/tun devices on all *BSD OS's
The following patch simplifies the *BSD tap/tun code and makes use of numberedtap/tun interfaces on all *BSD OS's. NetBSD has a patch in their pkgsrc treeto make use of this feature and DragonFly also supports this as well....
net: Rename send_queue to incoming_queue
Each networking client has a queue for packets that could not yet bedelivered to that client. Calling this queue "send_queue" is highlyconfusing as it has nothing to to with packets send from this client butto it. Avoid this confusing by renaming it to "incoming_queue"....
qemu-iotests: Fixed test case 026
The reference output for test case 026 hasn't been updated in a longtime and it's one of the "known failing" cases. This patch updates thereference output so that unintentional changes can be reliably detectedagain.
The problem with this test case is that it produces different output...
block: introduce bdrv_get_block_status API
For now, bdrv_get_block_status is just another name for bdrv_is_allocated.The next patches will add more flags.
This also touches all block drivers with a mostly mechanical rename. Thesole exception is cow; because it calls cow_co_is_allocated from the read...
block: define get_block_status return value
Define the return value of get_block_status. Bits 0, 1, 2 and 9-62are valid; bit 63 (the sign bit) is reserved for errors. Bits 3-8are left for future extensions.
The return code is compatible with the old is_allocated API: if a driver...
block: return get_block_status data and flags for formats
Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: use bdrv_has_zero_init to return BDRV_BLOCK_ZERO
Alternatively, this could use a "discard zeroes data" flag returnedby bdrv_get_info.
block: return BDRV_BLOCK_ZERO past end of backing file
If the sectors are unallocated and we are past the end of thebacking file, they will read as zero.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-img: add a "map" subcommand
This command dumps the metadata of an entire chain, in either tabular or JSONformat.
docs, qapi: document qemu-img map
Eric Blake also requested including the output in qapi-schema.json,so that it is published through the introspection mechanism.
raw-posix: return get_block_status data and flags
raw-posix: report unwritten extents as zero
These are created for example with XFS_IOC_ZERO_RANGE.
block: add default get_block_status implementation for protocols
Protocols return raw data, so you can assume the offsets to passthrough unchanged.
block: look for zero blocks in bs->file
dataplane: Fix startup race.
Avoid trying to setup dataplane again if dataplane setup is already inprogress. This may happen if an eventfd is triggered during setup.
I saw this occasionally with an experimental s390 irqfd implementation:
virtio_blk_handle_output...
qemu-iotests: Whitespace cleanup
These scripts used to have a four characters indentation, with eightconsecutive spaces converted into a tab. Convert everything into spaces.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>