History | View | Annotate | Download (157 kB)
QMP: Really move the RESET event to qemu_system_reset()
Something bad has happened in the merge of commit 0ee44250, asthe log message says it's supposed to be in qemu_system_reset()but it is do_vm_stop().
Possibly, it was a problem with the conflict resolution with...
QMP: Introduce RTC_CHANGE event
Emitted whenever the RTC time changes.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QMP: Move RESET event into qemu_system_reset()
Nothing will change as that function is currently only called bythe main loop code, but it's the right place for the RESET event,as it's where the reset is actually performed.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
QMP: Drop DEBUG event
This event has been introduced in the first round of QMP commits,turns out that it's based on the usage of the EXCP_DEBUG macro,which has discussable semantics when exposed through QMP.
As libvirt doesn't use this, let's just drop it....
QMP: Move STOP event into do_vm_stop()
I've introduced the STOP event in the main loop, this is wrongas it will be only emitted if the io thread is enabled.
This fixes that by moving the STOP event to do_vm_stop().
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
Add option to use file backed guest memory
Port qemu-kvm's -mem-path and -mem-prealloc options. These are usefulfor backing guest memory with huge pages via hugetlbfs.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>CC: john cooper <john.cooper@redhat.com>
Merge remote branch 'qemu-kvm/uq/master' into staging
Add cpu model configuration support..
This is a reimplementation of prior versions which addsthe ability to define cpu models for contemporary processors.The added models are likewise selected via -cpu <name>,and are intended to displace the existing convention...
block SIGCHLD in vcpu thread(s)
Otherwise a vcpu thread can run the sigchild handler causingwaitpid() from iothread to fail.
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm specific wait_io_event
In KVM mode the global mutex is released when vcpus are executing,which means acquiring the fairness mutex is not required.
Also for KVM there is one thread per vcpu, so tcg_has_work is meaningless.
Add a new qemu_wait_io_event_common function to hold common code...
kvm: consume internal signal with sigtimedwait
Change the way the internal qemu signal, used for communication betweeniothread and vcpus, is handled.
Block and consume it with sigtimedwait on the outer vcpu loop, whichallows more precise timing control....
use lazy initialization for display_state
Ensure initialization of a dumb display, if needed, by makingall accesses go through get_displaystate.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
remove knowledge of defaultallocator_free_displaysurface from sdl.c
Let register_displayallocator hand over the old width/height to the newallocator.
move default allocator to console.c
Moving stuff in console.c to avoid the need for prototypes makesthis patch a bit bigger, but there's no change in the code.
net: net_check_clients() runs too early to see -device, fix
Call it right after -device devices get created.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
use eventfd for iothread
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
iothread: fix vcpu stop with smp tcg
Round robin vcpus in tcg_cpu_next even if the vm stopped. Thisallows all cpus to enter stopped state.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
do not loop on an incomplete io_thread_fd read
No need to loop if less than a full buffer is read, the nextread would return EAGAIN.
loop write in qemu_event_increment upon EINTR
Same as what qemu-kvm does.
add qemu_get_clock_ns
Some places use get_clock directly because they want to access thert_clock with nanosecond precision. Add a function to do exactly thatinstead of using internal interfaces.
Merge remote branch 'qemu-kvm/uq/master' into staging-tmp
Revert "On some systems printf is a macro"
This reverts commit bc5b6004588ad17370e0416e40b4aa9cf977023b.
do not interpolate % from vl.c to qemu-options.h
Since qemu-options.h is only used in vl.c, we can avoid usingbrittle interpolation from a generated file.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
vl.c: avoid preprocessor directives in a printf call
Similar to the qemu-img.c patch, but I also have to unescape remaining% signs in qemu-options.hx.
On some systems printf is a macro
Signed-off-by: malc <av1474@comtv.ru>
fix undefined shifts by >32
This one is for 0.12 too.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix incoming migration with iothread
Do not allow the vcpus to execute if the vm is stopped.
Fixes -incoming with CONFIG_IOTHREAD enabled.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Flush coalesced MMIO buffer periodly
The default action of coalesced MMIO is, cache the writing in buffer, until:1. The buffer is full.2. Or the exit to QEmu due to other reasons.
But this would result in a very late writing in some condition.1. The each time write to MMIO content is small....
qdev: Fix exit code for -device ?
Help was shoehorned into device creation, qdev_device_add(). Sincehelp doesn't create a device, it returns NULL, which looks to callersjust like failed device creation. Monitor handler do_device_add()doesn't care, but main() exits unsuccessfully....
Fix regression in option parsing
Commit ec229bbe7 broke invocation without a specific -hda. IOW, qemu foo.img.The lack of an optind update caused an infinite loop.
Reported-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: Add memory statistics reporting to the balloon driver
When using ballooning to manage overcommitted memory on a host, a system forguests to communicate their memory usage to the host can provide informationthat will minimize the impact of ballooning on the guests. The current method...
virtio-console: Automatically use virtio-serial-bus for the older -virtioconsole invocation
These hunks got dropped off mysteriously during the rebasing of myvirtio-serial series. Thanks go to Markus for noticing it.
Without these fixes, -virtioconsole doesn't actually have any effect....
vl.c: fix warning with _FORTIFY_SOURCE
CC i386-softmmu/vl.occ1: warnings being treated as errors/usr/src/RPM/BUILD/qemu-0.11.92/vl.c: In function 'qemu_event_increment':/usr/src/RPM/BUILD/qemu-0.11.92/vl.c:3404: error: ignoring return value of 'write', declared with attribute warn_unused_result...
Move out option lookup into a separate function
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Load global config files by default
A new option, nodefconfig is introduced to prevent loading from the defaultconfig location. Otherwise, two configuration files will be searched for,qemu.conf and target<TARGET_NAME>.conf.
To ensure that the default configuration is overridden by a user specified...
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...
Make CDROM a read-only drive
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.
Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...
vl.c: Remove dead assignment
clang-analyzer pointed out the value of 'sockets' is never reused.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: Andre Przywara <andre.przywara@amd.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
move kbd/mouse handling to input.c
Move 200 lines out of vl.c already into common code that only needs tobe compiled once.
Fix CPU topology initialization
Late initialization of CPU topology in CPUState prevents KVM guests toactually see the topology.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
debugcon: support for debugging consoles (e.g. Bochs port 0xe9)
Add generic support for debugging consoles (simple I/O ports whichwhen written to cause debugging output to be written to a target.)The current implementation matches Bochs' port 0xe9, allowing the same...
USB: Improve usbdevice error messages
When an non-existent USB device is specified on the command line,print "qemu: could not add USB device 'X'".Likewise for the usb_{add,del} monitor commands.
Signed-off-by: Scott Tsai <scottt.tw@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fix pidfile option to work in WIN32
Explicit read/write locking pidfile under WIN32 is bit extremenobody get the chance to read the pidfile. Convert to a write-only lock.
Also, creating pidfile was disabled along with daemonize underWIN32. Enable it, but do not enable daemon support which doesn't...
usb-net: use qdev for -usbdevice
Rebased to master, adapted to device renaming by armbru,no other changes.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix vga names in default_list
Fix mismerge between 64465297 and 556cd098.
Cc: Markus Armbruster <armbru@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
defaults: split default_drive
Split default_drive into default_{floppy,cdrom,sdcard}.Also add QEMUMachine flags to disable them per machine.
defaults: update device_list[]
Add isa-fdc (disables default_floppy).Add ide-drive (disables default_cdrom).
Also walk the -global QemuOpts, so we'll catch-global isa-fdc.drive{A,B}=<name> too.
Check rom_load_all() return value.
Check rom_load_all() return value.Also don't make option rom loading failure fatal.
Revert "Rename DriveInfo.onerror to on_write_error" (fix mismerge)
Part of the first patch of the -drive rerror series has been merged once moreon top of the rest of the series. This effectively disables the rerror optionand always goes with the default value. Reverting the commit re-enables the...
add default virtcon initialization
When going through the default devices, we don't initialize the virtioconsole, unless we're doing -nographic.
I suppose that's just a leftover from the recent code restructuring, solet's put it in.
Signed-off-by: Alexander Graf <agraf@suse.de>...
monitor: Convert do_info_mice() to QObject
Each mouse is represented by a QDict, the returned QObject is a QList ofall mice.
This commit should not change user output.
default devices: virtio consoles.
This patch adds a variable default_virtcon which says whenever a defaultvirtio console should be added. It is disabled by default, followuppatch will enable it for s390. It is cleared when qemu finds'-virtiocon', '-device virtio-console-s390' or '-device...
Set default console to virtio on S390x
All "normal" system emulation targets in qemu I'm aware of displayoutput on either VGA or serial output.
Our S390x virtio machine doesn't have such kind of legacy hardware. Soinstead we need to default to a virtio console....
default devices: add global cmd line option.
Add global command line option to disable default devices.
default devices: network
Add a default_net variable which specified whenever a default networkshould be created. It is cleared in case any -net option is specifiedand it is also added to the new -nodefaults switch.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
default devices: drives
Add a default_drive variable which specified whenever the default drives(cdrom, floppy, sd) should be created. It is cleared when the new-nodefaults switch is specified on the command line.
rework -monitor handling, switch to QemuOpts
This patch reworks the -monitor handling:
- It adds a new "mon" QemuOpts list for the monitor(s). - It adds a monitor_parse() function to parse the -monitor switch. - It adds a mon_init function to initialize the monitor(s) from the...
add new -mon switch
Add -mon switch which maps pretty straight forward into the QemuOptsinternal representation:
-mon chardev=<name>[,mode=[control|readline]][,[no]default]
Via config file:
[mon] chardev = "<name>" mode = "readline" default = "on"...
add -qmp convinience switch
Acts like -monitor but switched into qmp mode.
default devices: core code & serial lines.
Qemu creates a default serial line for you in case you didn't specifyone on the command line. Right now this is tied to the '-serial<chardev>' command line switch, which in turn causes trouble if you arecreating your serial line via '-device isa-serial,<props>'....
default devices: parallel port.
Qemu creates a default parallel port for you in case you didn't specifyone on the command line. Right now this is tied to the '-parallel<chardev>' command line switch, which in turn causes trouble if you arecreating your parallel port via '-device isa-parallel,<props>'....
default devices: qemu monitor.
This patch makes the monitor default device configuration work like thedefault serial and parallel port devices. It adds a variabledefault_monitor which says whenever a default monitor should be added.It is enabled by default. It is cleared when qemu finds '-monitor' on...
zap serial_monitor_mux
The logic in this code obviously predates the multiple monitorcapability of qemu and looks increasingly silly these days.
I think the intention of this piece of code is to get a reasonabledefault for the -nographic case: have monitor and serial line muxed...
default devices: vga adapter.
Qemu creates a vga display for you in case you didn't specify one on thecommand line. Right now this is tied to the '-vga <type>' command lineswitch, which in turn causes trouble if you are creating your gfx cardusing '-device VGA,<props>'....
chardev: make chardevs specified in config file work.
The patch decuples the -chardev switch and the actual chardevinitialization. Without this patch qemu ignores chardev entriescoming via -readconfig.
Revert "monitor: Command-line flag to enable control mode"
This reverts commit adcb181afe5a951c521411c7a8e9d9b791aa6742.
Conflicts:
monitor.h
Revert "Set default console to virtio on S390x"
This reverts commit 93d434b4aec0702b87ebf52449a3cdf2c3596825.
chardev: move greeting into vc backend.
Make the 'vc' chardev backend print a title line with the chardev nameafter initialization, using CharDriverState->label.
This replaces the banner printing code in vl.c.
qdev: make compat stuff more generic
This patch renames the compat properties into global properties andmakes them more generic. The compatibility stuff is only one ofmultiple possible users now.
qdev: add command line option to set global defaults for properties.
This patch adds infrastructure and command line option for settingglobal defaults for device properties, i.e. you can for example use
-global virtio-blk-pci.vectors=0
to turn off msi by default for all virtio block devices. The config...
All "normal" system emulation targets in qemu I'm aware of display outputon either VGA or serial output.
monitor: rename EVENT_* to QEVENT_* to avoid conflict on mingw32
Partially fixes mingw32 build.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is whatthey actually do) or introduce a parameter to distinguish reads and writes.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
ram migration: Properly reset statistics
As we may do more than one migration (cancellation, live backup), resetbytes_transferred on stage 1.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Introduce rerror option for drives
rerror controls the action to be taken when an error occurs while accessing theguest image file. It corresponds to werror which already controls the actiontake for write errors.
This purely introduces parsing rerror command line option into the right...
ide: Implement rerror option
virtio-blk: Implement rerror option
ram migration: Stop loading on error
Besides catching real errors, this also allows to interrrupt the qemuprocess during restore.
live migration: Allow cleanup after cancellation or error
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel alive migration. This gives the involved subsystems a chance to clean updynamically allocated resources. Namely, the block migration layer can...
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor thatinitiated the migration, forward the monitor reference through themigration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
net: move slirp code from net.c to net/slirp.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QMP: Introduce basic asynchronous events
Debug, shutdown, reset, powerdown and stop are all basic events,as they are very simple they can be added in the same commit.
monitor: Command-line flag to enable control mode
This commit adds a flag called 'control' to the '-monitor'command-line option. This flag enables control mode.
The syntax is:
qemu [...] -monitor control,<device>
Where <device> is a chardev (excluding 'vc', for obvious reasons)....
Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add support for GNU/kFreeBSD
[WIN32] Enable -k option on Windows too
There is no reason to have it disabled on this platform.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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: 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...
qemu_system_reset: we need to call it before loadvm/migration
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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...
Configurable block format whitelist
We have code for a quite a few block formats. While I trust that allof these formats are useful at least for some people in somecircumstances, some of them are of a kind that friends don't letfriends use in production....
Added readonly flag to -drive command
This is a slightly revised patch for adding readonly flag to the -drive command.Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passesthe readonly attribute of the drive to the guest OS, applied first....
v3: don't call reset functions on cpu initialization
There is absolutely no need to call reset functions when initializingdevices. Since we are already registering them, calling qemu_system_reset()should suffice. Actually, it is what happens when we reboot the machine,...
Revert "Fall back to network boot as the last possible boot option"
This reverts commit 94ca5a985919cca312c505bbb0c824d175cc6bb8.
Fall back to network boot as the last possible boot option
This is similiar to the default with most bare metal systems.
usb-storage: use qdev for -usbdevice
Hook up usb_msd_init.
Also rework handling of encrypted block devices,move the code out vl.c.