summaryrefslogtreecommitdiffstats
path: root/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* use eventfd for iothreadPaolo Bonzini2010-02-171-4/+5
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* iothread: fix vcpu stop with smp tcgMarcelo Tosatti2010-02-101-2/+3
| | | | | | | | Round robin vcpus in tcg_cpu_next even if the vm stopped. This allows all cpus to enter stopped state. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* loop write in qemu_event_increment upon EINTRPaolo Bonzini2010-02-101-2/+6
| | | | | | | Same as what qemu-kvm does. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* do not loop on an incomplete io_thread_fd readPaolo Bonzini2010-02-101-2/+2
| | | | | | | | No need to loop if less than a full buffer is read, the next read would return EAGAIN. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add qemu_get_clock_nsPaolo Bonzini2010-02-091-2/+19
| | | | | | | | | Some places use get_clock directly because they want to access the rt_clock with nanosecond precision. Add a function to do exactly that instead of using internal interfaces. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'qemu-kvm/uq/master' into staging-tmpAnthony Liguori2010-02-081-0/+4
|\
| * Fix incoming migration with iothreadMarcelo Tosatti2010-02-031-0/+2
| | | | | | | | | | | | | | | | 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 periodlySheng Yang2010-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. 2. The writing interval is big. 3. No need for input or accessing other devices frequently. This issue was observed in a experimental embbed system. The test image simply print "test" every 1 seconds. The output in QEmu meets expectation, but the output in KVM is delayed for seconds. Per Avi's suggestion, I hooked flushing coalesced MMIO buffer in VGA update handler. By this way, We don't need vcpu explicit exit to QEmu to handle this issue. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | vl.c: avoid preprocessor directives in a printf callPaolo Bonzini2010-02-081-8/+10
| | | | | | | | | | | | | | | | Similar to the qemu-img.c patch, but I also have to unescape remaining % signs in qemu-options.hx. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* | do not interpolate % from vl.c to qemu-options.hPaolo Bonzini2010-02-081-8/+1
| | | | | | | | | | | | | | | | Since qemu-options.h is only used in vl.c, we can avoid using brittle interpolation from a generated file. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* | Revert "On some systems printf is a macro"malc2010-02-081-18/+18
| | | | | | | | This reverts commit bc5b6004588ad17370e0416e40b4aa9cf977023b.
* | On some systems printf is a macromalc2010-02-071-18/+18
| | | | | | | | Signed-off-by: malc <av1474@comtv.ru>
* | fix undefined shifts by >32Paolo Bonzini2010-02-051-2/+2
|/ | | | | | | This one is for 0.12 too. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: Fix exit code for -device ?Markus Armbruster2010-02-031-0/+8
| | | | | | | | | | | | Help was shoehorned into device creation, qdev_device_add(). Since help doesn't create a device, it returns NULL, which looks to callers just like failed device creation. Monitor handler do_device_add() doesn't care, but main() exits unsuccessfully. Move help out of device creation, into new qdev_device_help(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix regression in option parsingAnthony Liguori2010-01-271-0/+1
| | | | | | | | 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 driverAdam Litke2010-01-261-7/+14
| | | | | | | | | | | | | | | | When using ballooning to manage overcommitted memory on a host, a system for guests to communicate their memory usage to the host can provide information that will minimize the impact of ballooning on the guests. The current method employs a daemon running in each guest that communicates memory statistics to a host daemon at a specified time interval. The host daemon aggregates this information and inflates and/or deflates balloons according to the level of host memory pressure. This approach is effective but overly complex since a daemon must be installed inside each guest and coordinated to communicate with the host. A simpler approach is to collect memory statistics in the virtio balloon driver and communicate them directly to the hypervisor. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-console: Automatically use virtio-serial-bus for the older ↵Amit Shah2010-01-261-2/+13
| | | | | | | | | | | | | -virtioconsole invocation These hunks got dropped off mysteriously during the rebasing of my virtio-serial series. Thanks go to Markus for noticing it. Without these fixes, -virtioconsole doesn't actually have any effect. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vl.c: fix warning with _FORTIFY_SOURCEKirill A. Shutemov2010-01-261-4/+18
| | | | | | | | | | | | | | | | CC i386-softmmu/vl.o cc1: 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 /usr/src/RPM/BUILD/qemu-0.11.92/vl.c: In function 'main': /usr/src/RPM/BUILD/qemu-0.11.92/vl.c:5774: error: ignoring return value of 'write', declared with attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6064: error: ignoring return value of 'chdir', declared with attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6083: error: ignoring return value of 'chdir', declared with attribute warn_unused_result make[1]: *** [vl.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Load global config files by defaultAnthony Liguori2010-01-241-0/+39
| | | | | | | | | | | A new option, -nodefconfig is introduced to prevent loading from the default config 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 config, we introduce a two stage option parsing mechanism. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Move out option lookup into a separate functionAnthony Liguori2010-01-241-29/+43
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-console: qdev conversion, new virtio-serial-busAmit Shah2010-01-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit converts the virtio-console device to create a new virtio-serial bus that can host console and generic serial ports. The file hosting this code is now called virtio-serial-bus.c. The virtio console is now a very simple qdev device that sits on the virtio-serial-bus and communicates between the bus and qemu's chardevs. This commit also includes a few changes to the virtio backing code for pci and s390 to spawn the virtio-serial bus. As a result of the qdev conversion, we get rid of a lot of legacy code. The old-style way of instantiating a virtio console using -virtioconsole ... is maintained, but the new, preferred way is to use -device virtio-serial -device virtconsole,chardev=... With this commit, multiple devices as well as multiple ports with a single device can be supported. For multiple ports support, each port gets an IO vq pair. Since the guest needs to know in advance how many vqs a particular device will need, we have to set this number as a property of the virtio-serial device and also as a config option. In addition, we also spawn a pair of control IO vqs. This is an internal channel meant for guest-host communication for things like port open/close, sending port properties over to the guest, etc. This commit is a part of a series of other commits to get the full implementation of multiport support. Future commits will add other support as well as ride on the savevm version that we bump up here. Signed-off-by: Amit Shah <amit.shah@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 ↵Naphtali Sprei2010-01-201-4/+4
| | | | | | | | | | 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, pass the request in the flags parameter to the function. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make CDROM a read-only driveNaphtali Sprei2010-01-201-0/+7
| | | | | Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vl.c: Remove dead assignmentAmit Shah2010-01-131-5/+1
| | | | | | | | 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.cPaolo Bonzini2010-01-131-212/+2
| | | | | | | | Move 200 lines out of vl.c already into common code that only needs to be compiled once. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix CPU topology initializationJiri Denemark2010-01-111-4/+4
| | | | | | | | Late initialization of CPU topology in CPUState prevents KVM guests to actually 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)H. Peter Anvin2010-01-081-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add generic support for debugging consoles (simple I/O ports which when written to cause debugging output to be written to a target.) The current implementation matches Bochs' port 0xe9, allowing the same debugging code to be used for both Bochs and Qemu. There is no vm state associated with the debugging port, simply because it has none -- the entire interface is a single, stateless, write-only port. Most of the code was cribbed from the serial port driver. v2: removed non-ISA variants (they can be introduced when/if someone wants them, using code from the serial port); added configurable readback (Bochs returns 0xe9 on a read from this register, mimic that by default) This retains the apparently somewhat controversial user friendly option, however. v3: reimplemented the user friendly option as a synthetic option ("-debugcon foo" basically ends up being a parser-level shorthand for "-chardev stdio,id=debugcon -device isa-debugcon,chardev=debugcon") -- this dramatically reduced the complexity while keeping the same level of user friendliness. v4: spaces, not tabs. v5: update to match current top of tree. Calling qemu_chr_open() already during parsing no longer works; defer until we are parsing the other console-like devices. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* USB: Improve usbdevice error messagesScott Tsai2009-12-231-3/+14
| | | | | | | | | 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 WIN32Juha Riihimäki2009-12-181-1/+3
| | | | | | | | | | | | | | Explicit read/write locking pidfile under WIN32 is bit extreme nobody get the chance to read the pidfile. Convert to a write-only lock. Also, creating pidfile was disabled along with daemonize under WIN32. Enable it, but do not enable daemon support which doesn't exist under WIN32 atm. From: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* fix vga names in default_listGerd Hoffmann2009-12-181-2/+2
| | | | | | | | 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>
* usb-net: use qdev for -usbdeviceGerd Hoffmann2009-12-181-18/+0
| | | | | | | | 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>
* Check rom_load_all() return value.Gerd Hoffmann2009-12-181-1/+4
| | | | | | | | Check rom_load_all() return value. Also don't make option rom loading failure fatal. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* defaults: update device_list[]Gerd Hoffmann2009-12-181-0/+3
| | | | | | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* defaults: split default_driveGerd Hoffmann2009-12-181-3/+20
| | | | | | | | Split default_drive into default_{floppy,cdrom,sdcard}. Also add QEMUMachine flags to disable them per machine. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Rename DriveInfo.onerror to on_write_error" (fix mismerge)Kevin Wolf2009-12-181-4/+0
| | | | | | | | | | | | Part of the first patch of the -drive rerror series has been merged once more on top of the rest of the series. This effectively disables the rerror option and always goes with the default value. Reverting the commit re-enables the option. This reverts commit fc072ec4df0996682dfbff6c735e2bbc0d93132f. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add default virtcon initializationAlexander Graf2009-12-181-0/+2
| | | | | | | | | | | When going through the default devices, we don't initialize the virtio console, unless we're doing -nographic. I suppose that's just a leftover from the recent code restructuring, so let's put it in. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* monitor: Convert do_info_mice() to QObjectLuiz Capitulino2009-12-121-7/+55
| | | | | | | | | | Each mouse is represented by a QDict, the returned QObject is a QList of all 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>
* Set default console to virtio on S390xGerd Hoffmann2009-12-121-1/+18
| | | | | | | | | | | | | | | All "normal" system emulation targets in qemu I'm aware of display output on either VGA or serial output. Our S390x virtio machine doesn't have such kind of legacy hardware. So instead we need to default to a virtio console. Add flags to QEMUMachine to indicate which kind of default devices make sense for the machine in question. Use it for S390x: enable virtcon, disable serial, parallel and vga. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: virtio consoles.Gerd Hoffmann2009-12-121-30/+35
| | | | | | | | | | | This patch adds a variable default_virtcon which says whenever a default virtio console should be added. It is disabled by default, followup patch will enable it for s390. It is cleared when qemu finds '-virtiocon', '-device virtio-console-s390' or '-device virtio-console-pci' on the command line. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add -qmp convinience switchGerd Hoffmann2009-12-121-5/+9
| | | | | | | Acts like -monitor but switched into qmp mode. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add new -mon switchGerd Hoffmann2009-12-121-0/+8
| | | | | | | | | | | | | | | | | Add -mon switch which maps pretty straight forward into the QemuOpts internal representation: -mon chardev=<name>[,mode=[control|readline]][,[no]default] Via config file: [mon] chardev = "<name>" mode = "readline" default = "on" Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rework -monitor handling, switch to QemuOptsGerd Hoffmann2009-12-121-43/+76
| | | | | | | | | | | | | 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 "mon" QemuOpts list. - It winds up everything and removes the old bits. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: drivesGerd Hoffmann2009-12-121-6/+10
| | | | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: networkGerd Hoffmann2009-12-121-0/+1
| | | | | | | | | Add a default_net variable which specified whenever a default network should be created. It is cleared in case any -net option is specified and it is also added to the new -nodefaults switch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: add global cmd line option.Gerd Hoffmann2009-12-121-0/+6
| | | | | | | Add global command line option to disable default devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: vga adapter.Gerd Hoffmann2009-12-121-1/+8
| | | | | | | | | | | | | | | | | | Qemu creates a vga display for you in case you didn't specify one on the command line. Right now this is tied to the '-vga <type>' command line switch, which in turn causes trouble if you are creating your gfx card using '-device VGA,<props>'. This patch adds a variable default_vga which says whenever a default serial line should be added. It is enabled by default. It is cleared when qemu finds '-vga' or '-device {VGA,Cirrus VGA,QEMUware SVGA}' on the command line. '-device VGA' still doesn't work though due to a initialization order issue (vga must init before calling i440fx_init_memory_mappings). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* zap serial_monitor_muxGerd Hoffmann2009-12-121-34/+8
| | | | | | | | | | | | | | | The logic in this code obviously predates the multiple monitor capability of qemu and looks increasingly silly these days. I think the intention of this piece of code is to get a reasonable default for the -nographic case: have monitor and serial line muxed on stdio. With the new default_serial and default_monitor variables we have now doing just that became much easier ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: qemu monitor.Gerd Hoffmann2009-12-121-44/+50
| | | | | | | | | | | This patch makes the monitor default device configuration work like the default serial and parallel port devices. It adds a variable default_monitor which says whenever a default monitor should be added. It is enabled by default. It is cleared when qemu finds '-monitor' on the command line. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: parallel port.Gerd Hoffmann2009-12-121-30/+34
| | | | | | | | | | | | | | Qemu creates a default parallel port for you in case you didn't specify one on the command line. Right now this is tied to the '-parallel <chardev>' command line switch, which in turn causes trouble if you are creating your parallel port via '-device isa-parallel,<props>'. This patch adds a variable default_parallel which says whenever a default parallel port should be added. It is enabled by default. It is cleared when qemu finds '-parallel' or '-device isa-parallel' on the command line. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* default devices: core code & serial lines.Gerd Hoffmann2009-12-121-41/+81
| | | | | | | | | | | | | | | | | | Qemu creates a default serial line for you in case you didn't specify one on the command line. Right now this is tied to the '-serial <chardev>' command line switch, which in turn causes trouble if you are creating your serial line via '-device isa-serial,<props>'. This patch adds a variable default_serial which says whenever a default serial line should be added. It is enabled by default. It is cleared when qemu finds '-serial' or '-device isa-serial' on the command line. Part of the patch is some infrastructure for the '-device $driver' checking (default_driver_check function) which will also be used by the other patches of this series. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud