summaryrefslogtreecommitdiffstats
path: root/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* drive: allow rerror, werror and readonly for if=noneGerd Hoffmann2010-05-281-3/+3
| | | | | | | | | | | | | | When creating guest disks the qdev way using ... -drive if=none,id=$name,args -device $driver,drive=$name it is not possible to specify rerror, werror and readonly arguments for drive as drive_init allows/blocks them based on the interface (if=) specified and none isn't white-listed there. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Make cache=unsafe the default for -snapshotAlexander Graf2010-05-271-2/+2
| | | | | | | | | When using -snapshot we don't care about data integrity of the cow file at all, so let's disable flushing there and squeeze out the last drop of performance we could possibly get. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add cache=unsafe parameter to -driveAlexander Graf2010-05-261-0/+3
| | | | | | | | | | | | | | | Usually the guest can tell the host to flush data to disk. In some cases we don't want to flush though, but try to keep everything in cache. So let's add a new cache value to -drive that allows us to set the cache policy to most aggressive, disabling flushes. We call this mode "unsafe", as guest data is not guaranteed to survive host crashes anymore. This patch also adds a noop function for aio, so we can do nothing in AIO fashion. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix error handling in qemu_read_config_fileKevin Wolf2010-05-241-2/+2
| | | | | | | | | | We need to close the file even in error case. While at it, make the callers catch all kind of errors. ENOENT is allowed for default config files, they are optional. Reported-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Monitor: Return before exiting with 'quit'"Luiz Capitulino2010-05-191-18/+0Star
| | | | | | | | This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d. Next commits will do the same thing in a better way. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* fix chardev_init for win32TeLeMan2010-05-181-2/+2
| | | | | | | | chardev_init functions use socket,so socket_init() shoud be placed at the front of chardev_init on win32. Signed-off-by: TeLeMan <geleman@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix cpu list("-cpu ?") breakage, spotted by TeLeManBlue Swirl2010-05-041-6/+1Star
| | | | | | Fix breakage by 04c9a0cbc2bf496889cef6da2d61bf00ef190a4f. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* QMP: Introduce RESUME eventLuiz Capitulino2010-05-031-0/+1
| | | | | | | | | | | | | It's emitted when the Virtual Machine resumes execution. We currently have the STOP event but don't have the matching RESUME one, this means that clients are notified when the VM is stopped but don't get anything when it resumes. Let's fix that as it's already causing some trouble to libvirt. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-9p: Create a syntactic shortcut for the file-system pass-thruGautham R Shenoy2010-05-031-0/+56
| | | | | | | | | | | | | | | | | | Currently the commandline to create a virtual-filesystem pass-through between the guest and the host is as follows: #qemu -fsdev fstype,id=ID,path=path/to/share \ -device virtio-9p-pci,fsdev=ID,mount_tag=tag \ This patch provides a syntactic short-cut to achieve the same as follows: #qemu -virtfs fstype,path=path/to/share,mount_tag=tag This will be internally expanded as: #qemu -fsdev fstype,id=tag,path=path/to/share, \ -device virtio-9p-pci,fsdev=tag,mount_tag=tag \ Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-9p: Create a commandline option -fsdevGautham R Shenoy2010-05-031-0/+27
| | | | | | | | | | | | | | | | | This patch creates a new command line option named -fsdev to hold any file system specific information. The option will currently hold the following attributes: -fsdev fstype id=id,path=path_to_share where fstype: Type of the file system. id: Identifier used to refer to this fsdev path: The path on the host that is identified by this fsdev. [aneesh.kumar@linux.vnet.ibm.com: Abstraction using FsContext] Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix boot once optionAlex Williamson2010-05-031-0/+7
| | | | | | | | | | | The boot once options seems to have gotten broken since it originally went in. We need to wait until the second time restore_boot_devices() gets called before restoring the standard boot order and removing itself from the reset list. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> -- Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix old typos in help headerThomas Monjalon2010-05-011-2/+2
| | | | | | | | 1) Qemu is not only a PC emulator. 2) "image image" has already been changed to "disk image" in qemu-doc.texi Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* monitor: Reorder intialization to drop initial mux focusJan Kiszka2010-04-261-3/+4
| | | | | | | | | | | | So far a multiplexed monitor started disabled. Restore this property for the new way of configuring by moving the monitor initialization before all devices (the last one to attach to a char-mux will gain the focus). Once we have a real use case for that, we may also consider assigning the initial focus explicitly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Cleanup ID assignment for compat switchJan Kiszka2010-04-261-5/+3Star
| | | | | | | | Canonicalize the ID assignment when creating monitor devices via the legacy switch and use less easily colliding names. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Monitor: Return before exiting with 'quit'Luiz Capitulino2010-04-261-0/+18
| | | | | | | | | | | | | | | The 'quit' Monitor command (implemented by do_quit()) calls exit() directly, this is problematic under QMP because QEMU exits before having a chance to send the ok response. Clients don't know if QEMU exited because of a problem or because the 'quit' command has been executed. This commit fixes that by moving the exit() call to the main loop, so that do_quit() requests the system to quit, instead of calling exit() directly. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* cleanup block driver option handling in vl.cChristoph Hellwig2010-04-231-29/+16Star
| | | | | | | | Assign directly to the bdrv_flags variable instead of using magic numbers before translating to the BDRV_O_* options. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Replace calls of old bdrv_openKevin Wolf2010-04-231-1/+1
| | | | | | | | | What is known today as bdrv_open2 becomes the new bdrv_open. All remaining callers of the old function are converted to the new one. In some places they even know the right format, so they should have used bdrv_open2 from the beginning. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-config: qemu_read_config_file() reads the normal config fileKevin Wolf2010-04-231-24/+11Star
| | | | | | | | Introduce a new function qemu_read_config_file which reads the VM configuration from a config file. Unlike qemu_config_parse it doesn't take a open file but a filename and reduces code duplication as a side effect. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* provide a stub version of kvm-all.c if !CONFIG_KVMPaolo Bonzini2010-04-191-9/+7Star
| | | | | | | | | | This allows limited use of kvm functions (which will return ENOSYS) even in once-compiled modules. The patch also improves a bit the error messages for KVM initialization. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [blauwirbel@gmail.com: fixed Win32 build] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()Markus Armbruster2010-04-181-5/+0Star
| | | | | | | | Both functions report errors nicely enough now, no need for additional messages. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Fix build when configured with --enable-io-threadBlue Swirl2010-04-121-11/+2Star
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* boot: remove unused boot_devices_bitmap variableEduardo Habkost2010-04-101-5/+3Star
| | | | | | | | | In addition to removing the variable, this also renames the parse_bootdevices() function to validate_bootdevices(), as we don't need its return value anymore. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* net: remove broken net_set_boot_mask() boot device validationEduardo Habkost2010-04-101-4/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | There are many problems with net_set_boot_mask(): 1) It is broken when using the device model instead of "-net nic". Example: $ qemu-system-x86_64 -device rtl8139,vlan=0,id=net0,mac=52:54:00:82:41:fd,bus=pci.0,addr=0x4 -net user,vlan=0,name=hostnet0 -vnc 0.0.0.0:0 -boot n Cannot boot from non-existent NIC $ 2) The mask was previously used to set which boot ROMs were supposed to be loaded, but this was changed long time ago. Now all ROM images are loaded, and SeaBIOS takes care of jumping to the right boot entry point depending on the boot settings. 3) Interpretation and validation of the boot parameter letters is done on the machine type code. Examples: PC accepts only a,b,c,d,n as valid boot device letters. mac99 accepts only a,b,c,d,e,f. As a side-effect of this change, qemu-kvm won't abort anymore if using "-boot n" on a machine with no network devices. Checking if the requested boot device is valid is now a task for the BIOS or the machine-type code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* move balloon handling to balloon.cPaolo Bonzini2010-04-091-34/+0Star
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* move two variable declarations out of vl.cPaolo Bonzini2010-04-091-4/+0Star
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* move socket_init to qemu-sockets.cPaolo Bonzini2010-04-091-24/+0Star
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* read-only: allow read-only CDROM with any interfaceNaphtali Sprei2010-04-081-8/+5Star
| | | | | Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Use sysctl instead of /proc to find executable path on FreeBSDJuergen Lock2010-03-301-4/+8
| | | | | | | ..since /proc usually isn't mounted on FreeBSD. Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Refactor target specific handling, compile vl.c only onceBlue Swirl2010-03-291-439/+37Star
| | | | | | | | | | | | | Move target specific functions and RAM handling to arch_init.c. Add a flag to QEMUOptions structure to indicate for which architectures the option is allowed, check the flag in run time and remove conditional code in option handling. Now that no target dependencies remain, compile vl.c only once for all targets. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Refactor CPUState handling out of vl.cBlue Swirl2010-03-291-746/+3Star
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Refactor a few architecture dependent pieces in vl.cBlue Swirl2010-03-291-25/+47
| | | | | | These will be moved later. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move KVM and Xen global flags to vl.cBlue Swirl2010-03-291-0/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Adjust debug handlingBlue Swirl2010-03-291-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix driftfix optionBlue Swirl2010-03-271-3/+3
| | | | | | Based on patch by Zachary Amsden. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Refactor numa mode settingBlue Swirl2010-03-271-8/+15
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile ide/core only onceBlue Swirl2010-03-271-1/+1
| | | | | | | | | Make win2k install hack unconditional as it is still restricted to x86 only in vl.c. Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Introduce a default qmp session"Anthony Liguori2010-03-211-63/+0Star
| | | | | | | | This reverts commit 3290c4aac5b97bb1e3b2b28d94669f2c611ce84a. Conflicts: vl.c
* Revert "qmp: don't make -qmp disable the default monitor"Anthony Liguori2010-03-211-11/+2Star
| | | | This reverts commit d49f626ed00cecc90fb1ff88da9bdf11e57094d1.
* Revert "Convert atexit users to exit_notifier"Anthony Liguori2010-03-211-5/+2Star
| | | | | | | | | | | | This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025. Conflicts: hw/xen_machine_pv.c This should have never been committed. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Add exit notifiers"Anthony Liguori2010-03-211-27/+0Star
| | | | | | | | This reverts commit 3b6304f706ef7eebc0b3b3f3a5093ec75448ee19. This was mistakenly committed. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix mingw32 buildBlue Swirl2010-03-201-3/+14
| | | | | | | | | | | mkdir() only takes path argument on mingw32: CC i386-softmmu/vl.o /src/qemu/vl.c: In function 'qmp_add_default': /src/qemu/vl.c:3763: error: too many arguments to function 'mkdir' /src/qemu/vl.c:3769: error: too many arguments to function 'mkdir' Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce a default qmp sessionAnthony Liguori2010-03-191-0/+52
| | | | | | | | | Basically, -qmp unix:%{home}/.qemu/qmp/%{uuid}.sock,server,nowait %{uuid} will be -uuid if it's specified, otherwise, if libuuid is available, we generate a uuid. If it's not available, we don't create one. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qmp: don't make -qmp disable the default monitorAnthony Liguori2010-03-191-2/+11
| | | | | | | | | | Instead, we introduce a default_qmp flag. We don't use it yet, but will in the next patch. This has a user-visible impact as specifying just -qmp will now also show a monitor on the 'vc'. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Convert atexit users to exit_notifierAnthony Liguori2010-03-191-2/+5
| | | | | | | | All of these users have global state so we really don't see a benefit from exit_notifier. However, using exit_notifier means that there's one less justification for having global state in the first place. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add exit notifiersAnthony Liguori2010-03-191-0/+27
| | | | | | Like atexit() but with state Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Handle deleted IOHandlers in a single bufferJuan Quintela2010-03-191-10/+7Star
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename IOCanRWHandler to IOCanReadHandlerJuan Quintela2010-03-191-2/+2
| | | | | | | It was always only used for reads Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Convert io handlers to QLISTJuan Quintela2010-03-191-21/+14Star
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* split out qemu-timer.cPaolo Bonzini2010-03-171-1166/+0Star
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* disentangle tcg and deadline calculationPaolo Bonzini2010-03-171-8/+15
| | | | | | | | | | Just tell main_loop_wait whether to be blocking or nonblocking, so that there is no need to call qemu_cpus_have_work from the timer subsystem. Instead, tcg_cpu_exec can say "we want the main loop not to block because we have stuff to do". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>