History | View | Annotate | Download (102.8 kB)
Merge remote-tracking branch 'origin/master' into staging
vga: disable default VGA if appropriate -device is used
This is a partial revert of commits a369da5 (vga: improve VGA logic,committed 2012-01-22) and c5bd4f3 (vga: fix -nodefaults -device VGA,2012-01-24) which broke command-line option parsing in different ways....
implement -no-user-config command-line option (v3)
Changes v2 -> v3: - Rebase against latest qemu.git
Changes v1 -> v2: - Change 'userconfig' field/variables to bool instead of int - Coding style change
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
use inet_listen()/inet_connect() to support ipv6 migration
Use help functions in qemu-socket.c for tcp migration,which already support ipv6 addresses.
Currently errp will be set to UNDEFINED_ERROR when migration fails,qemu would output "migration failed: ...", and current user can...
vl.c: change 'defconfig' variable to bool (v2)
Changes v1 -> v2: - Actually change the variable type declaration to 'bool'
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
move code to read default config files to a separate function (v2)
Function added to arch_init.c because it depends on arch-specificsettings.
Changes v1 -> v2: - Move qemu_read_default_config_file() prototype to qemu-config.h
vl: drop is_suspended variable
Check for the RUN_STATE_SUSPENDED state instead.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
runstate: introduce suspended state
QEMU enters in this state when the guest suspends to ram (S3).
This is important so that HMP users and QMP clients can know thatthe guest is suspended. QMP also has an event for this, but eventsare not reliable and are limited (ie. a client can connect to QEMU...
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
qtest: add test framework
The idea behind qtest is pretty simple. Instead of executing a CPU via TCG orKVM, rely on an external process to send events to the device model that the CPUwould normally generate.
qtest presents itself as an accelerator. In addition, a new option is added to...
rtc: add -rtc clock=rt
This will let people use backwards-compatible semantics for devices thatwill be affected by the following patches.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
vl.c: fix '-cpu ?' segfault
Fix stupid copy&paste mistake at commitecf40beae7dcbb057d4f115207f9d8276832a774: I moved code around but kept"optarg" on the cpu_list() call.
Reported-by: Jiri Denemark <jdenemar@redhat.com>Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
Merge remote-tracking branch 'sstabellini/saverestore-8' into staging
Set runstate to INMIGRATE earlier
Set runstate to RUN_STATE_INMIGRATE as soon as we can on resume.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
spice: fix broken initialization
Commit 1b71f7c14fab6f00c2680d4489fbee7baf796e4f moved MODULE_INIT_QOM toway before MODULE_INIT_MACHINE, thereby breaking assumptions made inspice-core.c which registered both a type initializer and a machineintializer....
qom: Register QOM infrastructure early
The constructors for QOM TYPE_INTERFACE were executed rather late invl.c's main(). Call them very early so that QOM can safely be used formachines and CPUs.
Signed-off-by: Andreas Färber <afaerber@suse.de>Cc: Anthony Liguori <anthony@codemonkey.ws>...
initialize CPU model list after handling -readconfig options
To properly load cpudefs using -readconfig, we have to callcpudef_init() after finishing the command-line option handling.
Consequently, the handling of "-cpu ?" has to be done after thecommand-line option handling loop, too....
arm: add device tree support
If compiled with CONFIG_FDT, allow user to specify a device tree file usingthe -dtb argument. If the machine supports it then the dtb will be loadedinto memory and passed to the kernel on boot.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>...
usb: Resolve warnings about unassigned bus on usb device creation
When creating an USB device the old way, there is no way to specify thetarget bus. Thus the warning issued by usb_create makes no sense andrather confuses our users.
Resolve this by passing a bus reference to the usbdevice_init handler...
vl.c: Avoid segfault when started with no arguments
Fix a bug (introduced in commit a0abe47) where a command line whichspecified no machine arguments (either explicitly or implicitly via-kernel &co) would result in a segfault because of a NULL pointerreturned from qemu_opts_find(qemu_find_opts("machine"), 0)....
suspend: add qmp events
Send qmp events on suspend and wakeup so libvirthas a chance to track the vm state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
suspend: add infrastructure
This patch adds some infrastructure to handle suspend and resume toqemu. First there are two functions to switch state and second thereis a suspend notifier:
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
vl.c: Error locations for options using add_device_config()
These are -bt, -serial, -virtcon, -parallel, -debugcon, -usbdevice.Improves messages emitted via proper error reporting interfaces. Forinstance:
$ qemu-system-x86_64 -nodefaults -S -usb -usbdevice net:vlan=xxx...
gdbstub: Error locations for -gdb
Stash away the option argument with add_device_config(), so we stillhave its location when we get around to parsing it.
This doesn't improve any messages I can see just yet, but that'llchange shortly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
vl.c: Increase width of machine name column in "-M ?" output
Increase the width of the column used for the machine name inthe "-M ?" output from 10 to 20 spaces. This fixes the formattingso it looks nice for architectures where a few of the machineshave overly long names. (Our current longest machine name is...
Make kernel, initrd and append be machine_opts
Make kernel, initrd, append be machine opts (ie -machine kernel=foo)with the old plain command line arguments as legacy/convenienceequivalents.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl: make find_default_machine externally visible
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
notifier: switch to QLIST
Notifiers do not need to access both ends of the list, and usinga QLIST also simplifies the API.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Make -machine/-enable-kvm options merge into a single list
Make the "machine" option list use list merging, so that multiple-machine arguments (and the -enable-kvm argument) all merge togetherinto a single list. Drop the calls to qemu_opts_reset() which meant...
Merge remote-tracking branch 'kwolf/for-anthony' into staging
qom: Unify type registration
Replace device_init() with generalized type_init().
While at it, unify naming convention: type_init([$prefix_]register_types)Also, type_init() is a function, so add preceding blank line wherenecessary and don't put a semicolon after the closing brace....
vl.c: Fix typo in variable name
Fix a typo in a local variable name.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
iSCSI: add configuration variables for iSCSI
This patch adds configuration variables for iSCSI to setinitiator-name to use when logging in to the target,which type of header-digest to negotiate with the targetand username and password for CHAP authentication....
s390x: fix qom-ification fall-out
Tested-by: Andreas Faerber <afaerber@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
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.
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: 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".
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>