aboutsummaryrefslogtreecommitdiffstats
path: root/vl.c
AgeCommit message (Collapse)AuthorFilesLines
2009-08-24Unbreak large mem support by removing kqemuAnthony Liguori1-51/+2
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>
2009-08-24QEMU set irq0override in fw_cfgJes Sorensen1-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>
2009-08-24Clean up VGA type selection; far too many variables being used to track one ↵Zachary Amsden1-12/+6
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>
2009-08-24Do not disable autostart for live migrationAvi Kivity1-4/+2
If the user does not want autostart, they can specify -S. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-10check for PR_SET_NAME being definedNathan Froyd1-1/+1
Depending on what glibc/kernel headers you are compiling against, PR_SET_NAME may or may not be defined. Do the right thing if PR_SET_NAME isn't defined and skip setting the process name. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10variable timer intervalsStefano Stabellini1-1/+1
This patch introduces dynamic timer intervals: we slow down the refresh rate when there in no much activity but we get back to a fast refresh rate when the activity resume. Please note that qemu_timer_expired is not an inline function any more because I needed to call it from vnc.c however I don't think this change should have any serious consequence. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10qdev-ify virtio-blk.Gerd Hoffmann1-1/+8
First user of the new drive property. With this patch applied host and guest config can be specified separately, like this: -drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1 You can set any property for virtio-blk-pci now. You can set the pci address via addr=. You can switch the device into 0.10 compat mode using class=0x0180. As this is per device you can have one 0.10 and one 0.11 virtio block device in a single virtual machine. Old syntax continues to work. Internally it does the same as the two lines above though. One side effect this has is a different initialization order, which might result in a different pci address being assigned by default. Long term plan here is to have this working for all block devices, i.e. once all scsi is properly qdev-ified you will be able to do something like this: -drive if=none,id=sda,file=/path/to/disk.img -device lsi,id=lsi,addr=<pciaddr> -device scsi-disk,drive=sda,bus=lsi.0,lun=<n> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10add -drive if=noneGerd Hoffmann1-0/+4
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:
2009-08-10constify drive_get_by_id argGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10QemuOpts: switch over -device.Gerd Hoffmann1-14/+17
Make -device switch use the QemuOpts framework. Everything should continue to work like it did before. New: "-set device.$id.$property=$value" works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10QemuOpts: add -set optionGerd Hoffmann1-0/+4
One use case will be file for drives (no filename quoting issues), i.e. -drive id=test,if=virtio -set drive.test.file=/vmdisk/test-virtio.img It will work for any other option (assuming handled by QemuOpts) though. Except for id= for obvious reasons ;). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10QemuOpts: create qemu-config.hGerd Hoffmann1-72/+4
Move drive option description there. Rename it, give it a qemu_ prefix. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10QemuOpts: make the drive id actually show up in "info block".Gerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-09Use qemu_irq for system_powerdownBlue Swirl1-2/+5
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-30fix migration to obey -SPaolo Bonzini1-2/+2
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>
2009-07-27rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIANJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27rename HOST_BSD to CONFIG_BSDJuan Quintela1-2/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Remove special Win32 code in vl.c that's no longer needed.Filip Navara1-4/+0
Signed-off-by: Filip Navara <filip.navara@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Remove setvbuf(<handle>, NULL, _IOLBF, 0) calls for Win32Filip Navara1-0/+3
On Win32 the setvbuf function requires the last parameter to be size between 2 and INT_MAX bytes, so the calls always failed. Since the whole point of the calls is to set line-buffered mode for the file handle and that's not supported on Win32 anyway, conditionally remove them. Signed-off-by: Filip Navara <filip.navara@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27fix broken migrationGlauber Costa1-1/+3
While fixing migration with -S, commit 89befdd1a6b18215153b8976682d57b7d03d5782 broke the rest of us. Poor glommer, with a poor family, spare him his life from this monstruosity. Since the unconditional vm_start, not autostart was the villain, I'm putting back autostart. Let me know if you prefer other solutions, it doesn't really matter, doesn't really matter to me. Any way the wind blows... Signed-off-by: Glauber Costa <glommer@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Introduce -smp , maxcpus= flag to specify maximum number of CPUS.Jes Sorensen1-1/+26
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>
2009-07-27switch -drive to QemuOpts.Gerd Hoffmann1-139/+169
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>
2009-07-27move parser functions from vl.c to qemu-option.cGerd Hoffmann1-64/+0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27kill drives_optGerd Hoffmann1-53/+27
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>
2009-07-27add support for drive ids.Gerd Hoffmann1-18/+32
-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>
2009-07-27kill drives_tableGerd Hoffmann1-90/+87
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>
2009-07-27qdev: add -device command line option.Gerd Hoffmann1-33/+64
The -device switch is the users frontend to the qdev_device_add function added by the previous patch. Also adds a linked list where command line options can be saved. Use it for the new -device and for the -usbdevice and -bt switches. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Add machine type aliasesMark McLoughlin1-0/+5
Add an 'alias' field to QEMUMachine and display it in the output of 'qemu -M ?' with an '(aliased to foo)' suffix. Aliases can change targets in newer versions of qemu, so management tools may choose canonicalize machine types to ensure that if a user chooses an alias, that the actual machine type used will remain compatible in future. This is intended to mimic a symlink to a machine description file. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-17Fix OpenBSD buildBlue Swirl1-0/+2
The header sys-queue.h must be #included early, otherwise at some point OS queue macros will be used. On OpenBSD, those don't define TAILQ_FOREACH_SAFE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16qdev/compat: compat property infrastructure.Gerd Hoffmann1-0/+3
This add support for switching devices into a compatibility mode using device properties. Machine types can have a list of properties for specific devices attached to allow the easy creation of machine types compatible to older qemu versions. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16honor -S on incoming migrationPaolo Bonzini1-3/+1
-S is not honored by qemu on incoming migration. If a domain is migrated while paused, thus, it will start running on the remote machine; this is wrong. Given the trivial patch to fix this, it looks more like a thinko than anything else, probably dating back to the qemu-kvm merge. The interesting part is that the -S mechanism was in fact *used* when migrating (setting autostart = 0) and the incoming migration code was starting the VM at the end of the migration. Since I was removing the vm_start from there, I also corrected a related imprecision. The code was doing a vm_stop "just in case", but we can be sure that the VM is not running---the vm_start call in vl.c has not been reached yet. So the vm_stop is removed together with the vm_start. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Add boot menu control via command line switchJan Kiszka1-1/+15
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>
2009-07-16Add boot-once supportJan Kiszka1-1/+22
This allows to specify an exceptional boot order only for the first startup of the guest. After reboot, qemu will switch back to the default order (or what was specified via 'order='). Makes installing from CD images and then booting the freshly set up harddisk more handy. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Add qemu_unregister_resetJan Kiszka1-2/+15
Will be used by '-boot once=...', and should also help in other use cases. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Rework reset handler managementJan Kiszka1-10/+6
Convert the reset handler maintenance code to TAILQ services. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Move boot_set callback backendJan Kiszka1-0/+17
Move registration function for the boot_set callback handler and provide qemu_boot_set so that it can also be used outside the monitor code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Rework -boot optionJan Kiszka1-31/+50
This patch changes the boot command line option to the canonical format -boot [order=drives][,...] where 'drives' is using the same format as the old -boot. The format switch allows to add the 'menu' and 'once' options in later patches. The old format is still understood and will be processed at least for a transition time. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Disable kqemu by default at run timeAnthony Liguori1-2/+2
-no-kqemu -> -enable-kqemu kqemu is still present at compile time by default Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Allow setting qemu process name v2Andi Kleen1-1/+28
Set the Linux process name to the name argument specified with name. I find this useful to see which guests are taking CPU time in top. This doesn't affect ps, which checks argv[0], but rewriting the environment uses much more code, so I only used this simple way. v2: Use separate process= argument, no prefixes. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09split out ioport related stuffs from vl.c into ioport.c.Isaku Yamahata1-226/+0
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09qcow2: Make cache=writethrough defaultKevin Wolf1-3/+1
The performance of qcow2 has improved meanwhile, so we don't need to special-case it any more. Switch the default to write-through caching like all other block drivers. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29Replace -no-virtio-balloon by -balloonMarkus Armbruster1-3/+30
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>
2009-06-29Revert "Introduce reset notifier order"Jan Kiszka1-5/+2
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29kvm: Rework VCPU synchronizationJan Kiszka1-11/+0
During startup and after reset we have to synchronize user space to the in-kernel KVM state. Namely, we need to transfer the VCPU registers when they change due to VCPU as well as APIC reset. This patch refactors the required hooks so that kvm_init_vcpu registers its own per-VCPU reset handler and adds a cpu_synchronize_state to the APIC reset. That way we no longer depend on the new reset order (and can drop this disliked interface again) and we can even drop a KVM hook in main(). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Kill slirp_is_initedJan Kiszka1-18/+5
Avoid the need for slirp_is_inited by refactoring the protected slirp_select_* functions. This also avoids the clearing of all fd sets on select errors. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Rework monitor commands for host forwardingJan Kiszka1-1/+1
Improve the monitor interface for adding and removing host forwarding rules by splitting it up in two commands and rename them to hostfwd_add and hostfwd_remove. Also split up the paths taken for legacy -redir support and the monitor add command as the latter will be extended later on. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Move smb, redir, tftp and bootp parameters and -net channelJan Kiszka1-3/+3
So far a couple of slirp-related parameters were expressed via stand-alone command line options. This it inconsistent and unintuitive. Moreover, it prevents both dynamically reconfigured (host_net_add/ delete) and multi-instance slirp. This patch refactors the configuration by turning -smb, -redir, -tftp and -bootp as well as -net channel into options of "-net user". The old stand-alone command line options are still processed, but no longer advertised. This allows smooth migration of management applications to to the new syntax and also the extension of that syntax later in this series. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29Introduce get_next_param_valueJan Kiszka1-4/+13
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>
2009-06-24Make sure to zero out memory before calling madvise to increase robustnessAnthony Liguori1-3/+3
Avi pointed out that it's not entirely safe to rely on madvise zeroing out memory. So let's do it explicitly before calling madvise. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-22Win32: Fix compilation with SDL.Stefan Weil1-2/+2
`sdl-config --cflags` defines main = SDL_main on some platforms. One of these platforms is Windows with mingw32. For those platforms, the solution already developed for __APPLE__ is now applied. A compiler warning (missing return value) is fixed, too. Maybe __APPLE__ no longer needs a separate check. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>