History | View | Annotate | Download (98.7 kB)
main-loop: For tools, initialize timers as part of qemu_init_main_loop()
In some cases initializing the alarm timers can lead to non-negligableoverhead from programs that link against qemu-tool.o. At least,setting a max-resolution WinMM alarm timer via mm_start_timer() (the...
mc146818rtc: Use lost_tick_policy property
Allow to configure the MC146818 RTC via the new lost tick policyproperty and replace rtc_td_hack with this mechanism.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Improve default machine options usability
So far we overwrite the machine options completely with defaults if noaccel=value is provided. More user friendly is to fill in onlyunspecified options. The new qemu_opts_set_defaults enables this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
vga: fix -nodefaults -device VGA
Flag -nodefaults should also imply no VGA. This was broken ina369da5f31ddbdeb32a7f76622e480d3995fbb00.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
vga: improve VGA logic
Improve VGA selection logic, push check for device availabilty to vl.c.Create the devices at board level unconditionally.
Remove now unused pci_try_create*() functions.
Make PCI VGA devices optional.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>...
kvm: x86: Establish IRQ0 override control
KVM is forced to disable the IRQ0 override when we run with in-kernelirqchip but without IRQ routing support of the kernel. Set the fwcfgvalue correspondingly. This aligns us with qemu-kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hw/9pfs: Add support to use named socket for proxy FS
Add option to use named socket for communicating between proxy helperand qemu proxy FS. Access to socket can be given by using command lineoptions -u and -g.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
hw/9pfs: Add new proxy filesystem driver
Add new proxy filesystem driver to add root privilege to qemu process.It needs a helper process to be started by root user.
Following command line can be used to utilize proxy filesystem driver-virtfs proxy,id=<id>,mount_tag=<tag>,socket_fd=<socket-fd>...
hw/9pfs: Move opt validation to FsDriver callback
This remove all conditional code from common code path andmake opt validation a FSDriver callback.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Set numa topology for max_cpus
qemu-kvm passes numa/SRAT topology information for smp_cpus to SeaBIOS. HoweverSeaBIOS always expects to setup max_cpus number of SRAT cpu entries(MaxCountCPUs variable in build_srat function of Seabios). When qemu-kvm runs...
g_thread_init users: don't call it if glib >= 2.31
since commit f9b29ca03 included in release 2.31 (docs below say 2.32 butthat is not correct) and onwards g_thread_init is deprecated and callingit is not required:
http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init...
qdev: fix hotplug when no -device is specified
The peripheral[-anon] containers are initialized lazily but since they sit onsysbus, they can not be created after realize. This was causing an abort() tooccur during hotplug if no -device option was used....
vl.c: Move option generation logic into a wrapper file
In vl.c and qemu-options.h we define macros and include qemu-options.defin order to generate different content. Move the bulk of the def'ing andundef'ing into a wrapper, this will make it cleaner when we add another...
vl.c: In qemu -h output, only print options for the arch we are running as
Only print options in the help output that are accepted by our arch.This is less confusing for users and also for other programs thatconsume the help output.
The options affected are:...
vl.c: Print the actual program name in help output
In help() we do what boils down to:
printf("%s", "qemu");
This seems to be an artifact of be995c27640a82c7056b6f53d02ec823570114e5("removed unused code"), which removed some ifdef'ery that used to print...
fix spelling in main directory
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
vl: Tighten parsing of -numa's parameter mem
strtosz_suffix() fails unless the size is followed by 0, whitespace or','. Useless here, because we need to fail for any junk following thesize, even if it starts with whitespace or ','. Check manually.
Things like...
vl: Tighten parsing of -m argument
strtosz_suffix() fails unless the size is followed by 0, whitespace or','. Useless here, because we need to fail for any junk following thesize, even if it starts with whitespace or ','. Check manually.Things like "-m 1024," are now caught....
vl.c: prohibit simultaneous use of -icount with kvm or xen
With -icount, The vm_clock is updated with help from TCG (it countsinstructions at 2^ICOUNT ns/instructions). With KVM, the instructioncount is not available so KVM cannot provide this help.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>...
vl.c: Fail gracefully if no machine is found
machine defaults to find_default_machine(),then gets overridden via -M and machine_parse().
If no -M is specified and find_default_machine() returns NULL(when no machine compiled in), exit with an error.
Avoids a segfault when setting machine->max_cpus....
Clean up assertion in get_boot_devices_list()
g_strdup() can't fail, remove assertion. Assert its argument can't benull, because that's not obvious (add_boot_device_path() ensures it).
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu_timedate_diff() shouldn't modify its argument.
The caller of qemu_timedate_diff() does not expect that tm it passes tothe function will be modified, but mktime() is destructive and modifiesits argument. Pass a copy of tm to it and set tm_isdst so that mktime()...
vl.c: Guard against GThread double-initialization
GThread-ERROR **: GThread system may only be initialized once.aborting...
Making the g_thread_init() call in vl.c conditional resolves an abort onMac OS X, where coroutine-gthread.c seems to call it before vl.c....
Merge remote-tracking branch 'aneesh/for-upstream-7' into staging
hw/9pfs: Add synthetic file system support using 9p
This patch create a synthetic file system with mount tagv_synth when -virtfs_synth command line option is specifiedin qemu. The synthetic file system can be mounted in guestusing 9p using the below command line...
hw/9pfs: Read-only support for 9p export
A new fsdev parameter "readonly" is introduced to control accessing 9p export."readonly" can be used to specify the access type. By default "rw" accessis given to 9p export.
Drop qemu-objects.h from modules that don't require it
Previous commits dropped most qobjects usage from qemu modules(now they are a low level interface used by the QAPI). However,some modules still include the qemu-objects.h header file.
This commit drops qemu-objects.h from some of those modules...
simplify main loop functions
Provide a clean example of how to use the main loop in the tools.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-timer: use atexit for quit_timers
qemu-timer: move more stuff out of qemu-timer.c
main-loop: create main-loop.h
main-loop: create main-loop.c
Merge remote-tracking branch 'aneesh/for-upstream-6' into staging
Conflicts: trace-events
runstate: Allow to transition from paused to postmigrate
The user may already have paused the VM before starting themigration process. If s/he does that, then the state will be'paused' when we finish the migration process. In that casewe want to transition from 'paused' to 'postmigrate' as the...
runstate: Allow user to migrate twice
It should be a matter of allowing the transition POSTMIGRATE ->FINISH_MIGRATE, but it turns out that the VM won't do thetransition the second time because it's already stopped.
So this commit also adds vm_stop_force_state() which performs...
runstate: Print state transition when invalid
Makes it easier to debug.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Drop obsolete nographic timer
We flush coalesced MMIO in the device models now, and VNC - for whichthis was once introduced - is also fine without it as it has its ownrefresh timer.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Move graphic-related coalesced MMIO flushes to affected device models
This is conceptually cleaner and will allow us to drop the nographictimer. Moreover, it will be mandatory to fully exploit future per-devicecoalesced MMIO rings.
hw/9pfs: Rename fstype to fsdriver to make it consistent across VirtFS code
hw/9pfs: Handle Security model parsing
Except local fs driver all other fs drivers (handle, synth) don't needsecurity model. Update fsdev parameter parsing accordingly.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Add new virtfs option writeout=immediate skip host page cache
writeout=immediate implies the after pwritev we do a sync_file_range.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
vl: Change qemu_vmstop_requested() to return a bool
The stop reason is returned in the RunState argument. This is apreparation for a future commit which will convert the query-statuscommand to the QAPI.
RunState: Drop the RSTATE_NO_STATE value
The QAPI framework won't generate it, so we need to get rid of it.
In order to do that, this commit makes RSTATE_PRE_LAUNCH the initialstate and change qemu_vmstop_requested() to use RSTATE_MAX.
RunState: Rename enum values as generated by the QAPI
Next commit will convert the query-status command to use theRunState type as generated by the QAPI.
In order to "transparently" replace the current enum by the QAPIone, we have to make some changes to some enum values....
qapi: Convert query-status
Please, note that the RunState type as defined in sysemu.h and itsrunstate_as_string() function are being dropped in favor of theRunState type generated by the QAPI.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Fix termination by signal with -no-shutdown
On signals such as SIGTERM qemu should exit instead of just stopping the VMeven with -no-shutdown.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Replace the VMSTOP macros with a proper state type
Today, when notifying a VM state change with vm_state_notify(),we pass a VMSTOP macro as the 'reason' argument. This is not idealbecause the VMSTOP macros tell why qemu stopped and not exactlywhat the current VM state is....
RunState: Add additional states
Currently, only vm_start() and vm_stop() change the VM state.That's, the state is only changed when starting or stopping the VM.
This commit adds the runstate_set() function, which makes it possibleto also do state transitions when the VM is stopped or running....
runstate_set(): Check for valid transitions
This commit could have been folded with the previous one, howeverdoing it separately will allow for easy bisect and revert if needed.
Checking and testing all valid transitions wasn't trivial, chancesare this will need broader testing to become more stable....
Drop the incoming_expected global variable
Test against RSTATE_IN_MIGRATE instead.
Please, note that the RSTATE_IN_MIGRATE state is only set when all theinitial VM setup is done, while 'incoming_expected' was set right inthe beginning when parsing command-line options. Shouldn't be a problem...
Drop the vm_running global variable
Use runstate_is_running() instead, which is introduced by this commit.
Monitor/QMP: Don't allow cont on bad VM state
We have two states where issuing cont before system_reset cancause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) andRSTATE_PANICKED (which only happens with kvm).
This commit fixes that by doing the following when state is...
QMP: query-status: Introduce 'status' key
This new key reports the current VM status to clients. Please, checkthe documentation being added in this commit for more details.
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Don't use g_thread_get_initialized.
Initialize glib threads unconditionally in main() insteadof using g_thread_get_initialized in the 9p code.
Fixes a build failure on RHEL-5, which ships glib 2.12.g_thread_get_initialized was added in 2.20.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
Fix comment (install patch -> install path)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
rename qemu_malloc and related to glib names for coherence
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Frediano Ziglio <freddy77@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
main: force enabling of I/O thread
Enabling the I/O thread by default seems like an important part of declaring1.0. Besides allowing true SMP support with KVM, the I/O thread means that theTCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which...
Merge remote-tracking branch 'stefanha/tracing' into staging
Add glib support to main loop
This allows GSources to be used to register callback events in QEMU. This isuseful as it allows us to take greater advantage of glib and also because itallows us to write code that is more easily testable outside of QEMU since we...
trace: add "-trace events" argument to control initial state
The "-trace events" argument can be used to provide a file with a list of traceevent names that will be enabled prior to starting execution, thus providingearly tracing.
This saves the user from manually toggling event states through the monitor...
trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*
Provides a more hierarchical view of the variable domain.
Also adds the CONFIG_TRACE_* variables for all backends.
[Stefan added missing 'test' in stap if statement]
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>...
trace: move backend-specific code into the trace/ directory
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
trace: avoid conditional code compilation during option parsing
A default implementation for backend-specific routines is provided in"trace/default.c", which backends can override by setting "trace_default=no" in"configure".
Do not drop global mutex for polled main loop runs
If we call select without a timeout, it's more efficient to keep theglobal mutex locked as we may otherwise just play ping pong with avcpu thread contending for it. This is particularly important for TCG...
Poll main loop after I/O events were received
Polling until select returns empty fdsets helps to reduce the switchesbetween iothread and vcpus. The benefit of this patch is best visiblewhen running an SMP guest on an SMP host in emulation mode.
char: rename qemu_chr_open() -> qemu_chr_new()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
char: qemu_chr_open_opts() -> qemu_chr_new_from_opts()
Add trace points for g_malloc/g_free functions
Derived from a patch submitted by Avi Kivity.
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Reorder default ram_size initialization
code_gen_alloc depends on it, and that is now called earlier viaconfigure_accelerator.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Avoid allocating TCG resources in non-TCG mode
Do not allocate TCG-only resources like the translation buffer whenrunning over KVM or XEN. Saves a "few" bytes in the qemu address spaceand is also conceptually cleaner.
Merge remote-tracking branch 'agraf/xen-next' into staging
Allow to leave type on default in -machine
This allows to specify -machine options without setting an explicitmachine type. We will pick the default machine in this case. Requestingthe list of available machines is still possible via '-machine ?' e.g....
showing a splash picture when start
Added options to let qemu transfer two configuration files to bios:"bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command -boot splash=P,splash-time=TP is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit...
vl.c: Check the asked ram_size later.
As a Xen guest can have more than 2GB of RAM on a 32bit host, we movethe conditions after than we now if we run one Xen or not.
[agraf] separate xen branch from ram_size check
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
notifier: Pass data argument to callback
This allows to pass additional information to the notifier callbackwhich is useful if sender and receiver do not share any other distinctdata structure.
Will be used first for the clock reset notifier.
vl.c: Don't limit node count by smp count
[I've sent this patch couple of months ago and noticed it didn't make it's way in - so I'm sending it again]
It is possible to create CPU-less NUMA nodes, node amount shouldn't belimited by amount of CPUs.
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
do not reset no_shutdown after we shutdown the vm
Daniel P. Berrange sent a libvirt's patch to supportreboots with the QEMU driver. He implements it injson model like this:1. add -no-shutdown in the qemu's option: qemu -no-shutdown xxxx2. shutdown the vm by monitor command system_powerdown...
Generalize -machine command line option
-machine somehow suggests that it selects the machine, but it doesn't.Fix that before this command is set in stone.
Actually, -machine should supersede -M and allow to introduce arbitraryper-machine options to the command line. That will change the internal...
pxa2xx_lcd: add proper rotation support
Until now, pxa2xx_lcd only supported 90deg rotation, butsome machines (for example Zipit Z2) needs 270deg rotation.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Allow silent system resets
This allows qemu_system_reset to be issued silently for internalpurposes, ie. without sending out a monitor event. Convert the systemreset after startup to the silent mode.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Introduce format string for pid_t
BeOS and Haiku on i386 use long for 32-bit types, including pid_t.Using %d with pid_t therefore results in a warning.
Unfortunately POSIX:2008 does not define a PRId* string for pid_t.
In some places pid_t was previously casted to long and %ld hardcoded....
Command line support for altering the log file location
Add command line support for logging to a location other than /tmp/qemu.log.
With logging enabled (command line option -d), the log is written tothe hard-coded path /tmp/qemu.log. This patch adds support for writing...
usb: don't call usb_host_device_open from vl.c
Not needed any more, usb-host is qdev-ified these days.Well, at least the linux version ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge remote-tracking branch 'spice/spice.v37' into staging
Conflicts: vl.c
isa-vga: Make available with -device, like the other VGA qdevs
Switch no_user off and make it suppress the default VGA.
Fix regression introduced by -machine accel=
Commit 85097db6 changed the timing when kvm_allowed is set until afterkvm is initialized. During initialization, the ioeventfd initialization codechecks kvm_enabled() and after this change, ioeventfd is effectively disabled....
qxl: add to the list of devices which disable the default vga
defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM
ide-hd has to suppress the default CD-ROM, or else you can't put oneon secondary master without -nodefaults.
Unlike legacy scsi-disk, scsi-cd suppresses default CD-ROM.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
vl.c: Introduce getter for shutdown_requested and reset_requested.
Introduce two functions qemu_shutdown_requested_get andqemu_reset_requested_get to get the value of shutdown/reset_requestedwithout reset it.
xen: Add initialisation of Xen
The xenpv machine use the common init function.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
Introduce -machine command option.
This option gives the ability to switch one "accelerator" like kvm, xenor the default one tcg. We can specify more than one accelerator byseparate them by a colon. QEMU will try each one and use the first whoseworks....
machine, Add default_machine_opts to QEMUMachine.
With this new field, we can specified which accelerator use to run themachine, if the accelerator is not already specified by either aconfiguration file or the command line options.
Currently, the only use will be made in the xenfv machine....
vl.c: Replace -virtfs string manipulation with QemuOpts
The -virtfs option creates an fsdev representing the pass-through filesystem and a guest-visible virtio-9p-pci device that can access thisfile system. This patch replaces the string manipulation used to build...
vl: trivial spelling fix
Signed-off-by: Brad Hards <bradh@frogmouth.net>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
exit if -drive specified is invalid instead of ignoring the "wrong" -drive
This fixes the problem when qemu continues even if -drive specificationis somehow invalid, resulting in a mess. Applicable for both currentmaster and for stable-0.14 (and the same issue exist 0.13 and 0.12 too)....
virtio: use generic name when possible
We have two different virtio buses: pci and s390. The abstraction pathtaken in qemu is to have generic aliases for each device type in thearchitecture specific qdev devices.
So let's make use of these aliases whenever we can and define them...