cris: remove dead assignments, spotted by clang analyzer
Value stored is never read.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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
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;...
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>
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...
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.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
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....
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>...
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>...
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>
qdev: Convert qdev_unplug() to QError
Note: our device unplug methods don't need conversion work, becausethey can't currently fail.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: convert do_device_del() to QObject, 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
Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing: CC ppc-softmmu/usb-ohci.o/src/qemu/hw/usb-ohci.c:1104:59: error: if statement has empty body [-Wempty-body] ohci->ctrl_head, ohci->ctrl_cur);...
sparc32 use empty_slot for missing RAM v1
use empty_slot device for the RAM which is not installed
Models without ECC don't trap when missing ram is accessed.
v0->v1 compile only once and fix indentation
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>...
create empty_slot device
The empty_slot device emulates known to a bus but not connected devices.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
These clang errors are harmless but worth fixing: CC libhw64/fdc.o/src/qemu/hw/fdc.c:998:74: error: if statement has empty body [-Wempty-body] FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);...
Merge remote branch 'mst/for_anthony' into staging
vhost.c: include <linux/vhost.h> last
So the userspace headers define KERNEL_STRICT_NAMES and there's noconflict on type definition for older kernels.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vhost-net: disable mergeable buffers
vhost in current kernels doesn't support mergeable buffers.Disable this feature if vhost is enabled, until suchsupport is implemented.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vhost: fix features ack
vhost driver in qemu didn't ack features, and this happensto work because we don't really require any features. However,it's better not to rely on this. This patch passes features tovhost as guest acks them.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>...
r2d: always enable IDE and flash
IDE and flash are part of the R2D board, and can't be removed. Emulatethem even if there is no hard-drive plugged to the IDE or if the flashcontent is empty.
sh_pci: fix memory and I/O access
Since commit 8da3ff180974732fc4272cb4433fef85c1822961 ("MMIO callbackinterface changes"), the addresses passed to the I/O functions are anoffset to the start of the area. As a consequence, there is no need tocorrect the address using the value of IOBR. This make possible the use...
hw/r2d: add initrd support
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: convert to new capability API
Using new pci_add_capability_at_offset makeseepro100 code cleaner.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Stefan Weil <weil@mail.berlios.de>
pci: add API to add capability at a known offset
Unlike virtio, device emulations need to add pci capabilitiesat known offsets to match real hardware. Make this possibleby adding an appropriate API.
hw/r2d: add flash memory
Implement virtio reset
The guest may issue a RESET command for virtio. So far we didn't botherto implement it, but with my new bootloader we actually need it for Linuxto get back to a safe state.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
lsi: fix segfault in lsi_command_complete
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
move targphys.h and hw/poison.h inclusion to cpu-common.h
With more files from outside the hw/ directory being placed intolibhw, avoid the need to include hw/hw.h for the sake of targ_phys_addr_t.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
move two variable declarations out of vl.c
Debugcon: Fix debugging printf
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
e1000: fix build on Ubuntu with _FORTIFY_SOURCE
There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled.
_FORTIFY_SOURCE had been disabled by 4a24470497360d8b77568b83008d0e9d6eb0787dand reenabled by 849583050d5f6f782718be8cb50688978973fbea....
smc91c111: allow access to reserved register
Some drivers seems to access the reserved register in bank 0 so allow andignore these accesses.
Signed-off-by: Lars Munch <lars@segv.dk>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
smc91c111: mask register offset
this fixes the smc91c111 emulation which has been broken for gumstix andmainstone and maybe others since the "MMIO callback interface changes" 8da3ff180974732fc4272cb4433fef85c1822961 was commited.
Signed-off-by: Lars Munch <lars@segv.dk>...
baum: add destroy hook
Add a destroy hook for the baum character device, to properly close the BrlAPIconnection.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
update bochs vbe interface
The bochs vbe interface got a new register a while back, which specifiesthe linear framebuffer size in 64k units. This patch adds support forthe new register to qemu. With this patch applied vgabios 0.6c workswith qemu.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
eepro100: Set power management capability using pci_reserve_capability
pci_add_capability automatically updates PCI status andPCI capability pointer, so use it. Use pci_reserve_capabilityto make the new capability appear at the correct offset.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
eepro100: fix mapping of flash memory
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: fix PCI interrupt pin configuration regression
Commit 15e89f5916c9e82347cbd1fd416db3e348bab426removed this setting, but it is still needed.
Without this patch, e100 device drivers usinginterrupts don't work with qemu.
See other nic emulations which also set the...
eepro100: Set configuration bit for standard TCB
For some devices, this bit is always set.For the others, it is set by default.
eepro100: Add new device variant i82801
This ethernet device is used in Toshiba Tecra 8200 notebooks.
eepro100: Simplified device instantiation
By using a private device info structure(as suggested by Gerd Hoffmann), handling of thedifferent device variants becomes much easier.
eepro100: Simplify status handling
Includes a minor STATUS_NOT_OK -> 0 tweak.
eepro100: Don't allow writing SCBStatus
SCBStatus is readonly, but most drivers which were derivedfrom the old Linux eepro100.c do a word write to this addresswhen they want to acknowledge interrupts.
So we have to mask these writes here.
The patch also removes old unused code for status read / write....
OHCI qdev conversion
Convert remaining OHCI devices to QDEV interface.
Signed-off-by: Paul Brook <paul@codesourcery.com>
ARMv7-M reset fixes
Move ARMv7-M PC/SP initialization to the CPU reset routine. Add a boardreset routine to call this. Also load values directly from ROM asimages have not been copied yet.
Avoid clearing the NVIC pointer on cpu reset.
UHCI spurious interrut fix
Only raise an interrupt if the TD has actually completed.
Revert "Compile usb-ohci only once"
This reverts commit f1698408f1dcb7548a21828a0b1e2b530fae3af3.
PCI is always little-endian. Having a user-visible "be" property is justplain wrong.
sparc32: add IOMMU chipset doc links
sparc32: rename iommu.c to sun4m_iommu.c to make room for other IOMMUs
sparc32: improve timer implementation
Timer with zero period (free-run) will never match.
Timer counting starts with tick value of 0x200, not from 0,so the period must calculated from one tick less than the limit.
hw/r2d: add a USB keyboard
The R2D board does not have a PS/2 port, and only support a keyboard onthe USB bus.
usb-bus: fix no params
After commit 702f3e0fb52c124c07f215426eeadb70a716643f, the params isnerver NULL. It should check *params instead of params to determinewhether the params is empty.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
win32: Fix compiler errors from u_int64_t
u_int64_t raises compiler error messages:
CC libhw32/virtio.o/qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:/qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)...
notifier: event notifier implementation
event notifiers are slightly generalized eventfd descriptors. Currentimplementation depends on eventfd because vhost is the only user, andvhost depends on eventfd anyway, but a stub is provided for non-eventfdcase....
virtio: notifier support + APIs for queue fields
vhost needs physical addresses for ring and other queue fields,so add APIs for these. In particular, add binding API to sethost/guest notifiers. Will be used by vhost.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio: add set_status callback
vhost net backend needs to be notified whenfrontend status changes. Add a callback,similar to set_features.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: move typedef to qemu-common
make it possible to use type without header include,simplifying header dependencies.
virtio-pci: fill in notifier support
Support host/guest notifiers in virtio-pci.The last one only with kvm, that's okaybecause vhost relies on kvm anyway.
Note on kvm usage: kvm ioeventfd APIis implemented on non-kvm systems as well,this is the reason we don't need if (kvm_enabled())...
vhost: vhost net support
This adds vhost net device support in qemu. Will be tied to tap deviceand virtio by following patches. Raw backend is currently missing,will be worked on/submitted separately.
virtio-net: vhost net support
This connects virtio-net to vhost net backend.The code is structured in a way analogous to what we have with vnetheader capability in tap.
We start/stop backend on driver start/stop aswell as on save and vm start (for migration)....
Fix -enable-kvm
Make vl.o compiled per target and fix a thinko in hw/acpi.c. It's not trivialto make kvm.h consumable by compiled-once files.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb: class specific interface requests
Mass Storage Reset and Get Max LUN are class specific requests, butthey were not marked as such in hw/usb-msd.c, moved thereforeClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.cto hw/usb.h.Furthermore there was a problem in hw/usb-ohci.c when using DEBUG...
Don't check for bus master for old guests
Older Linux guests don't activate the bus master enable bit. So for those wecan just try to be clever and track if they set the DEVICE_OK bit even thoughbus mastering is still disabled.
Under that condition we can disable the windows safety check. With that logic...
Compile most PPC devices only once
Make byte swapping unconditional since PPC is big endian.
Compile prep_pci only once
Compile openpic only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditionalsince PPC is big endian.
Compile ide/macio only once
Compile pflash_cfi01 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.
Compile pflash_cfi02 only once
Compile acpi only once
Use qemu_irqs to trigger CMOS S3 and SMI events.
Avoid using kvm.h, which uses CPUState.
Move KVM and Xen global flags to vl.c
pflash_cfi02: fix incorrect TARGET_FMT_lx/d use
Also use target_phys_addr_t for addresses.
error: Trim includes after "Move qemu_error & friends..."
Missed in commit 2f792016.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
balloon: Fix overflow when reporting actual memory size
Beginning with its introduction, the virtio balloon has had an overflow errorthat causes 'info balloon' to misreport the actual memory size when the balloonitself becomes larger than 4G. Use a cast when converting dev->actual from...
Compile some MIPS devices only once
Move CPU specific declarations to a separate file.
Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakageby f7736b91c40a617e93505e32dcbd2cb56aad8a23.
Compile ide/core only once
Make win2k install hack unconditional as it is still restricted tox86 only in vl.c.
Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.
Fix recent pxa270 serial breakage
This fixes a copy/paste bug introduced in commit2d48377a8531de63ec1d0c4b9b1959dc4b78356c that pushed TARGET_WORDS_BIGENDIANdependency to board level.
Signed-off-by: Lars Munch <lars@segv.dk>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pci_host: fix breakage
This has been broken by commit 952760bb7bce7fbfe0afcf04fee268745f297b87
Fix Sparc64 build
952760bb7bce7fbfe0afcf04fee268745f297b87 missed one change.
Compile pci_host only once
Convert pci_host_conf_register_mmio_noswap(x) topci_host_conf_register_mmio(x, 0).
Convert pci_host_conf_register_mmio(x) topci_host_conf_register_mmio(x, 1) for big endian hosts, all caseshappen to be BE.
Compile usb-ohci only once
Compile serial only once
Compile isa_mmio only once
Move x86 specific PC declarations to a separate file
x86 definitions (especially CPUState uses) prevent many files frombeing compiled within libhw.
Move x86 specific declarations (APIC stuff) to a separate file.
Revert "Convert atexit users to exit_notifier"
This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025.
Conflicts:
hw/xen_machine_pv.c
This should have never been committed.
Fix a typo
Fix a typo which broke Xen build
Convert atexit users to exit_notifier
All of these users have global state so we really don't see a benefit fromexit_notifier. However, using exit_notifier means that there's one lessjustification for having global state in the first place.