monitor: Cleanup ID assignment for compat switch
Canonicalize the ID assignment when creating monitor devices via thelegacy switch and use less easily colliding names.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: Reorder intialization to drop initial mux focus
So far a multiplexed monitor started disabled. Restore this property forthe new way of configuring by moving the monitor initialization beforeall devices (the last one to attach to a char-mux will gain the focus)....
Monitor: Return before exiting with 'quit'
The 'quit' Monitor command (implemented by do_quit()) callsexit() directly, this is problematic under QMP because QEMUexits before having a chance to send the ok response.
Clients don't know if QEMU exited because of a problem or...
QMP: Check "arguments" member's type
Otherwise the following input crashes QEMU:
{ "execute": "migrate", "arguments": "tcp:0:4446" }
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
QError: Improve QERR_QMP_BAD_INPUT_OBJECT desc
QMP: Use QERR_QMP_BAD_INPUT_OBJECT_MEMBER
The QERR_QMP_BAD_INPUT_OBJECT error is going to be used onlyfor two problems: the input is not an object or the "execute" key is missing.
QError: New QERR_QMP_BAD_INPUT_OBJECT_MEMBER
sh4: remove dead assignments, spotted by clang analyzer
Value stored is never read.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ppc: add missing 'break', spotted by clang analyzer
ppc: remove dead assignments, spotted by clang analyzer
alpha: add missing 'break', spotted by clang analyzer
alpha: remove dead assignments, spotted by clang analyzer
microblaze: remove dead assignments, spotted by clang analyzer
m68k: remove dead assignments, spotted by clang analyzer
cris: remove dead assignments, spotted by clang analyzer
arm: remove dead assignments, spotted by clang analyzer
x86: remove dead assignments, spotted by clang analyzer
Remove dead assignments in various common files, spotted by clang analyzer
usb: remove dead assignments, spotted by clang analyzer
bt: remove dead assignments, spotted by clang analyzer
linux-user: Fix Sparc64 syscall returns.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix dead initialization, spotted by clang analyzer
Fix clang warnings:/src/qemu/block/vvfat.c:1102:9: warning: Value stored to 'index3' during its initialization is never read int index3=index1+1;/src/qemu/cmd.c:290:15: warning: Value stored to 'p' during its initialization is never read...
Remove IO_MEM_SUBWIDTH.
Greatly simplify the subpage implementation by not supportingmultiple devices at the same address at different widths. Wedon't need full copies of mem_read/mem_write/opaque for eachaddress, only a single index back into the main io_mem_* arrays....
linux-user: Remove ELFLOAD32.
The ABI-specific types used by linux_binprm and image_infoare different after forcing TARGET_ABI32 on. Which meansthat the parameters that load_elf_binary_multi sees are notthose that loader_exec passed. This is inherently broken...
tcg/arm: fix condition in zero/sign extension functions
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix OpenBSD build
GCC 3.3.5 generates warnings for static forward declarations of data, sorearrange code to use static forward declarations of functions instead.
m68k: fix if statement with empty body, spotted by clang
Fix clang error: CC m68k-softmmu/helper.o/src/qemu/target-m68k/helper.c:773:33: error: if statement has empty body [-Wempty-body] else if (val & (1ull << 47));
m68k-dis: fix unused return value, spotted by clang
Fix clang errors like: CC libdis/m68k-dis.o/src/qemu/m68k-dis.c:1796:7: error: expression result unused [-Wunused-value] FETCH_DATA (info, p);
Fix harmless if statement with empty body, spotted by clang
This clang error is harmless but worth fixing: CC libhw32/rc4030.o/src/qemu/hw/rc4030.c:244:66: error: if statement has empty body [-Wempty-body] DPRINTF;...
Merge remote branch 'origin/master' into staging
target-sparc: Fix address masking in ldqf and stqf.
Use address_mask on both addr and addr+8 in both these routines,rather than explicit masking with 0xffffffff.
Reformulate address_mask to return a result, rather than maskinga pass-by-reference argument....
qcow2: Use QLIST_FOREACH_SAFE macro
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Free iovec arrays allocated by multiwrite_merge()
A new iovec array is allocated when creating a merged write request.This patch ensures that the iovec array is deleted in addition to itsqiov owner.
Reported-by: Leszek Urbanski <tygrys@moo.pl>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
block: Do not export bdrv_first
The bdrv_first linked list of BlockDriverStates is currently extern sothat block migration can iterate the list. However, since there isalready a bdrv_iterate() function there is no need to expose bdrv_first.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
block: Convert bdrv_first to QTAILQ
Remove un-needed code
The bdrv_set_geometry_hint call below is not needed - it's just settingwhat was just read.
Signed-off-by: Bruce Rogers <brogers@novell.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.h: bdrv_create2 doesn't exist any more
The bdrv_create2 implementation has disappeared long ago. Remove itsprototype from the header file, too.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Convert first_drv to QLIST
qemu-img: Eliminate bdrv_new_open() code duplication
Several commands have code to create a BlockDriverState and open a file.The bdrv_new_open() function can be used to perform these steps. Thispatch converts the qemu-img commands to actually use bdrv_new_open()....
qemu-img: Fix BRDV_O_FLAGS typo
It should be BDRV_O_FLAGS instead of BRDV_O_FLAGS.
linux-aio: Fix typo in read() EINTR check
blkdebug: Add events and rules
Block drivers can trigger a blkdebug event whenever they reach a place where itcould be useful to inject an error for testing/debugging purposes.
Rules are read from a blkdebug config file and describe which action is taken...
qcow2: Trigger blkdebug events
This adds blkdebug events to qcow2 to allow injecting I/O errors in specificplaces.
qcow2: Fix creation of large images
qcow_create2 assumes that the new image will only need one cluster for itsrefcount table initially. Obviously that's not true any more when the image isbig enough (exact value depends on the cluster size).
This patch calculates the refcount table size dynamically....
Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remainingcallers of the old function are converted to the new one. In some places theyeven know the right format, so they should have used bdrv_open2 from the...
block: get rid of the BDRV_O_FILE flag
BDRV_O_FILE is only used to communicate between bdrv_file_open and bdrv_open.It affects two things: first bdrv_open only searches for protocols usingfind_protocol instead of all image formats and host drivers. We can easily...
block: split raw_getlength
Split up the raw_getlength into separate generic, solaris and BSDversions to reduce the ifdef maze a bit. The BSD variant stillis a complete maze, but to clean it up properly we'd need somepeople using the BSD variants to figure out what code is used...
qcow2: Return 0/-errno in write_l2_entries
Change write_l2_entries to return the real error code instead of -1.
qcow2: Fix error return code in qcow2_alloc_cluster_link_l2
Fix qcow2_alloc_cluster_link_l2 to return the real error code like it does inall other error cases.
qcow2: Return 0/-errno in write_l1_entry
Change write_l1_entry to return the real error code instead of -1.
qcow2: Return 0/-errno in l2_allocate
Returning NULL on error doesn't allow distinguishing between different errors.Change the interface to return an integer for -errno.
cleanup block driver option handling in vl.c
Assign directly to the bdrv_flags variable instead of usingmagic numbers before translating to the BDRV_O_* options.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-config: qemu_read_config_file() reads the normal config file
Introduce a new function qemu_read_config_file which reads the VM configurationfrom a config file. Unlike qemu_config_parse it doesn't take a open file but afilename and reduces code duplication as a side effect....
qemu-config: Make qemu_config_parse more generic
qemu_config_parse gets the option groups as a parameter now instead ofhardcoding the VM configuration groups. This way it can be used for otherconfigurations, too.
blkdebug: Basic request passthrough
This isn't doing anything interesting. It creates the blkdebug block driver asa protocol which just passes everything through to raw.
blkdebug: Inject errors
Add a mechanism to inject errors instead of passing requests on. With nofurther patches applied, you can use it by setting inject_errno in gdb.
Make qemu-config available for tools
To be able to use config files for blkdebug, we need to make these functionsavailable in the tools. This involves moving two functions that can only bebuilt in the context of the emulator.
audio/sdlaudio: remove unused variable
Remove unused 'shift' variable spotted by clang.Also clean up aud_to_sdlfmt which used to get the valueof shift.
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>Signed-off-by: malc <av1474@comtv.ru>
bt-sdp: Fix an excessive ; and assignment of the wrong variable
Problem-spotted-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
bt-l2cap: fix if statement with empty body, spotted by clang
Fix clang error: CC bt-l2cap.o/src/qemu/hw/bt-l2cap.c:1000:41: error: if statement has empty body[-Wempty-body] /* TODO: Signal an error? */;
This means that l2cap_sframe_in() may now get called....
audio/alsa: Avoid snd_pcm_format_t vs audfmt_e mixup
Spotted by Serge Ziryukin and based on his patch, thanks.
Signed-off-by: malc <av1474@comtv.ru>
pci: fix pci_find_bus().
When looking down child bus, it should look parent bridge'sbus number, not child bus's.Optimized tail recursion and style fix.
Cc: Blue Swirl <blauwirbel@gmail.com>Cc: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
slirp: fix structure initialization in tcp_listen()
A data structure of type sockaddr_in is allocated from stack but notproperly initialized. This may lead to a failure in the bind() calllater on. Fixed by filling the contents of the structure with zeroes...
Compile event_notifier only once
Compile vl.c once
Since kvm.h can be used in files compiled once,we can partially revertb33612d03540fda7fa67485f1c20395beb7a2bf0.
provide a stub version of kvm-all.c if !CONFIG_KVM
This allows limited use of kvm functions (which will return ENOSYS)even in once-compiled modules. The patch also improves a bit the errormessages for KVM initialization.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
tcg/arm: remove conditional argument for qemu_ld/st
While it make sense to pass a conditional argument to tcg_out_*()functions as the ARM architecture allows that, it doesn't make sensefor qemu_ld/st functions. These functions use comparison instructions...
tcg/arm: use ext* ops in qemu_ld
tcg/arm: bswap arguments in qemu_ld/st if needed
On big endian targets, data arguments of qemu_ld/st ops have to bebyte swapped. Two temporary registers are needed for qemu_st to dothe bswap. r0 and r1 are used in system mode, do the same in usermode, which implies reworking the constraints....
tcg/arm: remove useless register tests in qemu_ld/st
addr_reg, data_reg and data_reg2 can't be register r0 or r1 du to theconstraints. Don't check if they equals these registers.
tcg/arm: fix argument alignment in qemu_st64
64-bit arguments should be aligned on an even register as specifiedby the "Procedure Call Standard for the ARM Architecture".
tcg/arm: optimize register allocation order
The beginning of the register allocation order list on the TCG armtarget matches the list of clobbered registers. This means that when anhelper is called, there is almost always clobbered registers that haveto be spilled....
tcg/arm: don't try to load constants using pc
There is statistically almost 0 chances to use this code, soremove it.
tcg/arm: sxtb and sxth are available starting with ARMv6
tcg/arm: use the blx instruction when possible
tcg/arm: add rotation ops
tcg/arm: add ext16u op
Add an ext16u op, either using the uxth instruction on ARMv6+ or twoshifts on previous ARM versions. In both cases the result use the samenumber or less instructions than the pure TCG version.
Also move all sign extension code to separate functions, so that they...
tcg/arm: add bswap ops
Add an bswap16 and bswap32 ops, either using the rev and rev16instructions on ARMv6+ or shifts and logical operations on previousARM versions. In both cases the result use less instructions thanthe pure TCG version.
These ops are also needed by the qemu_ld/st functions....
tcg/arm: remove SAVE_LR code
There is no need to save the LR register (r14) before a call to asubroutine. According to the "Procedure Call Standard for the ARMArchitecture", it is the job of the callee to save this register.Moreover, this register is already saved in the prologue/epilogue....
tcg/arm: explicitely list clobbered/reserved regs
Instead of writing very compact code, declare all registers that areclobbered or reserved one by one. This makes the code easier to read.
Also declare all the 16 registers to TCG, and mark pc as reserved....
tcg/arm: remove store signed functions
Store signed functions doesn't make sense, and are not used. Removethem.
tcg/arm: replace integer values by registers enum
The TCG ARM backends uses integer values to refer to both immediatevalues and register number. This makes the code difficult to read.
The patch below replaces all (if I haven't miss any ;-) integer values...
tcg/arm: align 64-bit arguments in function calls
As specified by the "Procedure Call Standard for the ARM Architecture".
tcg/arm: add variables to define the allowed instructions set
Use a set of variables to define the allowed ARM instructions, dependingon the ARM_ARCH_* GCC defines.
Check for invalid initrd file
When qemu is invoked with an invalid initrd file, it crashes. Followingpatch prints a error message and exits if an invalid initrd isspecified. Includes changes suggested by JV.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
monitor: Rename argument type 'b' to 'f'
To make 'b' available for boolean argument.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: New argument type 'b'
This is a boolean value. Human monitor accepts "on" or "off".Consistent with option parsing (see parse_option_bool()).
monitor: Use argument type 'b' for set_link
Second argument is now "on" or "off" instead of "up" or "down".
monitor: Convert do_set_link() to QObject, QError
virtio-blk: Fix use after free in error case
virtio_blk_req_complete frees the request, so we can't access it any more whencalling bdrv_mon_event. Use the pointer that was copied earlier.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
QMP: Improve RTC_CHANGE event description
Some people might think that this event is emitted whenever thetime changes, be more specific.
Monitor: Convert do_screen_dump() to QObject
Trivial, as it never fails, doesn't have output nor returnany data.
Note that it's also available under QMP, as kvm-autotestneeds this.
monitor: New commands netdev_add, netdev_del
Monitor commands to go with -netdev.
error: New QERR_DEVICE_IN_USE
error: New QERR_INVALID_PARAMETER_VALUE
error: Convert qemu_opts_set() to QError
error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()
Both functions report errors nicely enough now, no need for additionalmessages.
error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER
error: Convert qemu_opts_validate() to QError
error: Convert net_client_init() to QError
The conversion is shallow: client type init() methods aren'tconverted. Converting them is a big job for relatively littlepractical benefit, so leave it for later.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...