]> git.proxmox.com Git - qemu.git/log
qemu.git
14 years agomonitor: Port handler_3 to use QDict
Luiz Capitulino [Fri, 28 Aug 2009 18:27:15 +0000 (15:27 -0300)]
monitor: Port handler_3 to use QDict

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>
14 years agomonitor: Port handler_2 to use QDict
Luiz Capitulino [Fri, 28 Aug 2009 18:27:14 +0000 (15:27 -0300)]
monitor: Port handler_2 to use QDict

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>
14 years agomonitor: Port handler_1 to use QDict
Luiz Capitulino [Fri, 28 Aug 2009 18:27:13 +0000 (15:27 -0300)]
monitor: Port handler_1 to use QDict

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>
14 years agomonitor: Port handler_0 to use QDict
Luiz Capitulino [Fri, 28 Aug 2009 18:27:12 +0000 (15:27 -0300)]
monitor: Port handler_0 to use QDict

This commit ports command handlers that receive no arguments to use
the new monitor's dictionary.

It might seem no sense to do this, as the handlers have no arguments,
but at the end of this porting work all handlers will have the same
structure.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Export QDict header
Luiz Capitulino [Fri, 28 Aug 2009 18:27:11 +0000 (15:27 -0300)]
monitor: Export QDict header

Command handlers will have to use QDict functions, so export
qdict.h through monitor.h.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Setup a QDict with arguments to handlers
Luiz Capitulino [Fri, 28 Aug 2009 18:27:10 +0000 (15:27 -0300)]
monitor: Setup a QDict with arguments to handlers

With this commit monitor_handle_command() will be able to setup a
QDict with arguments to command handlers.

However, the current 'args[]' method is still being used, next
changes will port commands to get their arguments from the dictionary.

Two changes are worth noting:

1. The '/' argument type always adds the following standard keys in the
dictionary: 'count', 'format' and 'size'. This way, the argument
name used in the 'args_type' string doesn't matter

2. The optional argument type '?' doesn't need to pass the additional
'has_arg' argument, hanlders can do the same check with qdict_haskey()

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: New format for handlers argument types
Luiz Capitulino [Fri, 28 Aug 2009 18:27:09 +0000 (15:27 -0300)]
monitor: New format for handlers argument types

Current handlers argument types, as defined in qemu-monitor.hx file,
are a sequence of chars where each one represents one argument type
of the command handler. The number of chars is also used to know how
many arguments a given handler accepts.

This commit defines a new format, which makes mandatory the use of
a name for each argument.

For example, do_eject() command handler is currently defined as:

{ "eject", "-fB", do_eject, ... }

With the new format it becomes:

{ "eject", "force:-f,filename:B", do_eject, ... }

This way the Monitor will be capable of setting up a dictionary, using
each argument's name as the key and the argument itself as the value.

This commit also adds two new functions: key_get_info() and
next_arg_type(), both are used to parse the new format.

Currently key_get_info() consumes the 'key' part of the new format and
discards it, this way the current parsing code is not affected by this
change.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd wrappers to functions used by the Monitor
Luiz Capitulino [Fri, 28 Aug 2009 18:27:08 +0000 (15:27 -0300)]
Add wrappers to functions used by the Monitor

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>
14 years agoIntroduce QDict
Luiz Capitulino [Fri, 28 Aug 2009 18:27:07 +0000 (15:27 -0300)]
Introduce QDict

QDict is a high-level dictionary data type that can be used to store a
collection of QObjects. A unique key is associated with only one
QObject.

The following functions are available:

- qdict_new()    Create a new QDict
- qdict_put()    Add a new 'key:object' pair
- qdict_get()    Get the QObject of a given key
- qdict_del()    Delete a 'key:object' pair
- qdict_size()   Return the size of the dictionary
- qdict_haskey() Check if a given 'key' exists

Some high-level helpers to operate on QStrings and QInts objects
are also provided.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce QString
Luiz Capitulino [Fri, 28 Aug 2009 18:27:06 +0000 (15:27 -0300)]
Introduce QString

QString is a high-level data type that can be used to represent
C strings.

The following functions are available:

- qstring_from_str() Create a new QString
- qstring_get_str()  Get a pointer to the stored string

Note that qstring_get_str() is too low-level for a data type like
this, but it's interesting for quick read-only accesses.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce QInt
Luiz Capitulino [Fri, 28 Aug 2009 18:27:05 +0000 (15:27 -0300)]
Introduce QInt

QInt is a high-level data type that can be used to represent integers,
internally it stores an int64_t value.

The following functions are available:

- qint_from_int() Create a new QInt
- qint_get_int()  Get the stored integer

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce QObject
Luiz Capitulino [Fri, 28 Aug 2009 18:27:04 +0000 (15:27 -0300)]
Introduce QObject

This commit introduces the qobject.h header file, it contains
basic QObject definitions and helper macros.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoide: move cmd+irq from IDEState to IDEBus.
Gerd Hoffmann [Fri, 28 Aug 2009 14:37:42 +0000 (16:37 +0200)]
ide: move cmd+irq from IDEState to IDEBus.

These variables are per bus, not per drive.  Lets move them and
cleanup things a bit.  And fix the cmd migration bug for real.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoide: pass down DriveInfo instead of BlockDriverState
Gerd Hoffmann [Fri, 28 Aug 2009 13:47:03 +0000 (15:47 +0200)]
ide: pass down DriveInfo instead of BlockDriverState

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoSupport for multiple -monitor devices
Jan Kiszka [Thu, 27 Aug 2009 17:51:16 +0000 (19:51 +0200)]
Support for multiple -monitor devices

Rebased version of Anthony's patch: Allow to specify more than one
monitor terminal via the -monitor command line switch. This is
particularly useful when libvirt or some other management tool already
occupies the primary monitor but you need another one for debugging.
The current clumsy workaround is to multiplex such additional terminals
over a qemu character device (e.g. -serial mon:<device>).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agonet: Fix send queue ordering
Jan Kiszka [Wed, 26 Aug 2009 10:47:04 +0000 (12:47 +0200)]
net: Fix send queue ordering

Ensure that packets enqueued for delayed delivery are dequeued in FIFO
order. At least one simplistic guest TCP/IP stack became unhappy due to
sporadically reordered packet streams.

At this chance, switch the send queue implementation to TAILQ.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agodo not issue ioctl from within the io thread
Glauber Costa [Tue, 25 Aug 2009 22:13:36 +0000 (18:13 -0400)]
do not issue ioctl from within the io thread

According to Documentation/kvm/api.txt, (and well, to common sense),
we should not be calling vcpu ioctls from within the iothread.
Since vcpu initialization issues a vcpu ioctl, move it a little bit
further in time to prevent it.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDelay sighandler_setup()
Juan Quintela [Fri, 28 Aug 2009 17:25:15 +0000 (19:25 +0200)]
Delay sighandler_setup()

If we are using --serial telnet:0:5555,server  or similar, ^C will not
kill qemu.  We need to first connect using telnet, and the the ^C takes
effect.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRemove typedef for bool from eepro100.c
Amit Shah [Thu, 27 Aug 2009 12:31:24 +0000 (18:01 +0530)]
Remove typedef for bool from eepro100.c

eepro100.c shouldn't have the need to do this in its local header file.

And I recently started getting this:

$ make -j3
...
  CC    x86_64-softmmu/eepro100.o
/home/amit/src/qemu/hw/eepro100.c:112: error: two or more data types
in declaration specifiers
/home/amit/src/qemu/hw/eepro100.c:112: warning: useless type name in
empty declaration
make[1]: *** [eepro100.o] Error 1

so just remove the typedef and include <stdbool.h> instead.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoadd documentation for multi-core features
Andre Przywara [Fri, 28 Aug 2009 08:49:57 +0000 (10:49 +0200)]
add documentation for multi-core features

extend QEMU's internal help and man page to cover the recently
added multi-core feature.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopiix3: use new vmstate infrastructure
Juan Quintela [Fri, 28 Aug 2009 13:28:27 +0000 (15:28 +0200)]
piix3: use new vmstate infrastructure

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoi440fx: use new vmstate infrastructure
Juan Quintela [Fri, 28 Aug 2009 13:28:26 +0000 (15:28 +0200)]
i440fx: use new vmstate infrastructure

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoVMState: Fix sub-structs versioning
Juan Quintela [Fri, 28 Aug 2009 13:28:25 +0000 (15:28 +0200)]
VMState: Fix sub-structs versioning

We can't check the version in a substruct, it is not stored anywhere

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoUpdate SaveVM versions
Juan Quintela [Fri, 28 Aug 2009 13:28:24 +0000 (15:28 +0200)]
Update SaveVM versions

Now that we have all fields belonging to a PCIDevice, save each field
on the device that it belongs.  This means moving pci_irq_levels
from PCII440FXState to PIIX3State.
Old formats are loaded, but we only save on the new saner format.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopci_irq_levels[] belong to PIIX3State
Juan Quintela [Fri, 28 Aug 2009 13:28:23 +0000 (15:28 +0200)]
pci_irq_levels[] belong to PIIX3State

With previous cleanups, now it is possible to put it where it belongs

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoSave irq_state into PCII440FXState
Juan Quintela [Fri, 28 Aug 2009 13:28:22 +0000 (15:28 +0200)]
Save irq_state into PCII440FXState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoWe can add piix3_dev now to PIIX3IrqState
Juan Quintela [Fri, 28 Aug 2009 13:28:21 +0000 (15:28 +0200)]
We can add piix3_dev now to PIIX3IrqState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFold piix3_init() intto i440fx_init
Juan Quintela [Fri, 28 Aug 2009 13:28:20 +0000 (15:28 +0200)]
Fold piix3_init() intto i440fx_init

i440fx_init will now work properly if we don't setup piix3

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce PIIX3IrqState for piix3 irq's state
Juan Quintela [Fri, 28 Aug 2009 13:28:19 +0000 (15:28 +0200)]
Introduce PIIX3IrqState for piix3 irq's state

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoCreate PIIX3State instead of using PCIDevice for PIIX3
Juan Quintela [Fri, 28 Aug 2009 13:28:18 +0000 (15:28 +0200)]
Create PIIX3State instead of using PCIDevice for PIIX3

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoWe want the argument pass to set_irq to be opaque
Juan Quintela [Fri, 28 Aug 2009 13:28:17 +0000 (15:28 +0200)]
We want the argument pass to set_irq to be opaque

piix_pci want to pass more things that the pic

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMove smm_enabled and isa_memory_mappings to PCII440FXState
Juan Quintela [Fri, 28 Aug 2009 13:28:16 +0000 (15:28 +0200)]
Move smm_enabled and isa_memory_mappings to PCII440FXState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoUse PCII440FXState instead of generic PCIDevice
Juan Quintela [Fri, 28 Aug 2009 13:28:15 +0000 (15:28 +0200)]
Use PCII440FXState instead of generic PCIDevice

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolow_set_irq is not used anywhere
Juan Quintela [Fri, 28 Aug 2009 13:28:14 +0000 (15:28 +0200)]
low_set_irq is not used anywhere

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoSplit piix4 support from piix_pci.c
Juan Quintela [Fri, 28 Aug 2009 13:28:13 +0000 (15:28 +0200)]
Split piix4 support from piix_pci.c

Now mips_malta uses piix4 and pc's use piix_pci definitions

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopiix4 don't use pci_irq_levels at all
Juan Quintela [Fri, 28 Aug 2009 13:28:12 +0000 (15:28 +0200)]
piix4 don't use pci_irq_levels at all

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomicroblaze: Trap on illegal load/store sizes.
Edgar E. Iglesias [Fri, 4 Sep 2009 08:38:59 +0000 (10:38 +0200)]
microblaze: Trap on illegal load/store sizes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Correct FPU decoding masks.
Edgar E. Iglesias [Fri, 4 Sep 2009 07:40:49 +0000 (09:40 +0200)]
microblaze: Correct FPU decoding masks.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Compute masks for alignment checks at translation time.
Edgar E. Iglesias [Thu, 3 Sep 2009 20:28:21 +0000 (22:28 +0200)]
microblaze: Compute masks for alignment checks at translation time.

Thanks to Blue Swirl for reporting.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Trap on bus accesses to unmapped areas.
Edgar E. Iglesias [Thu, 3 Sep 2009 11:25:09 +0000 (13:25 +0200)]
microblaze: Trap on bus accesses to unmapped areas.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: MMU shows more respect to synthesis config.
Edgar E. Iglesias [Thu, 3 Sep 2009 11:04:02 +0000 (13:04 +0200)]
microblaze: MMU shows more respect to synthesis config.

The microblaze MMU can be synthesized in different configurations.
Have the MMU model show more respect to the chosen configuration.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Trap on unaligned data accesses.
Edgar E. Iglesias [Thu, 3 Sep 2009 10:59:46 +0000 (12:59 +0200)]
microblaze: Trap on unaligned data accesses.

Untested...

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Trap on divizions by zero.
Edgar E. Iglesias [Thu, 3 Sep 2009 10:52:01 +0000 (12:52 +0200)]
microblaze: Trap on divizions by zero.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Correct mfs into r0.
Edgar E. Iglesias [Thu, 3 Sep 2009 09:18:55 +0000 (11:18 +0200)]
microblaze: Correct mfs into r0.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Catch illegal insns and privilege violations.
Edgar E. Iglesias [Thu, 3 Sep 2009 09:12:30 +0000 (11:12 +0200)]
microblaze: Catch illegal insns and privilege violations.

Raise illegal instruction exceptions when executing instructions that
require units not available on the particulare microblaze configuration.

Also trap priviliege violations made by userspace.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Add infrastructure for supporting hw exceptions.
Edgar E. Iglesias [Thu, 3 Sep 2009 08:25:00 +0000 (10:25 +0200)]
microblaze: Add infrastructure for supporting hw exceptions.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Clear exception in dslot ESR bit if not in dslot.
Edgar E. Iglesias [Thu, 3 Sep 2009 08:15:17 +0000 (10:15 +0200)]
microblaze: Clear exception in dslot ESR bit if not in dslot.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Correct MMU debug log.
Edgar E. Iglesias [Thu, 3 Sep 2009 08:13:08 +0000 (10:13 +0200)]
microblaze: Correct MMU debug log.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoFix warning on x86_64
Kirill A. Shutemov [Wed, 2 Sep 2009 15:18:04 +0000 (18:18 +0300)]
Fix warning on x86_64

audio/esdaudio.c: In function 'qesd_thread_out':
audio/esdaudio.c:136: error: format '%d' expects type 'int', but
argument 3 has type 'ssize_t'
audio/esdaudio.c: In function 'qesd_thread_in':
audio/esdaudio.c:366: error: format '%d' expects type 'int', but
argument 3 has type 'ssize_t'

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoSparc32: port sun4c interrupt controller to VMState design
Blue Swirl [Mon, 31 Aug 2009 19:30:21 +0000 (19:30 +0000)]
Sparc32: port sun4c interrupt controller to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port timers to VMState design
Blue Swirl [Mon, 31 Aug 2009 19:30:18 +0000 (19:30 +0000)]
Sparc32: port timers to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: timer field is never NULL
Blue Swirl [Mon, 31 Aug 2009 19:30:17 +0000 (19:30 +0000)]
Sparc32: timer field is never NULL

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoAdd VMState support for ptimers
Blue Swirl [Mon, 31 Aug 2009 19:30:15 +0000 (19:30 +0000)]
Add VMState support for ptimers

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoesp (sparc32) Extra scsi data.
Artyom Tarasenko [Mon, 31 Aug 2009 17:03:51 +0000 (19:03 +0200)]
esp (sparc32) Extra scsi data.

> ESP: Message Accepted (12)
> ESP: Transfer status (sense=0)
> ESP: read reg[5]: 0x20
> ESP: read reg[4]: 0x07
> ESP: read reg[7]: 0x02
> Extra scsi data. Fatal error.

It looks like "Message Accepted" shouldn't write a response. At least
ESP_RFLAGS must definetely be 0. With the following fix OBP goes one
step further:

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix compiler warnings
Stefan Weil [Mon, 31 Aug 2009 14:29:34 +0000 (16:29 +0200)]
Fix compiler warnings

Starting with commit df7a86ed735eafefbd046c8cad7134652fe3f600,
mingw32 builds result in a compiler warning for dns_addr:

  CC    slirp/slirp.o
/home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: missing braces around initializer
/home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: (near initialization for ‘dns_addr.S_un’)

Removing the assignment fixes the warning without the need of special code
for mingw32 (and also saves some bytes in the resulting binary).

To fix another potential compiler warning, the missing 'static'
attribute was added.

The same changes were applied to dns_addr_time.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix breakage due to __thread
Blue Swirl [Mon, 31 Aug 2009 15:14:40 +0000 (15:14 +0000)]
Fix breakage due to __thread

Thread-local storage is not supported on all hosts.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix gcc 3 warning: comparison is always true due to limited range of data type
Blue Swirl [Sat, 29 Aug 2009 13:37:34 +0000 (16:37 +0300)]
Fix gcc 3 warning: comparison is always true due to limited range of data type

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix gcc 3 warning about uninitialized variable
Blue Swirl [Sat, 29 Aug 2009 13:37:26 +0000 (16:37 +0300)]
Fix gcc 3 warning about uninitialized variable

If nb_sectors is 0, cluster_offset will not be initialized.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port Slavio misc devices to VMState design
Blue Swirl [Sat, 29 Aug 2009 13:37:09 +0000 (16:37 +0300)]
Sparc32: port Slavio misc devices to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port ECC memory controller to VMState design
Blue Swirl [Sat, 29 Aug 2009 13:36:58 +0000 (16:36 +0300)]
Sparc32: port ECC memory controller to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port IOMMU to VMState design
Blue Swirl [Fri, 28 Aug 2009 20:46:21 +0000 (20:46 +0000)]
Sparc32: port IOMMU to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port DMA controller to VMState design
Blue Swirl [Fri, 28 Aug 2009 20:46:15 +0000 (20:46 +0000)]
Sparc32: port DMA controller to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port TCX to VMState design
Blue Swirl [Fri, 28 Aug 2009 20:43:01 +0000 (20:43 +0000)]
Sparc32: port TCX to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: port interrupt controller to VMState design
Blue Swirl [Fri, 28 Aug 2009 20:22:52 +0000 (20:22 +0000)]
Sparc32: port interrupt controller to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUpdate OpenBIOS images to r569
Blue Swirl [Fri, 28 Aug 2009 19:47:11 +0000 (19:47 +0000)]
Update OpenBIOS images to r569

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSuppress kraxelisms
Blue Swirl [Fri, 28 Aug 2009 19:12:16 +0000 (19:12 +0000)]
Suppress kraxelisms

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix Sparc64 breakage: add dummy ISA irqs
Blue Swirl [Fri, 28 Aug 2009 19:04:13 +0000 (19:04 +0000)]
Fix Sparc64 breakage: add dummy ISA irqs

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix merge of 59f2a78793b6d17634f39646d604e84af51e0919
Blue Swirl [Fri, 28 Aug 2009 18:30:54 +0000 (18:30 +0000)]
Fix merge of 59f2a78793b6d17634f39646d604e84af51e0919

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoDon't compile aio code if CONFIG_LINUX_AIO is undefined
Stefan Weil [Fri, 28 Aug 2009 12:39:31 +0000 (14:39 +0200)]
Don't compile aio code if CONFIG_LINUX_AIO is undefined

This patch fixes linker errors when building QEMU without Linux AIO support.

It is based on suggestions from malc and Kevin Wolf.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix sb16 breakage due to unassigned s->irq
malc [Fri, 28 Aug 2009 10:33:43 +0000 (14:33 +0400)]
Fix sb16 breakage due to unassigned s->irq

Signed-off-by: malc <av1474@comtv.ru>
14 years agoFix formatting
malc [Fri, 28 Aug 2009 10:33:10 +0000 (14:33 +0400)]
Fix formatting

Signed-off-by: malc <av1474@comtv.ru>
14 years agoMerge commit 'linux-user/linux-user-for-upstream' into staging
Anthony Liguori [Fri, 28 Aug 2009 01:55:01 +0000 (20:55 -0500)]
Merge commit 'linux-user/linux-user-for-upstream' into staging

14 years agoRelax pthreads check to avoid win32
Anthony Liguori [Tue, 25 Aug 2009 22:21:56 +0000 (17:21 -0500)]
Relax pthreads check to avoid win32

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoe1000 cleanup
Juan Quintela [Mon, 24 Aug 2009 16:43:00 +0000 (18:43 +0200)]
e1000 cleanup

Remove un needed casts from void *.
Use DO_UPCAST() instead of blind casts

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopcnet: Add pci_pcnet_{save/load} functions, then remove PCNetState pci_dev field
Juan Quintela [Mon, 24 Aug 2009 16:42:59 +0000 (18:42 +0200)]
pcnet: Add pci_pcnet_{save/load} functions, then remove PCNetState pci_dev field

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopcnet: remove useless casts This are casts to the very type of the function
Juan Quintela [Mon, 24 Aug 2009 16:42:58 +0000 (18:42 +0200)]
pcnet: remove useless casts This are casts to the very type of the function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopcnet: Change casts to DO_UPCAST() for PCIPCNetState
Juan Quintela [Mon, 24 Aug 2009 16:42:57 +0000 (18:42 +0200)]
pcnet: Change casts to DO_UPCAST() for PCIPCNetState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd pci_cirrus_vga_{save/load} functions, then remove vga.pci_dev use
Juan Quintela [Mon, 24 Aug 2009 16:42:56 +0000 (18:42 +0200)]
Add pci_cirrus_vga_{save/load} functions, then remove vga.pci_dev use

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agocirrus_vga: Change casts to DO_UPCAST() for PCICirrusVGAState
Juan Quintela [Mon, 24 Aug 2009 16:42:55 +0000 (18:42 +0200)]
cirrus_vga: Change casts to DO_UPCAST() for PCICirrusVGAState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agocirrus_vga: remove pointless cast from void *
Juan Quintela [Mon, 24 Aug 2009 16:42:54 +0000 (18:42 +0200)]
cirrus_vga: remove pointless cast from void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd pci_ne2000_{save/load} functions, then remove pci_dev NE2000State field
Juan Quintela [Mon, 24 Aug 2009 16:42:53 +0000 (18:42 +0200)]
Add pci_ne2000_{save/load} functions, then remove pci_dev NE2000State field

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoWe need PCINE2000State for save/load functions
Juan Quintela [Mon, 24 Aug 2009 16:42:52 +0000 (18:42 +0200)]
We need PCINE2000State for save/load functions

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agone2000: Change casts to DO_UPCAST() for PCINE2000State
Juan Quintela [Mon, 24 Aug 2009 16:42:51 +0000 (18:42 +0200)]
ne2000: Change casts to DO_UPCAST() for PCINE2000State

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agone2000: pci_dev has this very value with the right type
Juan Quintela [Mon, 24 Aug 2009 16:42:50 +0000 (18:42 +0200)]
ne2000: pci_dev has this very value with the right type

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agone2000: remove casts from void *
Juan Quintela [Mon, 24 Aug 2009 16:42:49 +0000 (18:42 +0200)]
ne2000: remove casts from void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agousb-ohci: Change casts to DO_UPCAST() for OHCIPCIState
Juan Quintela [Mon, 24 Aug 2009 16:42:48 +0000 (18:42 +0200)]
usb-ohci: Change casts to DO_UPCAST() for OHCIPCIState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoEverything outside of vga.c should use VGACommonState
Juan Quintela [Mon, 24 Aug 2009 16:42:47 +0000 (18:42 +0200)]
Everything outside of vga.c should use VGACommonState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovga: Rename vga_state -> vga
Juan Quintela [Mon, 24 Aug 2009 16:42:46 +0000 (18:42 +0200)]
vga: Rename vga_state -> vga

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce vga_common_reset() to be able to typcheck vga_reset()
Juan Quintela [Mon, 24 Aug 2009 16:42:45 +0000 (18:42 +0200)]
Introduce vga_common_reset() to be able to typcheck vga_reset()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi53c895a: LSIState is a DeviceHost
Juan Quintela [Mon, 24 Aug 2009 16:42:44 +0000 (18:42 +0200)]
lsi53c895a: LSIState is a DeviceHost

Go figure.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi53c895a: rename PCIDevice field from pci_dev to dev (consistence)
Juan Quintela [Mon, 24 Aug 2009 16:42:43 +0000 (18:42 +0200)]
lsi53c895a: rename PCIDevice field from pci_dev to dev (consistence)

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi53c895a: use DO_UPCAST to cast from PCIDevice
Juan Quintela [Mon, 24 Aug 2009 16:42:42 +0000 (18:42 +0200)]
lsi53c895a: use DO_UPCAST to cast from PCIDevice

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi53c895a: remove pointless cast from void *
Juan Quintela [Mon, 24 Aug 2009 16:42:41 +0000 (18:42 +0200)]
lsi53c895a: remove pointless cast from void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agortl8139: remove pointless cast from void *
Juan Quintela [Mon, 24 Aug 2009 16:42:40 +0000 (18:42 +0200)]
rtl8139: remove pointless cast from void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agortl8139: Remove unneeded double indirection of PCIRTL8139State
Juan Quintela [Mon, 24 Aug 2009 16:42:39 +0000 (18:42 +0200)]
rtl8139: Remove unneeded double indirection of PCIRTL8139State

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoeepro100: Remove unused indirection of PCIDevice
Juan Quintela [Mon, 24 Aug 2009 16:42:37 +0000 (18:42 +0200)]
eepro100: Remove unused indirection of PCIDevice

Once there, there is no way that we don't have a PCI Device at save/load time. Remove the check

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoeepro100: cast a void * makes no sense
Juan Quintela [Mon, 24 Aug 2009 16:42:36 +0000 (18:42 +0200)]
eepro100: cast a void * makes no sense

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoeepro100: convert casts to DO_UPCAST()
Juan Quintela [Mon, 24 Aug 2009 16:42:35 +0000 (18:42 +0200)]
eepro100: convert casts to DO_UPCAST()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoslirp: Read host DNS config on demand
Ed Swierk [Fri, 21 Aug 2009 02:00:31 +0000 (19:00 -0700)]
slirp: Read host DNS config on demand

Currently the qemu user-mode networking stack reads the host DNS
configuration (/etc/resolv.conf or the Windows equivalent) only once
when qemu starts.  This causes name lookups in the guest to fail if the
host is moved to a different network from which the original DNS servers
are unreachable, a common occurrence when the host is a laptop.

This patch changes the slirp code to read the host DNS configuration on
demand, caching the results for at most 1 second to avoid unnecessary
overhead if name lookups occur in rapid succession.  On non-Windows
hosts, /etc/resolv.conf is re-read only if the file has been replaced or
if its size or mtime has changed.

Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoslirp: Remove our_addr code
Ed Swierk [Fri, 21 Aug 2009 02:00:25 +0000 (19:00 -0700)]
slirp: Remove our_addr code

Three problems with our_addr:

- It's determined only once when qemu starts, but the address can change
(just like the DNS configuration can).

- It's supposed to be the IP address of a host network interface, but
there's no guarantee that gethostbyname(gethostname()) actually does
that: the host might be a laptop that has only a loopback interface up,
or the hostname might be localhost.localdomain, etc.

- It's useless at best: get_dns_addr() calls it, there's no reason to
send DNS requests to a different IP address if you're running a DNS
server on the host and resolv.conf points to 127.0.0.1.

These problems are easily solved by removing the code.

Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>