History | View | Annotate | Download (129.3 kB)
Add exit notifiers
Like atexit() but with state
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Convert io handlers to QLIST
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rename IOCanRWHandler to IOCanReadHandler
It was always only used for reads
Handle deleted IOHandlers in a single buffer
split out qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
place together more #ifdef CONFIG_IOTHREAD blocks
disentangle tcg and deadline calculation
Just tell main_loop_wait whether to be blocking or nonblocking, so thatthere is no need to call qemu_cpus_have_work from the timer subsystem.Instead, tcg_cpu_exec can say "we want the main loop not to block because...
only one flag is needed for alarm_timer
The ALARM_FLAG_DYNTICKS can be testing simply by checking if there isa rearm function.
more alarm timer cleanup
The timer_alarm_pending variable is related to the alarm timer but notplaced in the struct. Also, in qemu_mod_timer the wrong flag was beingtested: the timer is rearmed in the alarm timer "bottom half", so theright flag to test there is the "pending" flag....
do not use qemu_event_increment outside qemu_notify_event
qemu_notify_event in the non-iothread case is only stopping the currentCPU. However, if the CPU is idle and the main loop is in the selectcall then a call to qemu_event_increment is needed too (as done in...
tweak qemu_notify_event
Instead of testing specially next_cpu in host_alarm_handler, just dothat in qemu_notify_event. The idea is, if we are not running (ornot yet running) target CPU code, prepare things so that the executionloop is exited asap; just make that clear....
remove qemu_rearm_alarm_timer from main loop
Make the timer subsystem register its own callback instead.
extract timer handling out of main_loop_wait
change qemu_run_timers interface
introduce and use qemu_clock_enable
By adding the possibility to turn on/off a clock, yet anotherincestuous relationship between timers and CPUs can be disentangled.
centralize handling of -icount
A simple patch to place together all handling of -icount.
add qemu_icount_round
add qemu_alarm_pending
new function qemu_icount_delta
Tweaking the rounding in qemu_next_deadline ensures that there'sno change whatsoever.
move vmstate registration of vmstate_timers earlier
avoid dubiously clever code in win32_start_timer
The code is initializing an unsigned int to UINT_MAX using "-1", so thatthe following always-true comparison seems to be always-false at afirst look. Since alarm timer initializations are never nested, it is...
fix error in win32_rearm_timer
The TIME_ONESHOT and TIME_PERIODIC flags are mutually exclusive.The code after the patch matches the flags used in win32_start_timer.
Merge remote branch 'markus/qerror' into staging
qemu-option: Move the implied first name into QemuOptsList
We sometimes permit omitting the first option name, for example-device foo is short for -device driver=foo. The name to use("driver" in the example) is passed as argument to qemu_opts_parse()....
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Include the program name in error messages to stderr
error: Track locations in configuration files
New LOC_FILE. Use it for tracking file name and line number inqemu_config_parse(). We now report errors like
qemu:foo.conf:42: Did not find I2C bus for smbus-eeprom
In particular, gems like this message:...
error: Track locations on command line
New LOC_CMDLINE. Use it for tracking option with argument inlookup_opt(). We now report errors like this
qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
savevm: Fix -loadvm to report errors to stderr, not the monitor
A monitor may not even exist.
Change load_vmstate() to use qemu_error() instead of monitor_printf().Parameter mon is now unused, remove it.
error: Simplify error sink setup
qemu_error_sink can either point to a monitor or a file. In practice,it always points to the current monitor if we have one, else tostderr. Simply route errors to the current monitor or else to stderr,and remove qemu_error_sink along with the functions to control it....
Don't set default monitor when there is a mux'ed one
This fixes eg. "-nographic -serial mon:stdio [-serial ...]".
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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.
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
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>'....
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.