Enable migration without shared storage from the monitor
This patch adds the option to activate non-shared storage migration from themonitor.The migration command is as follows:(qemu) migrate -d tcp:0:4444 # for ordinary live migration(qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy...
kvm: Add arch reset handler
Will be required by succeeding changes.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: x86: Refactor use of interrupt_bitmap
Drop interrupt_bitmap from the cpustate and solely rely on the integerinterupt_injected. This prepares us for the new injected-interruptinterface, which will deprecate the bitmap, while preservingcompatibility....
Block live migration
This patch introduces block migration called during live migration. Blockare being copied to the destination in an async way. First the code willtransfer the whole disk and then transfer all dirty blocks accumulted duringthe migration....
char: rename qemu_chr_reset to qemu_chr_generic_open
This function sends out the OPENED event to backends thathave drive the chardevs. The 'reset' is now a historicalartifact and we can now just call the function for what itis.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Expose a mechanism to trace block writes
To support live migration without shared storage we need to be able to tracewrites to disk while migrating. This Patch expose dirty block tracking perdevice to be polled from upper layer.
Changes from v4:- Register dirty tracking for each block device....
char: don't limit data sent to backends to 1k per buffer
chardevs have a 'can_read' function via which backends specifythe amount of data they can receive. When can_read returns > 0,apps can start sending data. However, each chardev driver hereallows a max. of 1k bytes inspite of the backend being able to...
char: Remove special init_reset handling
The initial_reset sent to chardevs doesn't do much other than settinga bool to true. Char devices are interested in the open event andthat gets sent whenever the device is opened.
Moreover, the reset logic breaks as and when qemu's bh scheduling...
LAN9118 emulation
Add SMSC LAN9118 ethernet emulation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
ARM PB-A8 support
Add ARM Realview PB-A8 board support.
mips_r4k: fix reset
(broken by 45a50b1668822c23afc2a89f724654e176518bc4)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
PPC64: map Uni-North AGP bus aka fix Linux boot
Uni-North AGP device mapping was accidentally dropped in2e29bd04786003561303dcad940b38afe790fb9b.
Map the device.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
PPC64: Partial fix to Linux crash: revert to old devfn
Before 2e29bd04786003561303dcad940b38afe790fb9b, Uni-North host and AGPbridge were using the same devfn, 11 << 3. The net effect was that onlyAGP bridge was visible. This was changed in the commit to 13 << 3 for AGP....
PCI: make duplicate devfn allocation fatal
Only two callers of pci_create_simple/pci_register_device botheredto check the return value. Other cases were prone to crashing withspurious NULL pointer dereferences.
Make QEMU exit with an error message when devfn is attempted to...
Do not execute shell scripts directly
Signed-off-by: malc <av1474@comtv.ru>
mips malta: fix indentation
target-mips: fix indentation
mips-malta: fix reset
mips: fix cpu_reset memory leak
Remove cpu_mips_register()- move mmu_init(), fpu_init() and mvp_init() into cpu_mips_init()- move the other parts in cpu_mips_init()
Reported-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fix make clean targets
This patch fixes clean in case of missing directories andalso adds code to distclean that removes the following files: qemu-monitor.texi roms/seabios/config.mak roms/vgabios/config.mak
Signed-off-by: Magnus Damm <damm@opensource.se>...
sh4 disasm fixes
Add the sh4 target to the monitor disassembly function,and remove a duplicate "0x" printout from the sh4 dis-assembly code.
Signed-off-by: Magnus Damm <damm@opensource.se>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/i386: remove duplicate sar opcode
pci: Fix function pci_default_write_config
Change 260c0cd3d985e51b15870ff47e17b7b930efbda1(pci: use range helper functions) introduced abug which made pci cirrus vga on mips malta(and maybe other pci devices) fail.
Don't change addr - its original value is needed...
mips: fix CPU reset
Don't load the kernel twice during reset.See f2d74978764f62d832d61ac17bb5d934ade58816.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix PPC crash
Because of a typo, structure field vga_bios_size was not initializedproperly and a bogus BAR6 for the nonexistent VGA BIOS appeared.
The bug was uncovered by c169998802505c244b8bcad562633f29de7d74a4.
ARM MPCore tweaks
Allow the user to specify the number of cores present on theRealView EB + ARM11MPCore board. Also split into its own configrather than guessing from the CPU name.
Realview/EB procid hacks
Guess core tile ID based on CPU type.
pci: fix the conversion of config field from array to pointer
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix 32-bit overflow in parallels image support
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
e1000 fix: read access to some registers is missing.
While writing working on an e1000 driver for my university's OS Inoticed that some registers aren't readable in QEMU, but they shouldbe readable as stated in Intels Driver Developer Manual (and alsoverified on real hardware)....
vnc: improve capslock handling.
When capslock is toggled while the vnc window hasn't the focus qemuwill miss the state change. Add sanity checks for the capslock stateand toggle it if needed, so hosts and guests idea of capslock statestay in sync. Simliar logic for numlock is present in qemu already....
fdc: fix vmstate variable passed
When code was transformed to use qdev_reset/vmstate registration, vmstatewas passed a variable of the wrong type
qemu_system_reset: we need to call it before loadvm/migration
fix type in CFLAGS name
Fix incoming migration
commit b04c4134d6de28c249277de19e523bfbe4aebbd6broke incoming migration. After talking with Gleb, code was intendedto be the way is in this fix. This fixes migration here.
savevm: Delete existing snapshots in all images
When creating a snapshot we can run into the situation that the first diskdoesn't have a snapshot, but the second one does have one with the same name asthe new snapshot.
In this case, qemu doesn't recognize that there is a snapshot to be...
virtio-blk: Pass read errors to the guest
We need to signal not only write errors, but also read errors to the guestdriver. This fixes a regression introduced by 869a5c6d.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: Move KVM mp_state accessors to i386-specific code
Unbreaks PowerPC and S390 KVM builds.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm ppc: Remove unused label
eepro100: Fix boot ROM support
eepro100: Add missing .exit initialisation
Some devices did not have an initialisation valuefor entry ".exit". This is fixed here.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Makefile: Fix definition of pxe-*.bin blobs
qdev: Check if unplug handler exists before calling it
A bus may have hotplugging enabled but not have the 'unplug'callback defined, which would lead to a crash on trying tounplug a device on the bus.
Fix by introducing an assert to check if the callback is valid....
fix parallel build
Based on a ideas of Daniel Jacobowitz + Stefan Weil
serial: Add interface to set reference oscillator frequency
Many (most?) serial interfaces have a programmableclock which provides the reference frequency ("baudbase").So a fixed baudbase which is only set once can be wrong.
omap1.c is an example which could use the new interface...
Makefile: Prettify logging
Replace GEN config-all-devices.makby GEN config-all-devices.mak
Like this, the logging output is column aligned.
microblaze: Move the kcmdline out of the way.
Avoids rom overlap conflicts.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Restore env when raising unmapped bus access.
microblaze: Unbreak reset.
Initialize synthesis config registers at reset to cope with the newcpu_reset sequences.
Fix ARM MCore secondary cpu boot
Make MPCore secondary cpu initialization work with the new resethandling. Also change the inital FLAG value from 3 to zero to matchrecent kenrels.
Reject late rom loading
rom_+add_file/rom_add_blob only work correctly if called beforeload_all_roms. Enforce this rather than silently accepting and puttingthe rom in the wrong place at reset.
Fix ARM system emulation
Since 45a50b1 load_image_targphys should only be called once.ARM boards incorrectly call it every time the system is reset.
QemuOpts: dump config.
Add a function to write the QemuOpts configuration to a git-styleconfig file.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QemuOpts: parse config from file.
Add functions to parse QemuOpts from a git-style config file.
QemuOpts: command line switches for the config file.
Adds -readconfig and -writeconfig command line switches to read/writeQemuOpts from config file.
In theory you should be able to do:
qemu < machine config cmd line switches here > -writeconfig vm.cfg...
Added imlpementation for qemu_error for non-qemu executables
Now qemu_error can be called also from shared files, e.g. block.c.
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Documentation: Add documentation for -chardev
Adds documentation for all -chardev backends.
Signed-off-by: Matthew Booth <mbooth@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Documentation: Move image format descriptions to own section
The description of the image formats is too long to be a subitem of a parameterdescription. It will become even longer when we include the options provided bythe respective format.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
Documentation: Don't mention old qemu-img options
The old options are still supported for compatibility, but they areinconsistent (for example create -b vs. convert -B for backing files) andincomplete (-F only exists for create) which tends to confuse people. Remove...
Documentation: Add options to image format descriptions
Explain the existing format specific options that can be used with qemu-imgcreate/convert -o ...
QemuOpts: add find_list()
Factor out the QemuOptsList search code for upcoming users.
eepro100: Improve support for different devices
pci: use range helper functions.
clean up pci_default_write_config() by the range helper functions.
Suggested by Michael S. Tsirkin <mst@redhat.com>Cc: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: teach pci_default_config_write() ROM bar for normal/bridge device .
When updated ROM expantion address of header type 0, it missedto update mappings.Add PCI_ROM_ADDRESS check whether to call pci_update_mappings()Also update pci mapping when PCI_ROM_ADDRESS1 is written for header type 1....
pci: initialize pci config headers depending it pci header type.
- Only sets default subsystem id for header type 00.(normal header type) because header type 01 doesn't have subsystem id, and uses the register for other purpose. So setting default subsystem id doesn't make sense....
pci: cosmetic on pci_upadte_mappings()
Remove one indentation of pci_update_mappings.Just for cosmetics, no logic change.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: factor out pci_for_each_device().
split out device iteration logic from pci_for_each_device().factored out function, pci_for_each_device_under_bus() will be used later.
pci: implement pci bridge filtering.
This patch implements pci bridge filtering.
TODO: currently almost all the map funcions assumesfiltered_size size and addr & ~(size - 1) addr.However with bridge filtering, they aren't always true.Teach them such cases, such that filtered_size < size and...
pci/monitor: print out bridge's filtering values and so on.
make pci_info_device() print out bridge's filtering value likeio base/limit, subbus and subordinate bus.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci: 64bit bar support.
implemented pci 64bit bar support.The tricky bit is pci_update_mapping().An OS is allowed to set the BAR such that OS can't address the areapointed by BAR. It doesn't make sense, though.In that case, don't map the BAR.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pci: remove bus_num member from struct PCIBus.
Since It can be retrieved from pci configuration space,the member is unnecessary.
pci: make pci configuration transaction more accurate.
This patch sorts out/enhances pci code to track pci bus topologymore accurately.- Track host bus bridge with pci domain number. Although the current qemu implementation supports only pci domian 0 yet....
pci: factor out the conversion logic from io port address into pci device.
factor out the logic which converts io port address into pci deviceand offset in PCI configuration space.
pci: move pci host stuff from pci.c to pci_host.c
Move pci host stuff from pci.c to pci_host.c.And add some comments.Later pcie host bridge functions will be defined in pcie_host.cnot to bloat pci.c.
pci_host: change the signature of pci_data_{read, write}.
change the first argument, void opaque to PCIBus *sof the pci_data_{read, write}.They aren't used as direct callback so the argument typedon't have to be void. So change it to the right type....
vmstate: introduce VMSTATE_BUFFER_UNSAFE_INFO.
VMSTATE_BUFFER_UNSAFE_INFO for as a buffer with specified VMStateInfo.It will be used later.
pci: pcie host and mmcfg support.
This patch adds common routines for pcie host bridge and pcie mmcfg.This will be used by q35 based chipset emulation.
pci: add helper functions to check ranges overlap.
add helper function to check ranges overlap suggested byMichael S. Tsirkin <mst@redhat.com>.His original suggestion was to use [first, last], however I chosento use offset, length pair, i.e. [offset, offset + length)...
pci_host: consolidate pci config address access.
consolidate pci_config address access into pci_host.c
pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t
This patch is preliminary for 64 bit BAR support.Introduce dedicated type, pcibus_t, to represent pci bus address/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: introduce FMT_PCIBUS for printf format for pcibus_t.
This patch is preliminary for 64bit BAR.Later pcibus_t will be changed from uint32_t to uint64_t.Introduce FMT_PCIBUS for printf format for pcibus_t.
pci: typedef pcibus_t as uint64_t instead of uint32_t.
This patch is preliminary for 64bit bar.For 64bit bar support, change pcibus_t which representspci bus addr/size from uint32_t to uint64_t.And also change FMT_pcibus for printf.
In pci_update_mapping() checks 32bit overflow....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
pci: clean up of pci_default_read_config.
This patch cleans up pci_default_read_config() removingugly length and range check.
Suggested by "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci: make pci_bar() aware of header type 1.
make pci_bar() aware of header type 1. When PCI_ROM_SLOTit should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)
pci_host.h: move functions in pci_host.h into .c file.
split static functions in pci_host.h into pci_host.c andpci_host_template.h.Later a structures declared in pci_host.h, PCIHostState, will be used.However pci_host.h doesn't allow to include itself easily. This patches...
pci: use helper functions to access pci config space.
use pci_[gs]et_{byte, word, long}() to access pci configurationspace.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci/bridge: clean up of pci_bridge_initfn()
- use symbolic constant- use helper function pci_set_xxx()- removed lines which initializes to 0. It is unnecessary because it is already zeroed.- add some comments on command registers.
Some initial values are suspicious because they seems to...
pci: clean up pci_init_wmask()
use pci_set_word() for pci command register.
pci: fix PCI_DPRINTF() wrt variadic macro.
add missing ## in PCI_DPRINTF() to compile.
pci: introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.and use it.
pci: use PCI_SLOT() and PCI_FUNC().
use PCI_SLOT() and PCI_FUNC() where appropriate instead ofdirect use of bit operation.
pci: define a constant to represent a unmapped bar and use it.
define a constant to represent a unmapped bar instead of -1 and use it.
pci: helper functions to access PCIDevice::config
add helper functions to get/set PCIDevice::configThose will be used later.
qemu-img: Allow creating zero sized images
A size of 0 should be valid and cannot be treated as "missing value". Use -1for this purpose instead.
whitelist host virtio networking features
This patch is a followup to 8eca6b1bc770982595db2f7207c65051572436cb,fixing crashes when guests with 2.6.25 virtio drivers have saturatedvirtio network connections.
https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/458521...
Makefile: make qemu-img dependant on config-host.h
Since config-host.h is generated by the Makefile (1215c6e76),building (only) qemu-img fails:
[user@f12-uri qemu]$ make distclean (or git clone qemu)[user@f12-uri qemu]$ ./configure ...[user@f12-uri qemu]$ make qemu-img...
scsi: move scsi.h -> esp.h
scsi: move scsi-disk.h -> scsi.h
Makefile: make qemu-io dependent on config-host.h
This is needed also for qemu-io, but not for qemu-nbd.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>