summaryrefslogtreecommitdiffstats
path: root/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* chardev: move greeting into vc backend.Gerd Hoffmann2009-12-121-24/+0
| | | | | | | | | | Make the 'vc' chardev backend print a title line with the chardev name after initialization, using CharDriverState->label. This replaces the banner printing code in vl.c. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Set default console to virtio on S390x"Gerd Hoffmann2009-12-121-26/+0
| | | | | | | This reverts commit 93d434b4aec0702b87ebf52449a3cdf2c3596825. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "monitor: Command-line flag to enable control mode"Gerd Hoffmann2009-12-121-7/+4
| | | | | | | | | | | This reverts commit adcb181afe5a951c521411c7a8e9d9b791aa6742. Conflicts: monitor.h Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* chardev: make chardevs specified in config file work.Gerd Hoffmann2009-12-121-3/+13
| | | | | | | | | The patch decuples the -chardev switch and the actual chardev initialization. Without this patch qemu ignores chardev entries coming via -readconfig. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: add command line option to set global defaults for properties.Gerd Hoffmann2009-12-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds infrastructure and command line option for setting global 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 file syntax is: [global] driver = "virtio-blk-pci" property = "vectors" value = "0" This can also be used to set properties for devices which are not created via -device but implicitly via machine init, i.e. -global isa-fdc,driveA=<name> This patch uses the mechanism which configures properties for the compatibility machine types (pc-0.10 & friends). The command line takes precedence over the machine type values. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: make compat stuff more genericGerd Hoffmann2009-12-121-1/+1
| | | | | | | | | This patch renames the compat properties into global properties and makes them more generic. The compatibility stuff is only one of multiple possible users now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Set default console to virtio on S390xAlexander Graf2009-12-051-0/+26
| | | | | | | | | | | | | | | 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. I'm not particularly proud of this patch. It would be a lot better to have something in the machine description that tells us about the default terminal. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* monitor: rename EVENT_* to QEVENT_* to avoid conflict on mingw32Blue Swirl2009-12-041-5/+5
| | | | | | Partially fixes mingw32 build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rename DriveInfo.onerror to on_write_errorKevin Wolf2009-12-031-0/+4
| | | | | | | | Either rename variables and functions to refer to write errors (which is what they 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 descriptorsKevin Wolf2009-12-031-4/+7
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-blk: Implement rerror optionKevin Wolf2009-12-031-1/+1
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: Implement rerror optionKevin Wolf2009-12-031-1/+1
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce rerror option for drivesKevin Wolf2009-12-031-19/+40
| | | | | | | | | | | | | rerror controls the action to be taken when an error occurs while accessing the guest image file. It corresponds to werror which already controls the action take for write errors. This purely introduces parsing rerror command line option into the right structures, real support for it in the device emulation is added in the following patches. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename DriveInfo.onerror to on_write_errorKevin Wolf2009-12-031-3/+8
| | | | | | | | Either rename variables and functions to refer to write errors (which is what they 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>
* ram migration: Properly reset statisticsJan Kiszka2009-12-031-1/+3
| | | | | | | | As we may do more than one migration (cancellation, live backup), reset bytes_transferred on stage 1. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* live migration: Propagate output monitor to callback handlerJan Kiszka2009-12-031-1/+1
| | | | | | | | | In order to allow proper progress reporting to the monitor that initiated the migration, forward the monitor reference through the migration layer down to SaveLiveStateHandler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* live migration: Allow cleanup after cancellation or errorJan Kiszka2009-12-031-0/+5
| | | | | | | | | | Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a live migration. This gives the involved subsystems a chance to clean up dynamically allocated resources. Namely, the block migration layer can now free its device descriptors and pending blocks. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ram migration: Stop loading on errorJan Kiszka2009-12-031-1/+5
| | | | | | | | Besides catching real errors, this also allows to interrrupt the qemu process during restore. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move slirp code from net.c to net/slirp.cMark McLoughlin2009-12-031-0/+1
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QMP: Introduce basic asynchronous eventsLuiz Capitulino2009-12-031-2/+9
| | | | | | | | Debug, shutdown, reset, powerdown and stop are all basic events, as they are very simple they can be added in the same commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Command-line flag to enable control modeLuiz Capitulino2009-12-031-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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). For example: $ qemu [...] -monitor control,tcp:localhost:4444,server Will run QEMU in control mode, waiting for a client TCP connection on localhost port 4444. NOTE: I've tried using QemuOpts for this, but turns out that it will try to parse the device part, which should be untouched. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18Aurelien Jarno2009-11-301-0/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add support for GNU/kFreeBSDAurelien Jarno2009-11-291-6/+3
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* [WIN32] Enable -k option on Windows tooHervé Poussineau2009-11-221-2/+0
| | | | | | | 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 migrationlirans@il.ibm.com2009-11-171-3/+6
| | | | | | | | | | | | | | | | | | | This patch introduces block migration called during live migration. Block are being copied to the destination in an async way. First the code will transfer the whole disk and then transfer all dirty blocks accumulted during the migration. Still need to improve transition from the iterative phase of migration to the end phase. For now transition will take place when all blocks transfered once, all the dirty blocks will be transfered during the end phase (guest is suspended). Changes from v4: - Global variabels moved to a global state structure allocated dynamically. - Minor coding style issues. - Poll block.c for tracking of dirty blocks instead of manage it here. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: Remove special init_reset handlingAmit Shah2009-11-171-1/+0
| | | | | | | | | | | | The initial_reset sent to chardevs doesn't do much other than setting a bool to true. Char devices are interested in the open event and that gets sent whenever the device is opened. Moreover, the reset logic breaks as and when qemu's bh scheduling changes. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu_system_reset: we need to call it before loadvm/migrationJuan Quintela2009-11-121-1/+1
| | | | | 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.Gerd Hoffmann2009-11-091-0/+30
| | | | | | | | | | | | | | | | | | Adds -readconfig and -writeconfig command line switches to read/write QemuOpts from config file. In theory you should be able to do: qemu < machine config cmd line switches here > -writeconfig vm.cfg qemu -readconfig vm.cfg In practice it will not work. Not all command line switches are converted to QemuOpts, so you'll have to keep the not-yet converted ones on the second line. Also there might be bugs lurking which prevent even the converted ones from working correctly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Configurable block format whitelistMarkus Armbruster2009-11-091-2/+2
| | | | | | | | | | | | | | | | | | | | We have code for a quite a few block formats. While I trust that all of these formats are useful at least for some people in some circumstances, some of them are of a kind that friends don't let friends use in production. This patch provides an optional block format whitelist, default off. If a whitelist is configured with --block-drv-whitelist, QEMU proper can use only whitelisted formats. Other programs, like qemu-img, are not affected. Drivers for formats off the whitelist still participate in format probing, to ensure all programs probe exactly the same. Without that, QEMU proper would be prone to treat images with a format off the whitelist as raw when the image's format is probed. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Added readonly flag to -drive commandNaphtali Sprei2009-11-091-0/+10
| | | | | | | | | | | | | | | | 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 passes the readonly attribute of the drive to the guest OS, applied first. This enables sharing same image between guests, with readonly access. Implementaion mark the drive as read_only and changes the flags when actually opening the file. The readonly attribute of a qcow also passed to it's base file. For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag. Also, return error code from bdrv_truncate for readonly drive. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* v3: don't call reset functions on cpu initializationGlauber Costa2009-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | There is absolutely no need to call reset functions when initializing devices. Since we are already registering them, calling qemu_system_reset() should suffice. Actually, it is what happens when we reboot the machine, and using the same process instead of a special case semantics will even allow us to find bugs easier. Furthermore, the fact that we initialize things like the cpu quite early, leads to the need to introduce synchronization stuff like qemu_system_cond. This patch removes it entirely. All we need to do is call qemu_system_reset() only when we're already sure the system is up and running I tested it with qemu (with and without io-thread) and qemu-kvm, and it seems to be doing okay - although qemu-kvm uses a slightly different patch. [ v2: user mode still needs cpu_reset, so put it in ifdef. ] [ v3: leave qemu_system_cond for now. ] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Fall back to network boot as the last possible boot option"Anthony Liguori2009-10-301-1/+1
| | | | This reverts commit 94ca5a985919cca312c505bbb0c824d175cc6bb8.
* Fall back to network boot as the last possible boot optionAnthony Liguori2009-10-301-1/+1
| | | | | | This is similiar to the default with most bare metal systems. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-storage: use qdev for -usbdeviceGerd Hoffmann2009-10-301-25/+0
| | | | | | | | | | Hook up usb_msd_init. Also rework handling of encrypted block devices, move the code out vl.c. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-serial and braille: use qdev for -usbdeviceGerd Hoffmann2009-10-301-6/+0
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-hid: use qdev for -usbdeviceGerd Hoffmann2009-10-301-29/+0
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb core: use qdev for -usbdeviceGerd Hoffmann2009-10-301-0/+5
| | | | | | | | | | | | | | This patchs adds infrastructure to handle -usbdevice via qdev callbacks. USBDeviceInfo gets a name field (for the -usbdevice driver name) and a callback for -usbdevice parameter parsing. The new usbdevice_create() function walks the qdev driver list and looks for a usb driver with a matching name. When a parameter parsing callback is present it is called, otherwise the device is created via usb_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: remove unused includes of if_tun.h and if_tap.hMark McLoughlin2009-10-271-6/+0
| | | | | | | Looks like these are just artifacts of vl.c being split up. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Split out bottom halvesKevin Wolf2009-10-271-104/+0
| | | | | | | | Instead of putting more and more stuff into vl.c, let's have the generic functions that deal with asynchronous callbacks in their own file. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Only IDE needs limits for CHS configurationBlue Swirl2009-10-171-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud