History | View | Annotate | Download (151.8 kB)
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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-serial and braille: use qdev for -usbdevice
usb-storage: use qdev for -usbdevice
Hook up usb_msd_init.
Also rework handling of encrypted block devices,move the code out vl.c.
usb core: use qdev for -usbdevice
This patchs adds infrastructure to handle -usbdevice via qdev callbacks.USBDeviceInfo gets a name field (for the -usbdevice driver name) and acallback for -usbdevice parameter parsing.
The new usbdevice_create() function walks the qdev driver list and looks...
usb-hid: use qdev for -usbdevice
Split out bottom halves
Instead of putting more and more stuff into vl.c, let's have the genericfunctions that deal with asynchronous callbacks in their own file.
net: remove unused includes of if_tun.h and if_tap.h
Looks like these are just artifacts of vl.c being split up.
Only IDE needs limits for CHS configuration
net: add QemuOptsList arg to net_client_parse()
Patchworks-ID: 35505Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: add -netdev option
Patchworks-ID: 35506Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: handle -netdevice options
Same as for -net except for:
- only tap, user, vde and socket types are supported- the vlan parameter is not allowed- the name parameter is not allowed but the id parameter isrequired
Patchworks-ID: 35517Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
unlock iothread mutex before running kvm ioctl
Without this, kvm will hold the mutex while it issues its run ioctl,and never be able to step out of it, causing a deadlock.
Patchworks-ID: 35359Signed-off-by: Glauber Costa <glommer@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Port usb net to QemuOpts
We need net_client_init_from_opts() exported for this
Final net cleanup after conversion to QemuOpts
Now that net_client_init() has no users, kill it off and renamenet_client_init_from_opts().
There is no further need for the old code in net_client_parse() either.We use qemu_opts_parse() 'firstname' facitity for that. Instead, move...
Remove double error message for -device option parsing
qemu_opts_parse() gives a suitable error message in all failure casesso we can remove the error message from the caller.
Don't assign a static string to NICInfo::model
Don't exit() in config_error()
Propagating errors up the call chain is tedious. In startup code, wecan take a shortcut: terminate the program. This is wrong elsewhere,the monitor in particular.
config_error() tries to cater for both customers: it terminates the...
offer right-ctrl as a grab option
Add support for -ctrl-grab to use the right-ctrl button to grab/releasethe mouse in SDL.
The multi-button ctrl-alt and ctrl-alt-shift grab buttons present anaccessibility problem to users who cannot press more than one button...
Reorganize option rom (+linux kernel) loading.
This patch adds infrastructure to maintain memory regions which must berestored on reset. That includes roms (vga bios and option roms on pc),but is also used when loading linux kernels directly. Features:...
Improve error reporting on file access
By making the error reporting include strerror(errno), it gives the usera bit more indication as to why qemu failed. This is particularlyimportant for people running qemu as a non root user.
Signed-off-by: Justin M. Forbes <jforbes@redhat.com>...
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
qdev hotplug: infrastructure and monitor commands.
Adds device_add and device_del commands. device_add accepts acceptsthe same syntax like the -device command line switch. device_delexpects a device id. So you should tag your devices with ids if you...
win32: Drop dead dyntick timer code
nearest_delta_us is calculated but not used. Drop it.
Introduce QEMU_CLOCK_HOST
Despite its name QEMU_CLOCK_REALTIME is (normally) not usingCLOCK_REALTIME / the host system time as base. In order to allow alsonon-trivial RTC emulations (MC146818) to follow the host time instead ofthe virtual guest time, introduce the new clock type QEMU_CLOCK_HOST. It...
Refactor RTC command line switches
Deprecate -localtime, -setdate and -rtc-td-hack in favor of a newunified command line switch:
-rtc [base=utc|localtime|date][,driftfix=none|slew]
Enable host-clock-based RTC
Switch RTC emulations to the new host_clock instead of vm_clock bydefault. This has the advantage that the emulated RTC will followautomatically the host time while it might be tuned via NTP. vm_clockcan still be selected by passing '-rtc clock=vm' on the command line....
do proper cpu_self check
Currently, our check for qemu_cpu_self only checks if there is a cpucurrently in execution (represented by cpu_single_env being set). Whilethis might be okay for tcg, it is certainly not okay for kvm, since multiplecpus might be executing....
Rename QEMU_TIMER_* to QEMU_CLOCK_*
These constants select clocks, not timers. And init_timers initializesclocks.
Fix warning about undefined madvise() on OpenSolaris
OpenSolaris headers can't export madvise() with a sane set of #defines.For background, see MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156)for discussion about Solaris header problems.
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Win32: avoid a warning
GetLastError() returns a DWORD.
vl: Add failure check for SetEvent
vl: Do not use perror after failed Win32 API calls
fix -daemonize with kvm
Otherwise fork might not inherit state initialized by kvm_init().
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix coding style issue
Replace:
if (-1 foo())
with:
if (foo() -1)
While this coding style is not in direct contravention of our currentlyratified CODING_STYLE treaty, it could be argued that the Article 3 ofthe European Convention on Human Rights (prohibiting torture and "inhuman...
support media=cdrom for if=none
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Revert "Open chr device for all serial ports"
This reverts commit 55338f1dd4648d78ee130d83a92f1059ff1f3887.
Open chr device for all serial ports
Now that labels must be unique, the chr devices can't be opened anymorewithin the serial port code (in case they are not already opened invl.c), as they end up with the same label. Instead opened sonon-assigned one directly in vl.c, with a different label....
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
Make get_ticks_per_sec() a static inline
ticks_per_sec is a constant. There's no need to store it as a variable as itnever changes since our time is based on units.
Convert get_ticks_per_sec() to a static inline and move the constant intoqemu-timer.h. Remove all references to QEMU_TIMER_BASE so that we consistently...