summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* PCI: Convert pci_device_hot_add() to QObjectLuiz Capitulino2009-12-121-1/+2
| | | | | | | | | | | | | | Return a QDict with information about the just added device. This commit should not change user output. Please, note that this patch does not do error handling conversion. In error conditions the handler still calls monitor_printf(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949)
* Introduce rerror option for drivesKevin Wolf2009-12-031-0/+1
| | | | | | | | | | | | | 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-2/+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>
* live migration: Propagate output monitor to callback handlerJan Kiszka2009-12-031-5/+5
| | | | | | | | | 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/+1
| | | | | | | | | | 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>
* monitor: QError supportLuiz Capitulino2009-12-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds QError support in the Monitor. A QError member is added to the Monitor struct. This new member stores error information and is also used to check if an error has occurred when the called handler returns. Additionally, a new macro called qemu_error_new() is introduced. It builds on top of the QemuErrorSink API and should be used in place of qemu_error(). When all conversion to qemu_error_new() is done, qemu_error() can be turned private. Basically, Monitor's error flow is something like this: 1. An error occurs in the handler, it calls qemu_error_new() 2. qemu_error_new() builds a new QError object and stores it in the Monitor struct 3. The handler returns 4. Top level Monitor code checks the Monitor struct and calls qerror_print() to print the error Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Block live migrationlirans@il.ibm.com2009-11-171-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* net: move more stuff into net/tap-win32.c, add net/tap.hMark McLoughlin2009-10-301-4/+0
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Convert do_pci_device_hot_remove() to QObjectLuiz Capitulino2009-10-271-1/+2
| | | | | | | | Errors are still directly printed, as we are only converting regular output. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kill dead nic unplug code.Gerd Hoffmann2009-10-271-4/+0
| | | | | | | Cleanup on unplug happens via qdev->exit() callback now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* offer right-ctrl as a grab optionDustin Kirkland2009-10-061-0/+1
| | | | | | | | | | | | | | Add support for -ctrl-grab to use the right-ctrl button to grab/release the mouse in SDL. The multi-button ctrl-alt and ctrl-alt-shift grab buttons present an accessibility problem to users who cannot press more than one button at a time. https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/237635 Signed-off-by: Dustin Kirkland <kirkland@canonical.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* drive cleanup fixes.Gerd Hoffmann2009-10-051-2/+1
| | | | | | | | | | | | | | | | 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 only user (destroy_bdrvs) is gone. * usb-storage needs no drive_uninit, scsi-disk will handle that. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: windup acpi-based hotplugGerd Hoffmann2009-10-051-6/+1
| | | | | | | | Switch over acpi-based PCI hotplug for pc over to the new qdev-based pci hotplugging. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Enable host-clock-based RTCJan Kiszka2009-10-051-0/+2
| | | | | | | | | | | | | | | Switch RTC emulations to the new host_clock instead of vm_clock by default. This has the advantage that the emulated RTC will follow automatically the host time while it might be tuned via NTP. vm_clock can still be selected by passing '-rtc clock=vm' on the command line. Note that some RTC emulations (at least M48T59) already use the host time unconditionally while others (namely MC146818) do not. This patch introduces the required infrastructure for selecting the base clock but only converts MC146818 for now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Compile loader only onceBlue Swirl2009-09-201-18/+0
| | | | | | | | | | | | | Callers must pass ELF machine, byte swapping and symbol LSB clearing information to ELF loader. A.out loader needs page size information, pass that too as a parameter. Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw. Adjust callers. Also use target_phys_addr_t instead of target_ulong for addresses: loader addresses aren't virtual. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* x86: move a declaration to headerBlue Swirl2009-09-131-0/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix sys-queue.h conflict for goodBlue Swirl2009-09-121-4/+4
| | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* monitor: Port handler_3 to use QDictLuiz Capitulino2009-09-041-2/+1
| | | | | | | | This commit ports command handlers that receive three arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Port handler_2 to use QDictLuiz Capitulino2009-09-041-1/+1
| | | | | | | | This commit ports command handlers that receive two arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Port handler_1 to use QDictLuiz Capitulino2009-09-041-5/+6
| | | | | | | | This commit ports command handlers that receive one argument to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add wrappers to functions used by the MonitorLuiz Capitulino2009-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | Some functions exported to be used by the Monitor as command handlers are also called in other places as regular functions. When those functions got ported to use the Monitor dictionary to pass argments, the callers will have to setup a dictionary to be able to call them. To avoid this problem, this commit add wrappers to those functions, so that we change the wrapper to accept the dictionary, letting the current functions as is. The following wrappers are being added: - do_help_cmd() - do_pci_device_hot_remove() Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* switch balloon initialization to -device.Gerd Hoffmann2009-08-271-2/+0
| | | | | | | | | | | | | | With that patch applied "-balloon virtio,args" becomes a shortcut for "-device virtio-balloon-pci,args". Side effects: - ballon device gains support for id=<tag>. - ballon device is off by default now. - initialization order changes, which may in different pci slot assignment depending on the VM configuration. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add qemu_error() + friendsGerd Hoffmann2009-08-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds some functions for error reporting to address the problem that error messages should be routed to different destinations depending on the context of the caller, i.e. monitor command errors should go to the monitor, command line errors to stderr. qemu_error() is a printf-like function to report errors. qemu_errors_to_file() and qemu_errors_to_mon() switch the destination for the error message to the specified file or monitor. When setting a new destination the old one will be kept. One can switch back using qemu_errors_to_previous(). i.e. it works like a stack. main() calls qemu_errors_to_file(stderr), so errors go to stderr by default. monitor callbacks are wrapped into qemu_errors_to_mon() + qemu_errors_to_previous(), so any errors triggered by monitor commands will go to the monitor. Each thread has its own error message destination. qemu-kvm probably should add a qemu_errors_to_file(stderr) call to the i/o-thread initialization code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* make load_vmstate() return errorsJuan Quintela2009-08-271-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* move do_loadvm() to monitor.cJuan Quintela2009-08-271-1/+0
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* split do_loadvm() into do_loadvm() and load_vmstate()Juan Quintela2009-08-271-0/+1
| | | | | | | | | do_loadvm() is now called from the monitor. load_vmstate() is called by do_loadvm() and when -loadvm command line is used. Command line don't have to play games with vmstop()/vmstart() Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Unbreak large mem support by removing kqemuAnthony Liguori2009-08-241-4/+0
| | | | | | | | | | | | | | | | | | | | | | kqemu introduces a number of restrictions on the i386 target. The worst is that it prevents large memory from working in the default build. Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on the TSC as a time source which will not be reliable on a multiple processor system in userspace. Since most modern processors are multicore, this severely limits the utility of kqemu. kvm is a viable alternative for people looking to accelerate qemu and has the benefit of being supported by the upstream Linux kernel. If someone can implement work arounds to remove the restrictions introduced by kqemu, I'm happy to avoid and/or revert this patch. N.B. kqemu will still function in the 0.11 series but this patch removes it from the 0.12 series. Paul, please Ack or Nack this patch. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QEMU set irq0override in fw_cfgJes Sorensen2009-08-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Hi, After discussing the issue with Avi, Gleb and a couple others on irq, we came to the conclusion that it is preferred to have QEMU request features from the BIOS, rather than notifying the BIOS that it is running on QEMU or KVM. This way memory ranges can change etc. and an older BIOS will continue to work on newer QEMU if it receives the info as a fw_cfg value. This one also matches what qemu-kvm does for irq0override, except I haven't made it configurable. I leave that as an exercise for whoever would be interested in switching off irq0override. Thanks, Jes Set irq0 override in fw_cfg, informing the BIOS that QEMU expects override on irq0. This matches qemu-kvm, and will help sharing a single BIOS binary. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Clean up VGA type selection; far too many variables being used to track one ↵Zachary Amsden2009-08-241-4/+11
| | | | | | | state leads to confusion if new variables are added. Signed-off-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add -drive if=noneGerd Hoffmann2009-08-101-0/+1
| | | | | | | | | | This adds a host drive, but doesn't implicitly add a guest drive for it. First step in splitting host and guest configuration, check the following patches to see how this can be used ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
* constify drive_get_by_id argGerd Hoffmann2009-08-101-1/+1
| | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
* Use qemu_irq for system_powerdownBlue Swirl2009-08-091-8/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* fix migration to obey -SPaolo Bonzini2009-07-301-0/+1
| | | | | | | | | | | | Since migration returns right away, starting the VM right after calling qemu_start_incoming_migration is wrong even if -S is not passed. We have to do this after migration has completed. Cc: Glauber Costa <glommer@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce -smp , maxcpus= flag to specify maximum number of CPUS.Jes Sorensen2009-07-271-0/+1
| | | | | | | | Follow on patch will use it to determine the size of the MADT and other BIOS tables. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* switch -drive to QemuOpts.Gerd Hoffmann2009-07-271-11/+3
| | | | | | | | | | | Demo QemuOpts in action ;) Implementing a alternative way to specify the filename should be just a few lines of code now once we decided how the cmd line syntax should look like. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* move parser functions from vl.c to qemu-option.cGerd Hoffmann2009-07-271-7/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kill drives_optGerd Hoffmann2009-07-271-13/+11
| | | | | | | | | cleanup pretty simliar to the drives_table removal patch: - drop the table and make a linked list out of it. - pass around struct pointers instead of table indices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add support for drive ids.Gerd Hoffmann2009-07-271-0/+2
| | | | | | | | | | | | | -drive accepts the new id= now, allowing to explicitely name your drives. They will show up with that name in "info block" if specified, otherwise the existing namimg scheme is used to autogenerate one. There is also a new function to lookup drives by name. Not used yet. The plan is to link disk drivers and drives using the drive id instead of passing around pointers to BlockDriveState. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kill drives_tableGerd Hoffmann2009-07-271-6/+7
| | | | | | | | | | | | | | First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add boot menu control via command line switchJan Kiszka2009-07-161-0/+1
| | | | | | | | Disable the lengthy BIOS prompt for selecting a boot device by default, but let the user reenable it via '-boot menu=on'. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Replace -no-virtio-balloon by -balloonMarkus Armbruster2009-06-291-1/+2
| | | | | | | | | | | | | | | | We want to do (at least) two things to the virtio-balloon device: suppress it, and control its PCI address. Option -no-virtio-balloon lets us do only the former. To get the latter, replace -no-virtio-balloon with -balloon none disable balloon device -balloon virtio[,addr=str] enable virtio balloon device (default) Syntax suggested by Anthony Liguori. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce get_next_param_valueJan Kiszka2009-06-291-0/+2
| | | | | | | | | In order to parse multiple instances of the same param=value pair, introduce get_next_param_value which can pass back to string parsing position after reading a parameter value. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add serial number support for virtio_blkjohn cooper2009-06-241-1/+3
| | | | | | | | | | | | | | | | [brought forward to current qemu-kvm.git] This patch implements the missing qemu logic to interpret a '-drive .. serial=XYZ ..' flag for a virtio_blk device. The serial number string is contained in a skeletal IDENTIFY DEVICE data structure and this structure is made available to the guest virtio_blk driver via pci i/o region 0. Signed-off-by: john cooper <john.cooper@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Support addr=... in option argument of -drive if=virtioMarkus Armbruster2009-06-221-0/+1
| | | | | | | | | | | | | Make drive_init() accept addr=, put the value into struct DriveInfo. Use it in all the places that create virtio-blk-pci devices: pc_init1(), bamboo_init(), mpc8544ds_init(). Don't support addr= in third argument of monitor command pci_add and second argument of drive_add, because that clashes with their first arguments. Admittedly unelegant. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi.c: make qemu_system_device_hot_add piix independent.Isaku Yamahata2009-06-221-1/+2
| | | | | | | | introruce piix4_device_hot_add() for piix4 specific code and make qemu_system_device_hot_add() generic. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add -no-virtio-balloon command-line optionEduardo Habkost2009-06-131-0/+1
| | | | | | | This new option may be used to disable the virtio-balloon device. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: Real fix for check_params usersJan Kiszka2009-06-091-1/+2
| | | | | | | | | | | OK, last try: 8e4416af45 broke -net socket, ffad4116b9 tried to fix it but broke error reporting of invalid parameters. So this patch widely reverts ffad4116b9 again and intead fixes those callers of check_params that originally suffered from overwritten buffers by using separate ones. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* Use relative path for biosPaul Brook2009-05-301-1/+4
| | | | | | | Look for bios and other support files relative to qemu binary, rather than a hardcoded prefix. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Create qemu-option.hKevin Wolf2009-05-221-2/+0
| | | | | | | | | | | | | This patch creates a new header file and the corresponding implementation file for parsing of parameter strings for options (like used in -drive). Part of this is code moved from vl.c (so qemu-img can use it later). The idea is to have a data structure describing all accepted parameters. When parsing a parameter string, the structure is copied and filled with the parameter values. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* augment info migrate with page statusGlauber Costa2009-05-221-0/+4
| | | | | | | | | | | | | | | | This patch augments info migrate output with status about: * ram bytes remaining * ram bytes transferred * ram bytes total This should be enough for management tools to realize whether or not there is progress in migration. We can add more information later on, if the need arrives [v2: fixes bytes_transferred type] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>