Commit Graph

960 Commits

Author SHA1 Message Date
Markus Armbruster
c389c43ee5 error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()
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>
2010-04-18 23:46:48 +02:00
Blue Swirl
7277e027bb Fix build when configured with --enable-io-thread
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-12 17:19:06 +00:00
Eduardo Habkost
4e9e9d6e0a boot: remove unused boot_devices_bitmap variable
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>
2010-04-10 02:10:02 +02:00
Eduardo Habkost
da1fcfda59 net: remove broken net_set_boot_mask() boot device validation
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>
2010-04-10 02:09:55 +02:00
Paolo Bonzini
28c2897373 move balloon handling to balloon.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 18:55:56 +02:00
Paolo Bonzini
fbe3288df6 move two variable declarations out of vl.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 18:55:54 +02:00
Paolo Bonzini
0706a4dcce move socket_init to qemu-sockets.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 18:55:54 +02:00
Naphtali Sprei
2db7ad59fc read-only: allow read-only CDROM with any interface
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 11:11:21 +02:00
Juergen Lock
92c0e6579c Use sysctl instead of /proc to find executable path on FreeBSD
..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>
2010-03-30 17:44:38 +00:00
Blue Swirl
ad96090a01 Refactor target specific handling, compile vl.c only once
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>
2010-03-29 19:23:52 +00:00
Blue Swirl
296af7c952 Refactor CPUState handling out of vl.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:50 +00:00
Blue Swirl
de06f8d193 Refactor a few architecture dependent pieces in vl.c
These will be moved later.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:50 +00:00
Blue Swirl
d745bef890 Move KVM and Xen global flags to vl.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:49 +00:00
Blue Swirl
54fc6ea92b Adjust debug handling
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:46 +00:00
Blue Swirl
7e4c0336e2 Fix driftfix option
Based on patch by Zachary Amsden.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 21:33:46 +00:00
Blue Swirl
87d0a28e78 Refactor numa mode setting
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 18:24:45 +00:00
Blue Swirl
f7736b91c4 Compile ide/core only once
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>
2010-03-27 06:20:53 +00:00
Anthony Liguori
5ec9cc64a4 Revert "Introduce a default qmp session"
This reverts commit 3290c4aac5.

Conflicts:

	vl.c
2010-03-21 14:15:24 -05:00
Anthony Liguori
2d114dc16f Revert "qmp: don't make -qmp disable the default monitor"
This reverts commit d49f626ed0.
2010-03-21 14:14:38 -05:00
Anthony Liguori
28695489e3 Revert "Convert atexit users to exit_notifier"
This reverts commit d7234f4d7e.

Conflicts:

	hw/xen_machine_pv.c

This should have never been committed.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-21 14:13:02 -05:00
Anthony Liguori
365c4243ec Revert "Add exit notifiers"
This reverts commit 3b6304f706.

This was mistakenly committed.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-21 14:11:51 -05:00
Blue Swirl
9b164805a3 Fix mingw32 build
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>
2010-03-20 08:26:27 +00:00
Anthony Liguori
3290c4aac5 Introduce a default qmp session
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>
2010-03-19 15:27:39 -05:00
Anthony Liguori
d49f626ed0 qmp: don't make -qmp disable the default monitor
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>
2010-03-19 15:27:39 -05:00
Anthony Liguori
d7234f4d7e Convert atexit users to exit_notifier
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>
2010-03-19 15:27:38 -05:00
Anthony Liguori
3b6304f706 Add exit notifiers
Like atexit() but with state

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Juan Quintela
4bed983730 Handle deleted IOHandlers in a single buffer
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:27 -05:00
Juan Quintela
7b27a769f1 rename IOCanRWHandler to IOCanReadHandler
It was always only used for reads

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:27 -05:00
Juan Quintela
31d4ee6cf6 Convert io handlers to QLIST
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:27 -05:00
Paolo Bonzini
db1a49726c split out qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:16:15 -05:00
Paolo Bonzini
d6f4ade214 disentangle tcg and deadline calculation
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>
2010-03-17 11:14:54 -05:00
Paolo Bonzini
16b151c393 place together more #ifdef CONFIG_IOTHREAD blocks
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:54 -05:00
Paolo Bonzini
1b48824fa0 move vmstate registration of vmstate_timers earlier
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
a2aaa079df new function qemu_icount_delta
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
6325504302 add qemu_alarm_pending
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
e2a7bb4b15 add qemu_icount_round
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
4e3de9e954 centralize handling of -icount
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
972abbe03b introduce and use qemu_clock_enable
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
8c04ba55f9 change qemu_run_timers interface
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
b696482754 extract timer handling out of main_loop_wait
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
3a720b14b9 remove qemu_rearm_alarm_timer from main loop
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
1db89e9123 tweak qemu_notify_event
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
7a5e583811 do not use qemu_event_increment outside qemu_notify_event
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
1828be316f more alarm timer cleanup
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
cd48d7e8f3 only one flag is needed for alarm_timer
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>
2010-03-17 11:14:53 -05:00
Paolo Bonzini
291defbcda fix error in win32_rearm_timer
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>
2010-03-17 11:14:52 -05:00
Paolo Bonzini
9aea10297f avoid dubiously clever code in win32_start_timer
The code is initializing an unsigned int to UINT_MAX using "-1", so that
the following always-true comparison seems to be always-false at a
first look.  Since alarm timer initializations are never nested, it is
simpler to unconditionally store the result of timeGetDevCaps into
data->period.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:14:52 -05:00
Anthony Liguori
4a39943bd1 Merge remote branch 'markus/qerror' into staging 2010-03-17 09:44:37 -05:00
Markus Armbruster
8212c64f0e qemu-option: Move the implied first name into QemuOptsList
We sometimes permit omitting the first option name, for example
-device foo is short for -device driver=foo.  The name to use
("driver" in the example) is passed as argument to qemu_opts_parse().
For each QemuOptsList, we use at most one such name.

Move the name into QemuOptsList, and pass whether to permit the
abbreviation.  This ensures continued consistency, and simplifies the
commit after next in this series.
2010-03-16 17:45:34 +01:00
Markus Armbruster
0f0bc3f1d5 error: Track locations on command line
New LOC_CMDLINE.  Use it for tracking option with argument in
lookup_opt().  We now report errors like this

    qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
2010-03-16 16:58:32 +01:00