summaryrefslogtreecommitdiffstats
path: root/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup block driver option handling in vl.cChristoph Hellwig2010-04-231-29/+16
| | | | | | | | 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/+11
| | | | | | | | 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/+7
| | | | | | | | | | 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/+0
| | | | | | | | 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/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* boot: remove unused boot_devices_bitmap variableEduardo Habkost2010-04-101-5/+3
| | | | | | | | | 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/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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/+0
| | | | | 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/+0
| | | | | 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/+0
| | | | | 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/+5
| | | | | 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/+37
| | | | | | | | | | | | | 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/+3
| | | | 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/+0
| | | | | | | | This reverts commit 3290c4aac5b97bb1e3b2b28d94669f2c611ce84a. Conflicts: vl.c
* Revert "qmp: don't make -qmp disable the default monitor"Anthony Liguori2010-03-211-11/+2
| | | | This reverts commit d49f626ed00cecc90fb1ff88da9bdf11e57094d1.
* Revert "Convert atexit users to exit_notifier"Anthony Liguori2010-03-211-5/+2
| | | | | | | | | | | | 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/+0
| | | | | | | | 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/+7
| | | | | 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/+14
| | | | | 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/+0
| | | | | 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>
* place together more #ifdef CONFIG_IOTHREAD blocksPaolo Bonzini2010-03-171-41/+37
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* move vmstate registration of vmstate_timers earlierPaolo Bonzini2010-03-171-31/+31
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* new function qemu_icount_deltaPaolo Bonzini2010-03-171-11/+18
| | | | | | | | Tweaking the rounding in qemu_next_deadline ensures that there's no change whatsoever. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add qemu_alarm_pendingPaolo Bonzini2010-03-171-3/+8
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add qemu_icount_roundPaolo Bonzini2010-03-171-6/+7
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* centralize handling of -icountPaolo Bonzini2010-03-171-14/+19
| | | | | | | A simple patch to place together all handling of -icount. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* introduce and use qemu_clock_enablePaolo Bonzini2010-03-171-2/+14
| | | | | | | | By adding the possibility to turn on/off a clock, yet another incestuous relationship between timers and CPUs can be disentangled. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* change qemu_run_timers interfacePaolo Bonzini2010-03-171-10/+8
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* extract timer handling out of main_loop_waitPaolo Bonzini2010-03-171-22/+25
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* remove qemu_rearm_alarm_timer from main loopPaolo Bonzini2010-03-171-1/+7
| | | | | | | Make the timer subsystem register its own callback instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tweak qemu_notify_eventPaolo Bonzini2010-03-171-7/+3
| | | | | | | | | | Instead of testing specially next_cpu in host_alarm_handler, just do that in qemu_notify_event. The idea is, if we are not running (or not yet running) target CPU code, prepare things so that the execution loop is exited asap; just make that clear. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* do not use qemu_event_increment outside qemu_notify_eventPaolo Bonzini2010-03-171-1/+2
| | | | | | | | | | | | | | | qemu_notify_event in the non-iothread case is only stopping the current CPU. However, if the CPU is idle and the main loop is in the select call then a call to qemu_event_increment is needed too (as done in host_alarm_handler). Since in general one doesn't know whether the CPU is executing or not, it is a safe bet to always do qemu_event_increment. Another way to see it: after this patch qemu_event_increment is the "common part" of qemu_notify_event for both the CONFIG_IOTHREAD and !CONFIG_IOTHREAD cases, which makes sense. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* more alarm timer cleanupPaolo Bonzini2010-03-171-11/+18
| | | | | | | | | | | | | The timer_alarm_pending variable is related to the alarm timer but not placed in the struct. Also, in qemu_mod_timer the wrong flag was being tested: the timer is rearmed in the alarm timer "bottom half", so the right flag to test there is the "pending" flag. Finally, I hoisted the NULL checks from alarm_has_dynticks to host_alarm_handler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* only one flag is needed for alarm_timerPaolo Bonzini2010-03-171-16/+15
| | | | | | | | The ALARM_FLAG_DYNTICKS can be testing simply by checking if there is a rearm function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix error in win32_rearm_timerPaolo Bonzini2010-03-171-1/+1
| | | | | | | | The TIME_ONESHOT and TIME_PERIODIC flags are mutually exclusive. The code after the patch matches the flags used in win32_start_timer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud