Fix compilation warning due to missing header for sigaction
Fix the following warning by including signal.h directly in qemu-common.h----8<----iohandler.c: In function ‘qemu_init_child_watch’:iohandler.c:172: warning: implicit declaration of function ‘sigaction’...
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
slirp: fix guestfwd id
When using -net user,guestfwd=... Qemu immediately complains about the idbeing in invalid format. This is because we pass in an id that contains acolon, while the id restrictions don't allow colons.
This patch changes the colon into a dot, making guestfwd work again....
Add an isa device for SGA
This patch adds a dummy legacy ISA device whose responsibility is todeploy sgabios, an option rom for a serial graphics adapter.The proposal is that this device is always-on when -nographics,but can otherwise be enable in any setup when -device sga is used....
json-lexer: limit the maximum size of a given token
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
json-streamer: limit the maximum recursion depth and maximum token count
json-streamer: make sure to reset token_size after emitting a token list
json-parser: detect premature EOI
json-lexer: reset the lexer state on an invalid token
json-lexer: fix flushing logic to not always go to error state
Currently we flush the lexer by passing in a NULL character. Thisgenerally forces the lexer to go to the corresponding TERMINAL statefor whatever token type it is currently parsing, emits the token to the...
json-lexer: make lexer error-recovery more deterministic
Currently when we reach an error state we effectively flush everythingfed to the lexer, which can put us in a state where we keep feedingtokens into the parser at arbitrary offsets in the stream. This makes it...
json-streamer: add handling for JSON_ERROR token/state
This allows a JSON_ERROR state to be passed to the streamer to force aflush of the current tokens and pass a NULL token list to the parserrather that have it churn on bad data. (Alternatively we could just not...
json-parser: add handling for NULL token list
Currently a NULL token list will crash the parser, instead we have itpass back a NULL QObject.
isa-vga: Make available with -device, like the other VGA qdevs
Switch no_user off and make it suppress the default VGA.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
docs: qdev-device-use.txt has become stale, update it
Document more bus addresses.
Update for bugs fixed.
Describe where exactly the -drive options go.
Update for recent split of qdev ide-drive into ide-{cd,hd},scsi-disk into scsi-{cd,hd}.
Document scsi-hd's removable property only for usb-storage, because...
QError: Introduce qerror_format_desc()
Refactor non-QError-specific bits out of qerror_human() into generalfunction that can be used by the error_get_pretty() analogue in thenew error-propagation framework.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
QError: Introduce qerror_format()
Will be used by new error propagation framework to convert Error objectsinto human-readable form.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Introduce the new error framework
New error-handling framework that allows for exception-like errorpropagation.
json-parser: propagate error from parser
json-streamer: allow recovery after bad input
Once we detect a malformed message, make sure to reset our state.
Fix regression introduced by -machine accel=
Commit 85097db6 changed the timing when kvm_allowed is set until afterkvm is initialized. During initialization, the ioeventfd initialization codechecks kvm_enabled() and after this change, ioeventfd is effectively disabled....
timer: drop HPET and RTC
dynticks will provide equally good timer granularity on all modern Linuxsystems. This is more or less dead code these days.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: fix tracing of scsi requests with simple backend
The simple backend only supports a maximum of 6 arguments. Split thescsi_req_parsed event in two parts to cope with the limit.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
configure: check for -Wendif-labels support
Older gcc compilers do not support -Wendif-labels, so move it from thehardcoded list to the dynamically detected list.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
virtio-9p: Remove statement without effect (fix warning from cppcheck)
cppcheck report:virtio-9p.c:197: warning: Redundant assignment of "flags" to itself
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>...
exec: Implement qemu_ram_free_from_ptr()
Required for regions mapped via qemu_ram_alloc_from_ptr(). VFIOand ivshmem will make use of this to remove mappings when devicesare hot unplugged.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
multiboot: set boot_device to first partition
The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, whichmaps to the second primary partition. To specify the first primary partition,'part1' should be set to 0x00, since partition numbers start from zero...
target-arm: BKPT instructions should raise prefetch aborts with IFSR type 00010
Signed-off-by: Alex Zuepke <azuepke@sysgo.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: Fix unused-but-set-variable warning
Based on a patch from Hans de Goede <hdegoede@redhat.com>
This warning is new in gcc 4.6.
Acked-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: If DEBUG_TCGV, distinguish TCGv_ptr from TCGv_i32/TCGv_i64
When compiling with DEBUG_TCGV enabled, make the TCGv_ptr type distinctfrom TCGv_i32/TCGv_i64. This means that using an i32 or i64 TCG op tomanipulate a TCGv_ptr will always be detected at compile time, rather...
tcg/tcg-op.h: Fix prototypes for ld/st functions on 64 bit hosts
The prototypes for the ld/st functions on a 64 bit host declaredthe address parameter as a TCGv_i64 rather than a TCGv_ptr. Thisworked OK (since the two are aliases), but needs to be fixed to...
Use the correct header in the TCG MIPS code to find cacheflush() on OpenBSD.
Use the correct header in the TCG MIPS code to find cacheflush() on OpenBSDto fix compilation of the MIPS host support for OpenBSD/mips64 based architecures.
Signed-off-by: Brad Smith <brad@comstyle.com>...
target-arm: Fix compilation failure for 64 bit hosts
Use the correct _ptr aliases for manipulating the pointer tothe fp_status; this fixes a compilation failure on 64 bit hosts.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Stefan Weil <weil@mail.berlios.de>...
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
softfloat: add float*_is_zero_or_denormal()
float*_is_zero_or_denormal() is available for float32, but not forfloat64, floatx80 and float128. Fix that.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-i386: use floatx80 constants in helper_fld*_ST0()
Instead of using a table which doesn't correspond to anything fromphysical in the CPU, use directly the constants in helper_fld*_ST0().
Cc: Andreas Färber <andreas.faerber@web.de>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
softfloat-native: remove
Remove softfloat-native support, all targets are now using softfloatinstead.
softfloat: always enable floatx80 and float128 support
Now that softfloat-native is gone, there is no real point on not alwaysenabling floatx80 and float128 support.
target-i386: remove old code handling float64
Now that target-i386 uses softfloat, floatx80 is always available andthere is no need anymore to have code handling both float64 and floax80.
target-mips/gdbstub: remove old CONFIG_SOFTFLOAT #ifndef
target-mips has been switched to softfloat only long ago, buta #ifndef CONFIG_SOFTFLOAT has been forgotten. Remove it.
target-ppc: remove old CONFIG_SOFTFLOAT #ifdef
target-ppc has been switched to softfloat only long ago, but afew #ifdef CONFIG_SOFTFLOAT have been forgotten. Remove them.
Cc: Alexander Graf <agraf@suse.de>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x8e
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x90
target-s390x: Add missing tcg_temp_free_i32()
s390x: free tmp explicitly in every opcode for disas_a5()
The disas_a5() function provided a TCG tmp variable which was populatedby the respective opcode implementations, but freed at the end of thefunction in generic code.
That makes it really hard for code review, so let's move the freeing...
s390x: fix cksm instruction
The cksm instruction was implemented incorrectly, rendering UDP and TCPchecksum calculation wrong, making an emulated s390x Linux guest breakin most networking operations.
This patch fixes odd end checksum calculation, takes the input register...
s390x: implement lrvgr
The LRVGR instruction was missing. Implement it, so everyone's happy.
Reported-by: Balazs Kutil <bkutil@novell.com>Signed-off-by: Alexander Graf <agraf@suse.de>
s390x: update zipl rom
The zipl bootloader rom we have has seen some dramatic speedups upstream,so let's update it to improve the experience when booting a guest image.
This binary is based on commit id 9a0842dd9823d529f721b418d554f17c72e009e3.
Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x: Fix build for non-linux hosts
linux/kvm.h is not always available for compilation.
Neither linux/kvm.h nor kvm.h are needed, so remove bothwhich also fixes the build problem for non-linux hosts.
Cc: Alexander Graf <agraf@suse.de>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
tcg_gen_shl_i64 needs a 3rd argument of type TCGv_i64.Set tmp4 so it can be used here.
v2:Don't call tcg_const_i64() inside of the loopbecause it creates additional code.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
target-s390x: Fix duplicate call of tcg_temp_new_i64
tmp2 = tcg_temp_new_i64() is already executed unconditionally,so there is no need to call it a second time for 64 bit hosts.
target-s390x: Add missing tcg_temp_free_i64() in gen_jcc()
target-s390x: Add missing tcg_temp_free_i64() in do_mh()
target-s390x: Add missing tcg_temp_free_i64() in disas_b2()
ppc: Fix compilation for ppc64-softmmu
When QEMU was configured with --enable-debug-tcg,compilation fails in spr_write_booke206_mmucsr0() and inspr_write_booke_pid(). Similar changes are also neededin conditional code which is normally unused.
Cc: Alexander Graf <agraf@suse.de>...
PPC: fix sregs usage on booke
When compiling qemu with kvm support on BookE PPC machines, I getthe following error:
cc1: warnings being treated as errors /tmp/qemu/target-ppc/kvm.c: In function 'kvm_arch_get_registers': /tmp/qemu/target-ppc/kvm.c:188: error: unused variable 'sregs'...
PPC: install mpc8544ds.dtb
We don't install mpc8544ds.dtb, which means that -M mpc8544ds doesn'twork when installed. Fix it by installing the file.
Fix segfault on screendump with -nographic
When running -nographic and calling "screendump" on the monitor, qemusegfaults. Fix the invalid pointer dereference by checking for NULL.
PPC: fix mpc8544ds pci default devices
After the Qdev'ification of the MPC8544DS board and PCI bus, the internalPCI bus name changed from "pci" to "pci.0". Reflect this change in thesearch for that bus.
This patch enables networking on e500 guests again....
audio: fix integer overflow expression
Fix an integer overflow that can happen for signed 32 bit typeswhen using FLOAT_MIXENG. (Note that at the moment this is only truewhen using the MacOSX coreaudio audio driver.)
Signed-off-by: Juha Riihim?ki <juha.riihimaki@nokia.com>...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'amit/for-anthony' into staging
Merge remote-tracking branch 'bonzini/scsi.2' into staging
Conflicts: hw/usb-msd.c
Merge remote-tracking branch 'kraxel/usb.14.pull' into staging
pflash_cfi02: Fix a typo in debug code (TARGET_FMT_pld -> TARGET_FMT_plx)
Thanks to Tobias Hoffmann <th55@gmx.de> for this patch.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix spelling in comment (additon -> addition)
bitbang_i2c: Fix spurious slave read after NACK
After NACKing a read operation, a raising SCL should not trigger a newread from the slave. Introduce a new state which just waits for a stopor start condition after NACK.
Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>...
Move user emulator stuff from cpu-exec.c to user-exec.c
Simplify cpu-exec.c by refactoring.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cpu-exec: prepare for user and softmmu split
There is little in common with user and softmmu versions of cpu_resume_signal(),split them.
Fix coding style for the user emulator part.
virtio-serial: Clean up virtconsole detection
virtio-serial-bus needs to treat "virtconsole" devices specially. Ituses VirtIOSerialPort member is_console to recognize them. It getsits value via property initialization. Cute hack, except it letsusers mess with it: "-device virtconsole,is_console=0" isn't plugged...
virtio-serial: Drop useless property is_console
All you could ever achieve with it is break stuff, so removing itshould be safe.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Drop redundant VirtIOSerialPort member info
virtio-console: Simplify init callbacks
virtio-serial-bus: use bh for unthrottling
Instead of calling flush_queued_data when unthrottling, schedulea bh. That way we can return immediately to the caller, and theflush uses the same call path as a have_data for callbackee.
No migration change is required because bh are called from vm_stop....
virtio-serial: Plug memory leak on qdev exit()
virtio_serial_init() allocates the VirtIOSerialBus dynamically, butvirtio_serial_exit() doesn't free it.
Fix by getting rid of the allocation.
scsi: make write_data return void
The return value is unused anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi-generic: Handle queue full
The sg driver currently has a hardcoded limit of commands itcan handle simultaneously. When this limit is reached thedriver will return -EDOM. So we need to capture this toenable proper return values here.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
esp: rename sense to status
This mirrors the LSI patch that was recently committed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: split command_complete callback in two
scsi: rename arguments to the new callbacks
scsi: ignore LUN field in the CDB
The LUN field in the CDB is a historical relic. Ignore it as reserved,which is what modern SCSI specifications actually say.
scsi: Update sense code handling
The SCSI spec has a quite detailed list of sense codes available.It even mandates the use of specific ones for some failure cases.The current implementation just has one type of generic errorwhich is actually a violation of the spec in certain cases....
scsi: do not call send_command directly
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer.
scsi: introduce scsi_req_new
scsi: introduce scsi_req_continue
scsi: introduce scsi_req_get_buf
... and remove some SCSIDevice variables or fields that now become unused.
scsi: Implement 'get_sense' callback
The get_sense callback copies existing sense information intothe provided buffer. This is required if sense informationshould be transferred together with the command response.
scsi-disk: add data direction checking
scsi_req_parse() already provides for a data direction setting,so we should be using it to check for correct direction.And we should return the sense code 'INVALID FIELD IN CDB'in these cases.
scsi: reference-count requests
With the next patch, a device may hold SCSIRequest for an indefinitetime. Split a rather big patch, and protect against access errors,by reference counting them.
There is some ugliness in scsi_send_command implementation due to...
lsi: extract lsi_find_by_tag
scsi: Use 'SCSIRequest' directly
Currently the SCSIRequest structure is abstracted away and cannot accesseddirectly from the driver. This requires the handler to do a lookup onan abstract 'tag' which identifies the SCSIRequest structure.
With this patch the SCSIRequest structure is exposed to the driver. This...
scsi: commonize purging requests
The code for canceling requests upon reset is already the same. Cleanit up and move it to scsi-bus.c.
scsi: introduce scsi_req_abort
This covers the case of canceling a request's I/O and stillcompleting it.
scsi: introduce scsi_req_cancel
This is for when the request must be dropped in the void,but still memory should be freed. To this end, the devicesregister a second callback in SCSIBusOps.
scsi: use scsi_req_complete
scsi-generic: Remove bogus double complete
scsi-generic scsi_read_complete() should not both call the clientcomplete callback with SCSI_REASON_DATA and callscsi_command_complete(). The former will cause the client to queue anew read or write request, while the later will free the request data...
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churnin the following patches.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
scsi-generic: do not use a stale aiocb
If a request is canceled after it has been completed, scsi_cancel_iowould pass a stale aiocb to bdrv_aio_cancel. Avoid this.