kvm/i8254: QOM'ify some more
Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for PIT realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
i8254: QOM'ify some more
Introduce type constant and avoid DO_UPCAST().
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and letchildren implement their own realizefn. Adapt error handling.Split off an instance_init where sensible.
cs4231a: QOM'ify some more
Introduce type constant and cast macro.Replace reset hook with DeviceClass::reset callback.
gus: QOM'ify some more
Add type constant and cast macro.
Merge remote-tracking branch 'sstabellini/xen_fixes_20130603' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci: misc cleanups
This includes some pci-related cleanups,and fw cfg cleanups which will be useful for on-goingpci related work.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
block: move snapshot code in block.c to block/snapshot.c
All snapshot related code, except bdrv_snapshot_dump() andbdrv_is_snapshot(), is moved to block/snapshot.c. bdrv_snapshot_dump()will be moved to another file later. bdrv_is_snapshot() is not related...
block: move qmp and info dump related code to block/qapi.c
This patch is a pure code move patch, except following modification:1 get_human_readable_size() is changed to static function.2 dump_human_image_info() is renamed to bdrv_image_info_dump().3 in qmp_query_block() and qmp_query_blockstats, use bdrv_next(bs)...
block: dump snapshot and image info to specified output
bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer now,some internal buffers are still used for format control, which have nochance to be truncated. As a result, these two functions have no more issue...
block: drop bs_snapshots global variable
The bs_snapshots global variable points to the BlockDriverState whichwill be used to save vmstate. This is really a savevm.c concept but wasmoved into block.c:bdrv_snapshots() when it became clear that hotplugcould result in a dangling pointer....
block: add block driver read only whitelist
We may want to include a driver in the whitelist for read only taskssuch as diagnosing or exporting guest data (with libguestfs as a goodexample). This patch introduces a readonly whitelist option, and forbackward compatibility, the old configure option --block-drv-whitelist...
qemu-iotests: make assert_no_active_block_jobs() common
Tests 030 and 041 both use query-block-jobs to check whether any blockjobs are active. Make this code common so that 'drive-backup' and othernew feature tests will be able to reuse it.
Suggested-by: Kevin Wolf <kwolf@redhat.com>...
qemu-iotests: make cancel_and_wait() common
The cancel_and_wait() function has been duplicated in 030 and 041. Moveit into iotests.py and let it return the event so tests can performadditional asserts.
Note that 041's cancel_and_wait(wait_ready=True) is replaced by...
qemu-iotests: make compare_images() common
The iotests.compare_images() function returns True if two image fileshave the identical data. Previously this was implemented by convertingimages to raw and then comparing their contents using Python. Since"qemu-img compare" is now available and is more efficient, switch to it....
qemu-iotests: make create_image() common
Both 030 and 041 use create_image(). Move it to iotests.py.
Also drop ImageStreamingTestCase since the class now has no methods.
Suggested-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
qemu-iotests: fix 054 cluster size help output
Commit f3f4d2c09b9cf46903ba38425ec46c44185162bd added a hint to increasethe cluster size when a large image cannot be created. Test 054 now hasoutdated output and fails because the golden output does not match....
gtk: don't use g_object_unref on GdkCursor
It's not a GObject.
Cc: Gerd Hoffman <kraxel@redhat.com>Reported-by: Michael Tokarev <mjt@tls.msk.ru>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>---v1 -> v2 - Fix summary to agree with code (Peter)
gtk: don't resize window when enabling scaling
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix double free the memslot in kvm_set_phys_mem
Luiz Capitulino reported that guest refused to boot and qemucomplained with:kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
It is caused by commit 235e8982ad that did double free for the memslot...
configure: Autogenerate default target list
Autogenerate the default target list based on what files existin default-configs; this allows us to remove one of the placesthat has to be kept up to date with a complete list of everytarget we support.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
configure: Report unknown target names more helpfully
If the user specifies a target list themselves, check each entryto make sure it's a target we recognise. This allows us to printa helpful error message, rather than falling through (where wewould probably eventually end up hitting the uninformative...
Merge remote-tracking branch 'pmaydell/arm-devs.next' into staging
hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region
Exynos SoC was misusing memory_region_init_ram_ptr(): this interface can safelybe used only for memory regions which size is a multiple of target page size.Change chipid_and_omr memory to an mmio region to fix this....
exynos4210.c: register rom_mem for memory migration
Even if we do not register newly created RAM MemoryRegion for migration withvmstate_register_ram_global() function, ram_save_setup() still saves this regionto snapshot file with empty idstr=="". Consequently this results in error during...
i.MX: Improve EPIT timer code.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>Reviewed-by: Peter Chubb <peter.chubb@nicta.com.au>...
sd/sdhci.c: Fix bdata_read DPRINT message
This message was printing out the data in decimal only, which is notvery friendly to the debugging developer. Add hex variant inparenthesis to make it consistent with other similar messages in thismodule.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
sd/sdhci:ADMA: fix interrupt
The end of transfer check was occurring and potentially returning beforethe interrupt flag was checked. This means the interrupt will be missedif it occurs on the last packet. Fix by checking for the interruptbefore checking for the end of transfer....
sd/sd.c: Fix "inquiry" ACMD41
QEMU models two (of the three) ACMD41 has two modes, "inquiry" and"first". The selection logic for which of the two is incorrect - itcompares != 0 for the entire argument value rather than only bits 23:0as per the spec. Fix....
i.MX: split GPT and EPIT timer implementation
There is no common code between these 2 timer implementation.So it is better to split them.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>Message-id: 1368990197-19694-1-git-send-email-jcd@tribudubois.net...
xilinx_spips: lqspi: Push more data to tx-fifo
Do 16 words per fifo flush. Increases performance and decreasesdebug verbosity. This data depth has no real hardware analogue,so just go with something that has reasonable performance.
xilinx_spips: lqspi: Fix byte/misaligned access
The LQSPI bus attachment supports byte/halfword and misalignedaccesses. Fixed. Refactored the LQSPI cache to be byte-wiseinstead of word wise accordingly.
sd/sdhci.c: Only reset data_count on new commands
The data_count variable was being reset on every transfer, includingDMA transfer resumptions. This is incorrect, it should only be seton a new command.
Manifests as a bug when using ADMA and there is a timer delay between...
sd/sdhci: Fix Buffer Write Ready interrupt
This interrupt is not risen after the last block is written to sd. Itis mutually exclusive with the end of transfer conditions. Fix.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Igor Mitsyanko <i.mitsyanko@gmail.com>...
xilinx_spips: lqspi: Dont touch config register
The LQSPI mode is supposed to work via the automatic CS mode featurerather than manipulate CS lines itself. Now that auto CS is implementedremove LQSPIs CS mode override logic. There is still a need tomanipulate the U_PAGE bit in LQSPI config register to implement...
xilinx_spips: Fix CTRL register RW bits
The CTRL register was RAZ/WI on some of the RW bits. Even though thefunction behind these bits is invalid in QEMU, they should still beguest accessible. Fix.
xilinx_spips: Fix striping behaviour
The QSPI controller was using byte-wide stripes when striping acrossthe two flashes in dual parallel mode. The real hardware however usesindividual bit striping. QEMU misbehaves in the (corner) case wheredata is written/read in dual-parallel mode and read/written back in...
xilinx_spips: Debug msgs for Snoop state
This is worth keeping track of when debugging the device model.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
xilinx_spips: Multiple debug verbosity levels
The debug printfs on every SPI operation is extremely verbose. Adda second level of debug for this.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
xilinx_spips: Fix QSPI FIFO size
QSPI has a bigger FIFO than the regular SPI controller. Differentiatebetween the two with correct FIFO sizes for each.
This is the first piece of class data for SPIPS, so this patch seesthe creation of the XilinxSPIPSClass definition and assoicated QOM...
xilinx_spips: Trash LQ page cache on mode change
Invalidate the LQSPI cached page when transitioning into LQSPI mode.Otherwise there is a possibility that the controller will return staledata to the guest when transitioning back to LQ_MODE after a page...
xilinx_spips: Add automatic start support
SPI has a mode where it automatically starts based on tx fifooccupancy. Implemented.
xilinx_spips: Implement automatic CS
Implement the automatic CS control feature. If the MANUAL_CS bit iscleared then the chip select stay de-asserted as long as the tx FIFOis empty.
xilinx_spips: seperate SPI and QSPI as two classes
Make SPI and QSPI different classes. QSPIPS is setup as a child of SPIPS.Only QSPI has the LQSPI functionality, so move all that to the child class.
xilinx_spips: Make interrupts clear on read
By default these interrupts are clear on read.
xilinx_spips: Inhibit interrupts in LQSPI mode
The real hardware does not produce interrupts in LQSPI mode. Inhibitgeneration of interrupts when the LQ_MODE bit is set.
xilinx_spips: Add verbose LQSPI debug output
You really need this is you want to track a guest banging on LQSPI.
xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)
We are currently setting the PCI hole to start at HVM_BELOW_4G_RAM_END,that is 0xf0000000.Start the PCI hole at 0xe0000000 instead, that is the same value used bypc_init1 and qemu-xen-traditional....
xen: remove xen_vcpu_init
No need for xen_vcpu_init anymore:
- the RTC emulator doesn't have any periodic timers continuously runningeven in absence of guest interactions anymore;
- qemu_dummy_start_vcpu takes care of disabling TCG for us, so we don't...
xen: use pc_init_pci instead of pc_init_pci_no_kvmclock
Call kvmclock_create only if kvmclock_enabled.Use pc_init_pci on Xen rather than pc_init_pci_no_kvmclock.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen: simplify xen_enabled
No need for preprocessor conditionals in xen_enabled: xen_allowed isalways defined.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>CC: qemu-stable@nongnu.org
main_loop: do not set nonblocking if xen_enabled()
xen_machine_pv: do not create a dummy CPU in machine->init
This fixes a regression introduced by:
commit 62fc403f11523169eb4264de31279745f48e3eccAuthor: Igor Mammedov <imammedo@redhat.com>Date: Mon Apr 29 18:54:13 2013 +0200
target-i386: Attach ICC bus to CPU on its creation...
po/hu.po: Hungarian translation for the GTK+ interface
Cc: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Ákos Kovács <akoskovacs@gmx.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Message-id: 1367860492-3357-1-git-send-email-akoskovacs@gmx.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'kraxel/usb.83' into staging
Merge remote-tracking branch 'mjt/trivial-patches' into staging
xhci: add live migration support
With all preparing pieces in place we can finally drop inthe vmstate structs and the postload function.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
xhci: add XHCISlot->addressed
Preparing for live-migration support, post_load will need that.
xhci: add xhci_alloc_epctx
Factor out endpoint context allocation to a separate function.xhci live migration will need that too, in post_load.
xhci: add xhci_init_epctx
Factor out endpoint context initialization to a separate function.xhci live migration will need that too, in post_load.
pci: add VMSTATE_MSIX
Using a trick cut+pasted from vmstate_scsi_deviceto wind up msix_save and msix_load.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
Fix usage of USB_DEV_FLAG_IS_HOST flag.
USB_DEV_FLAG_IS_HOST is the bit number, not value. Booting with a"Fitbit Base Station" USB dongle was triggering this assert.
Signed-off-by: Michael Marineau <mike@marineau.org>Cc: qemu-stable@nongnu.orgSigned-off-by: Gerd Hoffmann <kraxel@redhat.com>
host-libusb: Correct test for USB packet state
USB_RET_ASYNC is -6, so inflight was always false.
Signed-off-by: Ed Maste <emaste@freebsd.org>Cc: qemu-stable@nongnu.orgSigned-off-by: Gerd Hoffmann <kraxel@redhat.com>
tcx: Fix 24-bit display mode
Commit d08151bf (conversion of tcx to the memory API) broke the 24-bit mode ofthe tcx display adapter by accidentally passing in the final address of thedirty region to memory_region_reset_dirty() instead of its size.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>...
pvpanic: use FWCfgState explicitly
Use the type-safe FWCfgState structure insteadof the unsafe void *.
fw_cfg: move typedef to qemu/typedefs.h
Less header dependencies this way.
fw_cfg: add API to find FW cfg object
Remove some code duplication by adding afunction to look up the fw cfg file.This way, we don't need to duplicate same strings everywhere.Use by both fw cfg and pvpanic device.
fw_cfg: fw_cfg is a singleton
Make sure we only have a single instance ever:because if it isn't we can't find it so it'suseless anyway.
apic: rename apic specific bitopts
apic has its own version of bitops, with thedifference that it works on u32 and not long.Add apic_ prefix to avoid namespace clashes.
We should look into reusing standard bitops long-term,but that's not entirely trivial....
refer to FWCfgState explicitly
Currently some places use pointer-to-void even though they meanpointer-to-FWCfgState. Clean them up.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
firmware_abi: move to include/hw/nvram/
firmware_abi.h with structs for OpenBIOS landed in hw/sparc/ by mistake- move it to hw/nvram/ alongside fw_cfg.h. In addition to sparc it'sincluded from ppc mac_nvram.c and will need to include it from prep.c in...
dec.c - move to pci-bridge
Looks like dec.c is in pci-host by mistake.Moving it over to pci-bridge.
Acked-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
slirp: cleanup leftovers from misc.h
There are quite a few leftover declarations in slirp/misc.h.Remove them.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qemu: fix out of tree cross compile
The symlink to "asm" platform linux headers is made in the build tree bythe configure script but gcc is not told to look for them there.
The patch fixes this.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
m25p80: Add Micron n25q032a
Based on the datasheet athttp://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_32mb_1_8v_65nm.pdf
Signed-off-by: Ed Maste <emaste@freebsd.org>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
do not check pointers after dereferencing them
Two instances, both spotted by Coverity. In one, two blocks wereswapped. In the other, the check is not needed anymore.
Cc: qemu-stable@nongnu.orgCc: qemu-trivial@nongnu.orgSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>...
don't run pkg-config for features explicitly disabled
We test pkg-config for curses and curl even if those are explicitlydisabled. Move these tests inside `if "$feature" != "no"' sections.
Remove unnecessary break statements
Fix these warnings from cppcheck:
hw/display/cirrus_vga.c:2603:hw/sd/sd.c:348:hw/timer/exynos4210_mct.c:1033:target-arm/translate.c:9886:target-s390x/mem_helper.c:518:target-unicore32/translate.c:1936: style: Consecutive return, break, continue, goto or throw statements are unnecessary....
debugcon: fix always print "addr=0x0, val=0x0" bug when use DEBUG_DEBUGCON
when use DEBUG_DEBUGCON, screen spits:debugcon: write addr=0x0000 val=0x00Rdebugcon: write addr=0x0000 val=0x00udebugcon: write addr=0x0000 val=0x00ndebugcon: write addr=0x0000 val=0x00...
debugcon: make debug message more readable
before change:Bdebugcon: write addr=0x0000 val=0x6fodebugcon: write addr=0x0000 val=0x6fodebugcon: write addr=0x0000 val=0x74tdebugcon: write addr=0x0000 val=0x69idebugcon: write addr=0x0000 val=0x6endebugcon: write addr=0x0000 val=0x67...
debugcon: fix compiler warning when open DEBUG_DEBUGCON
compiler warnings: CC hw/char/debugcon.ohw/char/debugcon.c: In function ‘debugcon_ioport_write’:hw/char/debugcon.c:58: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’...
configure: remove confusing file manipulation
The configure script had some code to manipulate config-host.ld~ (i.e.,a common backup filename), comparing it with the newly-generated file.I believe the sense of the comparison was backwards.
Since it seemed to serve little purpose anyway, remove it to avoid any...
linux-user: Fix typo in comment
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
rtc: remove rtc_set_date
Since it's not defined and used anywhere.
Cc: qemu-trivial@nongnu.orgSigned-off-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
configure: try pkg-config ncurses first
When probing for ncurses, try pkg-config first rather than afterexplicit -lncurses and -lcurses. This fixes static linking in the casethat ncurses has additional dependencies, such as -ltinfo (as on FreeBSD).
Signed-off-by: Ed Maste <emaste@freebsd.org>...
docs: Fix typo and update file in migration
This patch fix some typo and update the file that alreadymoved.
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
migration: Remove duplicate bandwidth_limit set
bandwidth_limit is double set in migrate_init(), remove one.
target-i386: Fix aflag logic for CODE64 and the 0x67 prefix
The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR.While fixing this, tidy and comment the code so that it's more obviouswhat's going on in setting both aflag and dflag.
The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the...
s390/ipl: Fix spurious errors in virtio
With the ccw ipl code sometimes an error message like"virtio: trying to map MMIO memory" or"Guest moved used index from %u to %u" appeared. Turns outthat the ccw bios did not zero out the vring, which mightcause stale values in avail->idx and friends, especially...
Merge remote-tracking branch 'mdroth/qga-pull-2013-05-30' into staging
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
target-i386: Fix mask of pte index in memory mapping
Function walk_pte() needs pte index to calculate virtual address.However, pte index of PAE paging or IA-32e paging is 9 bit, so the maskshould be 0x1ff.
Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>...
target-i386: fix abort on bad PML4E/PDPTE/PDE/PTE addresses
The code used to walk IA-32e page-tables, and possibly PAE page-tables,uses the bit mask ~0xfff to get the next PML4E/PDPTE/PDE/PTE address.
However, as we use a uint64_t to store the resulting address, that mask...
seccomp: add the asynchronous I/O syscalls to the whitelist
In order to enable the asynchronous I/O functionality when using theseccomp sandbox we need to add the associated syscalls to thewhitelist.
Signed-off-by: Paul Moore <pmoore@redhat.com>Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>...
gdbstub: do not restart crashed guest
If a guest has crashed with an internal error or similar, detachinggdb (or any other debugger action) should not restart it.
Cc: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qdev: fix get_fw_dev_path to support to add nothing to fw_dev_path
Recent virtio refactoring in QEMU made virtio-bus become the parent busof scsi-bus, and virtio-bus doesn't have get_fw_dev_path implementation,typename will be added to fw_dev_path by default, the new fw_dev_path...
qga: save state directory in ga_install_service()
If the user selects a non-default state directory at service installationtime, we should remember it in the registered service.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Makefile: create ".../var/run" when installing the POSIX guest agent
Otherwise the default local state directory of POSIX qga won't exist afterinstallation with a non-standard ${prefix} or DESTDIR.
For now qga is the only user of ".../var" (= $qemu_localstatedir) too, so...