sdk/emulator/qemu.git
14 years agonet: inet_strfamily(): Better unknown family report
Luiz Capitulino [Wed, 20 Jan 2010 13:42:39 +0000 (11:42 -0200)]
net: inet_strfamily(): Better unknown family report

Returning "????" is a bit meaningless, let's call it "unknown".

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agonet: Make inet_strfamily() public
Luiz Capitulino [Wed, 20 Jan 2010 13:42:38 +0000 (11:42 -0200)]
net: Make inet_strfamily() public

So that it can be used by other subsystems.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-serial: Use MSI vectors for port virtqueues
Amit Shah [Tue, 19 Jan 2010 19:06:58 +0000 (00:36 +0530)]
virtio-serial: Use MSI vectors for port virtqueues

This commit enables the use of MSI interrupts for virtqueue
notifications for ports. We use nr_ports + 1 (for control channel) msi
entries for the ports, as only the in_vq operations need an interrupt on
the guest.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMove virtio-serial to Makefile.objs
Amit Shah [Tue, 19 Jan 2010 19:06:57 +0000 (00:36 +0530)]
Move virtio-serial to Makefile.objs

There's nothing target-dependent in the virtio-serial code so allow it
to be compiled just once for all the targets.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-serial: Add a 'virtserialport' device for generic serial port support
Amit Shah [Tue, 19 Jan 2010 19:06:56 +0000 (00:36 +0530)]
virtio-serial: Add a 'virtserialport' device for generic serial port support

This commit adds a simple chardev-based serial port. Any data the guest
sends is forwarded to the chardev and vice-versa.

Sample uses for such a device can be obtaining info from the guest like
the file systems used, apps installed, etc. for offline usage and
logged-in users, clipboard copy-paste, etc. for online usage.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-serial-bus: Add ability to hot-unplug ports
Amit Shah [Tue, 19 Jan 2010 19:06:55 +0000 (00:36 +0530)]
virtio-serial-bus: Add ability to hot-unplug ports

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-serial-bus: Add a port 'name' property for port discovery in guests
Amit Shah [Tue, 19 Jan 2010 19:06:54 +0000 (00:36 +0530)]
virtio-serial-bus: Add a port 'name' property for port discovery in guests

The port 'id' or number is internal state between the guest kernel and
our bus implementation. This is invocation-dependent and isn't part of
the guest-host ABI.

To correcly enumerate and map ports between the host and the guest, the
'name' property is used.

Example:

    -device virtserialport,name=org.qemu.port.0

This invocation will get us a char device in the guest at:

    /dev/virtio-ports/org.qemu.port.0

which can be a symlink to

    /dev/vport0p3

This 'name' property is exposed by the guest kernel in a sysfs
attribute:

    /sys/kernel/virtio-ports/vport0p3/name

A simple udev script can pick up this name and create the symlink
mentioned above.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-serial-bus: Maintain guest and host port open/close state
Amit Shah [Tue, 19 Jan 2010 19:06:53 +0000 (00:36 +0530)]
virtio-serial-bus: Maintain guest and host port open/close state

Via control channel messages, the guest can tell us whether a port got
opened or closed. Similarly, we can also indicate to the guest of host
port open/close events.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-console: qdev conversion, new virtio-serial-bus
Amit Shah [Tue, 19 Jan 2010 19:06:52 +0000 (00:36 +0530)]
virtio-console: qdev conversion, new virtio-serial-bus

This commit converts the virtio-console device to create a new
virtio-serial bus that can host console and generic serial ports. The
file hosting this code is now called virtio-serial-bus.c.

The virtio console is now a very simple qdev device that sits on the
virtio-serial-bus and communicates between the bus and qemu's chardevs.

This commit also includes a few changes to the virtio backing code for
pci and s390 to spawn the virtio-serial bus.

As a result of the qdev conversion, we get rid of a lot of legacy code.
The old-style way of instantiating a virtio console using

    -virtioconsole ...

is maintained, but the new, preferred way is to use

    -device virtio-serial -device virtconsole,chardev=...

With this commit, multiple devices as well as multiple ports with a
single device can be supported.

For multiple ports support, each port gets an IO vq pair. Since the
guest needs to know in advance how many vqs a particular device will
need, we have to set this number as a property of the virtio-serial
device and also as a config option.

In addition, we also spawn a pair of control IO vqs. This is an internal
channel meant for guest-host communication for things like port
open/close, sending port properties over to the guest, etc.

This commit is a part of a series of other commits to get the full
implementation of multiport support. Future commits will add other
support as well as ride on the savevm version that we bump up here.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio: Remove duplicate macro definition for max. virtqueues, bump up the max
Amit Shah [Tue, 19 Jan 2010 19:06:51 +0000 (00:36 +0530)]
virtio: Remove duplicate macro definition for max. virtqueues, bump up the max

VIRTIO_PCI_QUEUE_MAX is redefined in hw/virtio.c. Let's just keep it in
hw/virtio.h.

Also, bump up the value of the maximum allowed virtqueues to 64. This is
in preparation to allow multiple ports per virtio-console device.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDisable fall-back to read-only when cannot open drive's file for read-write
Naphtali Sprei [Sun, 17 Jan 2010 14:48:15 +0000 (16:48 +0200)]
Disable fall-back to read-only when cannot open drive's file for read-write

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdded drives' readonly option
Naphtali Sprei [Sun, 17 Jan 2010 14:48:14 +0000 (16:48 +0200)]
Added drives' readonly option

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoClean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and...
Naphtali Sprei [Sun, 17 Jan 2010 14:48:13 +0000 (16:48 +0200)]
Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.

Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,
pass the request in the flags parameter to the function.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMake CDROM a read-only drive
Naphtali Sprei [Sun, 17 Jan 2010 14:48:12 +0000 (16:48 +0200)]
Make CDROM a read-only drive

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDocumentation: Add missing documentation for qdev related command line options
Stefan Weil [Sat, 16 Jan 2010 17:19:44 +0000 (18:19 +0100)]
Documentation: Add missing documentation for qdev related command line options

The command line options -device, -nodefaults, -readconfig,
-writeconfig had entries for command line help, but
documentation for texi and derived formats (man, html, info)
was missing.

This also required moving "@end table" to the end of
qemu-options.hx again.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopc: add driver version compat properties
Gerd Hoffmann [Thu, 14 Jan 2010 13:44:14 +0000 (14:44 +0100)]
pc: add driver version compat properties

This patch adds compat property entries for ide-disk.ver and
scsi-disk.ver to pc-0.10 and pc-0.11.  With this patch applied
the scsi and ide disks report "0.10" and "0.11" as version when
you start qemu with "-M pc-0.10" or "-M pc-0.11".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoscsi: device version property
Gerd Hoffmann [Thu, 14 Jan 2010 13:44:13 +0000 (14:44 +0100)]
scsi: device version property

This patch adds a new property named 'ver' to scsi-disk which allows to
specify the version which the virtual disk/cdrom should report to the
guest.  By default this is the qemu version (i.e. 0.12).  usage:

  -drive if=none,id=disk,file=...
  -device lsi
  -device scsi-disk,drive=disk,bus=scsi.0,unit=0,ver=42

You can also switch the version for all scsi drives using:

  -global scsi-disk.ver=42

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoide: device version property
Gerd Hoffmann [Thu, 14 Jan 2010 13:44:12 +0000 (14:44 +0100)]
ide: device version property

This patch adds a new property named 'ver' to ide-drive which allows to
specify the version which the virtual disk/cdrom should report to the
guest.  By default this is the qemu version (i.e. 0.12).  usage:

  -drive if=none,id=disk,file=...
  -device ide-drive,bus=ide.0,unit=0,drive=disk,ver=42

You can also switch the version for all ide drives using:

  -global ide-drive.ver=42

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Emit asynchronous events on all QMP monitors
Adam Litke [Fri, 15 Jan 2010 14:34:02 +0000 (08:34 -0600)]
QMP: Emit asynchronous events on all QMP monitors

When using a control/QMP monitor in tandem with a regular monitor, asynchronous
messages can get lost depending on the order of the QEMU program arguments.
QEMU events issued by monitor_protocol_event() always go to cur_mon.  If the
user monitor was specified on the command line first (or it has ,default), the
message will be directed to the user monitor (not the QMP monitor).
Additionally, only one QMP session is currently able to receive async messages.

To avoid this confusion, scan through the list of monitors and emit the message
on each QMP monitor.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix QEMU_WARN_UNUSED_RESULT
Kevin Wolf [Fri, 15 Jan 2010 11:56:41 +0000 (12:56 +0100)]
Fix QEMU_WARN_UNUSED_RESULT

Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it is
conditional on a define from config-host.h which is included only later.
Include that file earlier to get the warnings back.

Reactivating it unfortunately leads to some warnings about unused qdev_init
results. These calls are changed to qdev_init_nofail to avoid build failures.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Introduce VNC_INITIALIZED event
Luiz Capitulino [Thu, 14 Jan 2010 16:50:59 +0000 (14:50 -0200)]
QMP: Introduce VNC_INITIALIZED event

It's emitted when a VNC client session is activated by QEMU,
client's information such as port, IP and auth ID (if the
session is authenticated) are provided.

Event example:

{ "event": "VNC_INITIALIZED",
    "timestamp": {"seconds": 1263475302, "microseconds": 150772},
    "data": {
        "server": { "auth": "sasl", "family": "ipv4",
                    "service": "5901", "host": "0.0.0.0"},
        "client": { "family": "ipv4", "service": "46089",
                    "host": "127.0.0.1", "sasl_username": "lcapitulino" } } }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Introduce VNC_DISCONNECTED event
Luiz Capitulino [Thu, 14 Jan 2010 16:50:58 +0000 (14:50 -0200)]
QMP: Introduce VNC_DISCONNECTED event

It's emitted when a VNC client disconnects from QEMU, client's
information such as port and IP address are provided.

Event example:

{ "event": "VNC_DISCONNECTED",
    "timestamp": { "seconds": 1262976601, "microseconds": 975795 },
    "data": {
        "server": { "auth": "sasl", "family": "ipv4",
                    "service": "5901", "host": "0.0.0.0" },
        "client": { "family": "ipv4", "service": "58425",
                    "host": "127.0.0.1", "sasl_username": "foo" } } }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Introduce VNC_CONNECTED event
Luiz Capitulino [Thu, 14 Jan 2010 16:50:57 +0000 (14:50 -0200)]
QMP: Introduce VNC_CONNECTED event

It's emitted when a VNC client connects to QEMU, client's information
such as port and IP address are provided.

Note that this event is emitted right when the connection is
established. This means that it happens before authentication
procedure and session initialization.

Event example:

{ "event": "VNC_CONNECTED",
    "timestamp": { "seconds": 1262976601, "microseconds": 975795 },
    "data": {
        "server": { "auth": "sasl", "family": "ipv4",
                    "service": "5901", "host": "0.0.0.0" },
        "client": { "family": "ipv4", "service": "58425",
                    "host": "127.0.0.1" } } }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoVNC: Cache client info at connection time
Luiz Capitulino [Thu, 14 Jan 2010 16:50:56 +0000 (14:50 -0200)]
VNC: Cache client info at connection time

When a disconnection happens the client's socket on QEMU
side may become invalid, this way it won't be possible
to query it to get client information, which is going to
be needed by the future QMP VNC_DISCONNECTED event.

To always have this information available we query the
socket at connection time and cache the client info in
struct VncState.

Two function are introduced to perform this job.

vnc_client_cache_addr() is called right when the connection
is made, however the authentication information is not
available at that moment so vnc_client_cache_auth() is
called from protocol_client_init() to get auth info.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoVNC: Add 'family' key
Luiz Capitulino [Thu, 14 Jan 2010 16:50:55 +0000 (14:50 -0200)]
VNC: Add 'family' key

It contains the socket adress family name, like "ipv4" or
"ipv6".

This is useful for clients so that they can interpret the
'host' key reliably.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoVNC: Rename client's 'username' key
Luiz Capitulino [Thu, 14 Jan 2010 16:50:54 +0000 (14:50 -0200)]
VNC: Rename client's 'username' key

It's the SASL username, so it's better to call it 'sasl_username'
to be consistent.

Note that this change wouldn't be allowed if QMP were stable.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoVNC: Make 'auth' key mandatory
Luiz Capitulino [Thu, 14 Jan 2010 16:50:53 +0000 (14:50 -0200)]
VNC: Make 'auth' key mandatory

There is no reason to have it as optional and the code
in the server and client gets slightly simpler if the
key is mandatory.

While there also do some cleanup on how the server info is
collected.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoVNC: Use 'enabled' key instead of 'status'
Luiz Capitulino [Thu, 14 Jan 2010 16:50:52 +0000 (14:50 -0200)]
VNC: Use 'enabled' key instead of 'status'

Currently the 'status' key is a string whose value can be
"disabled" or "enabled", change it to the QMP's standard
'enabled' key, which is a bool.

Note that 'status' in being dropped and this wouldn't be
allowed if QMP were stable.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agochar: Remove redundant qemu_chr_generic_open() call.
Kusanagi Kouichi [Thu, 14 Jan 2010 15:46:24 +0000 (00:46 +0900)]
char: Remove redundant qemu_chr_generic_open() call.

qemu_chr_open_fd() calls qemu_chr_generic_open(),
so qemu_chr_open_tty() doesn't need to call it.

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoraw-posix: Detect legacy floppy via ioctl on linux
Cole Robinson [Thu, 14 Jan 2010 16:19:41 +0000 (11:19 -0500)]
raw-posix: Detect legacy floppy via ioctl on linux

Current legacy floppy detection is hardcoded based on source file
name. Make this smarter on linux by attempting a floppy specific
ioctl.

v2:
    Give ioctl check higher priority than filename check
    s/IDE/legacy/

v3:
    Actually initialize 'prio' variable
    Check for ioctl success rather than absence of specific failure

v4:
    Explicitly mention that change is linux specific.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoraw-posix: Detect CDROM via ioctl on linux
Cole Robinson [Thu, 14 Jan 2010 16:19:40 +0000 (11:19 -0500)]
raw-posix: Detect CDROM via ioctl on linux

Current CDROM detection is hardcoded based on source file name.
Make this smarter on linux by attempting a CDROM specific ioctl.

This makes '-cdrom /dev/sr0' succeed with no media present.

v2:
    Give ioctl check higher priority than filename check.

v3:
    Actually initialize 'prio' variable.
    Check for ioctl success rather than absence of specific failure.

v4:
    Explicitly mention that change is linux specific.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoavoid unreachable statement after break
Paolo Bonzini [Fri, 15 Jan 2010 08:41:01 +0000 (09:41 +0100)]
avoid unreachable statement after break

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoremove assertions
Paolo Bonzini [Fri, 15 Jan 2010 08:42:10 +0000 (09:42 +0100)]
remove assertions

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agochange while to if
Paolo Bonzini [Fri, 15 Jan 2010 08:42:09 +0000 (09:42 +0100)]
change while to if

The while loop will be executed exactly 0 or 1 times, depending on
env->exit_request.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoadd assertions about env->current_tb
Paolo Bonzini [Fri, 15 Jan 2010 08:42:08 +0000 (09:42 +0100)]
add assertions about env->current_tb

By virtue of the previous patch env->current_tb will always be NULL at
the top of cpu_exec's outermost for loop, and at the end of the innermost
while loop.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoclean up env->current_tb
Paolo Bonzini [Fri, 15 Jan 2010 08:42:07 +0000 (09:42 +0100)]
clean up env->current_tb

There are three paths from the innermost while loop of cpu_exec
to the top of the outermost for loop.  Two do not reset
env->current_tb.  Fix this.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agofix wrong indentation
Paolo Bonzini [Fri, 15 Jan 2010 07:56:36 +0000 (08:56 +0100)]
fix wrong indentation

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokill regs_to_env and env_to_regs
Paolo Bonzini [Fri, 15 Jan 2010 07:56:35 +0000 (08:56 +0100)]
kill regs_to_env and env_to_regs

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoremove dead code from target-i386/exec.h
Paolo Bonzini [Fri, 15 Jan 2010 07:56:34 +0000 (08:56 +0100)]
remove dead code from target-i386/exec.h

These are unused since edea5f0 (no need to define global registers in
cpu-exec.c, 2008-05-10).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agortl8139: fix clang reporting unused assignment of VLAN tagging data
Igor V. Kovalenko [Wed, 13 Jan 2010 22:53:25 +0000 (01:53 +0300)]
rtl8139: fix clang reporting unused assignment of VLAN tagging data

Currently we do not implement VLAN tagging for rtl8139(C+),
still data is read from ring buffer headers.

- augment unused assignment with TODO item
- cast txdw1 to void for now

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoeepro100: Fix multicast support
Stefan Weil [Sun, 20 Dec 2009 15:52:24 +0000 (16:52 +0100)]
eepro100: Fix multicast support

* Handling of multicast list was missing.
* Multicast all was missing.
* Promiscuous mode for multicast frames was wrong.

This patch is a step to synchronize my maintainer version
of eepro100.c (git://repo.or.cz/qemu/ar7.git) with the
version integrated in QEMU.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Restructure code (new function tx_command)
Stefan Weil [Sun, 20 Dec 2009 15:52:22 +0000 (16:52 +0100)]
eepro100: Restructure code (new function tx_command)

Handling of transmit commands is rather complex,
so about 80 lines of code were moved from function
action_command to the new function tx_command.

The two new values "tx" and "cb_address" in the
eepro100 status structure made this possible without
passing too many parameters.

In addition, the moved code was cleaned a little bit:
old comments marked with //~ were removed, C++ style
comments were replaced by C style comments, C++ like
variable declarations after code were reordered.

Simplified mode is still broken. Nor did I fix
endianess issues. Both problems will be fixed in
additional patches (which need this one).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoSparc32: Update OpenBIOS image to r666
Blue Swirl [Sun, 17 Jan 2010 20:36:13 +0000 (20:36 +0000)]
Sparc32: Update OpenBIOS image to r666

Fixes the boot problem introduced by r665 image in
694b9309462f07307d16f492961f01271f10c245.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc: improve CPU register dump
Blue Swirl [Sun, 17 Jan 2010 16:51:57 +0000 (16:51 +0000)]
Sparc: improve CPU register dump

Common:
 * Remove unnecessary 0x prefix
 * Print %y
 * Fix NZVC flag print order to match CPU bit order

Sparc64 specific:
 * Print registers without line wrapping
 * Print %f40-%f63
 * Pretty print CCR flags
 * Print %fsr and %fprs in full precision
 * More consistent formatting

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofix linux-user microblaze ELF_ARCH definition
Mike Frysinger [Sun, 17 Jan 2010 06:15:05 +0000 (01:15 -0500)]
fix linux-user microblaze ELF_ARCH definition

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoaudio: include more information into audio_bug's output
malc [Sat, 16 Jan 2010 23:03:30 +0000 (02:03 +0300)]
audio: include more information into audio_bug's output

Signed-off-by: malc <av1474@comtv.ru>
14 years agoRevert "sdlaudio: make it suck less"
malc [Sat, 16 Jan 2010 21:25:29 +0000 (00:25 +0300)]
Revert "sdlaudio: make it suck less"

This reverts commit 4839abe78fd466a3cf06faa7c362154afd5404f1.

The commit was badly broken, Gentoo has sdl as the default driver,
consequently 5 gentoo users have hit the breakage and were kind enough
to report, so thank you:

Claes Gyllenswrd
vekin
Chris

But above all thanks to Toralf Foerster who actually provied enough
information to pinpoint the breakage to sdlaudio.

http://bugs.gentoo.org/show_bug.cgi?id=294269

14 years agoSparc32: improve DMA controller IRQ debugging
Blue Swirl [Sat, 16 Jan 2010 09:06:35 +0000 (09:06 +0000)]
Sparc32: improve DMA controller IRQ debugging

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoESP: improve IRQ debugging
Blue Swirl [Sat, 16 Jan 2010 09:06:34 +0000 (09:06 +0000)]
ESP: improve IRQ debugging

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc32 do not clear interrupts when masking
Artyom Tarasenko [Sat, 16 Jan 2010 09:06:32 +0000 (09:06 +0000)]
sparc32 do not clear interrupts when masking

Don't clear interrupts on disabling, because
* Sun4M_SystemArchitecture_edited2.pdf doesn't describe
  that masking or un-masking IRQ shall clear pending ones.

* Field tests also show that SPARCstation-20 doesn't
  clear them.

* The patch makes Solaris 2.5.1/2.6 boot ~1500 times
  faster (~20 seconds instead of ~8 hours)

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUpdate Sparc OpenBIOS images to r665
Blue Swirl [Sat, 16 Jan 2010 09:05:21 +0000 (09:05 +0000)]
Update Sparc OpenBIOS images to r665

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc32 do_unassigned_access overhaul v2
Artyom Tarasenko [Fri, 15 Jan 2010 21:28:56 +0000 (22:28 +0100)]
sparc32 do_unassigned_access overhaul v2

According to pages 9-31 - 9-34 of "SuperSPARC & MultiCache Controller
User's Manual":

1. "A lower priority fault may not overwrite the
    MFSR status of a higher priority fault."
2. The MFAR is overwritten according to the policy defined for the MFSR
3. The overwrite bit is asserted if the fault status register (MFSR)
   has been written more than once by faults of the same class
4. SuperSPARC will never place instruction fault addresses in the MFAR.

Implementation of points 1-3 allows booting Solaris 2.6 and 2.5.1.

v2: CODING_STYLE fixes

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg/x86_64: Avoid unnecessary REX.B prefixes.
Richard Henderson [Thu, 14 Jan 2010 22:59:51 +0000 (14:59 -0800)]
tcg/x86_64: Avoid unnecessary REX.B prefixes.

The existing P_REXB internal opcode flag unconditionally emits
the REX prefix.  Technically it's not needed if the register in
question is %al, %bl, %cl, %dl.

Eliding the prefix requires splitting the P_REXB flag into two,
in order to indicate whether the byte register in question is
in the REG or the R/M field.  Within TCG, the byte register is
in the REG field only for stores.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agonand: Correct random data reads.
Edgar E. Iglesias [Tue, 12 Jan 2010 13:48:19 +0000 (14:48 +0100)]
nand: Correct random data reads.

Random reading depends on having the last row/page latched and not beeing
clobbered between read and any following random reads.

Also, s->iolen must be updated when loading the io/data register with
randomly accessed flash data.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoMakefile: Fix message for missing configure
Stefan Weil [Thu, 14 Jan 2010 17:11:43 +0000 (18:11 +0100)]
Makefile: Fix message for missing configure

When make is called without a valid configuration,
it should tell the user what to do.

Revision 0e8c9214ba1d4128cf92442cd343bc3733478261
was a regression which resulted in a message
which was no longer user friendly
(reported by Aurelien Jarno).

This patch restores the old behaviour.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Andreas Färber <afaerber@opensolaris.org>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-m68k: fix a typo in 'P' packet processing
Kazu Hirata [Thu, 14 Jan 2010 17:08:00 +0000 (09:08 -0800)]
target-m68k: fix a typo in 'P' packet processing

Attached is a patch to fix a typo in 'P' packet processing for M68K.

Without this patch, QEMU fails to honor GDB's P packets from GDB
(writing to registers) for the address registers (A0 - A7).

The problem is because of an obvious typo.  Notice that the second
"if" condition is meant to be n < 16 in:

  if (n < 8) {
    :
  } else if (n < 8) {

Signed-off-by: Kazu Hirata <kazu@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/x86_64: Special-case all 32-bit AND operands.
Richard Henderson [Wed, 6 Jan 2010 00:03:00 +0000 (16:03 -0800)]
tcg/x86_64: Special-case all 32-bit AND operands.

This avoids an unnecessary REX.W prefix when dealing with AND
operands that fit into a 32-bit quantity.  The most common change
actually seen is movz[wb]q -> movz[wb]l.

Similarly, avoid REXW in ext{8,16}u_i64 tcg opcodes.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agosh: sm501: Add hardware cursor feature
Shin-ichiro KAWASAKI [Fri, 1 Jan 2010 06:59:39 +0000 (15:59 +0900)]
sh: sm501: Add hardware cursor feature

This patch adds hardware cursor feature to SM501 graphics chip emulation,
to make the graphic console more useful for QEMU SH4 users.

Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha: fix stat64 issue
Vince Weaver [Tue, 29 Dec 2009 05:01:22 +0000 (00:01 -0500)]
alpha: fix stat64 issue

The stat64/fstat64 syscalls are broken for alpha linux-user.

This is because Alpha, even though it is native 64-bits, has a stat64
syscall that is different than regular stat.  This means that the
"TARGET_LONG_BITS==64" check in syscall.c isn't enough.  Below is
a patch that fixes things for me, although it might not be the cleanest
fix.

This issue keeps sixtrack and fma3d spec2k benchmarks from running.

Signed-off-by: Vince Weaver <vince@csl.cornell.edu>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoppc-40x: Correct ESR for zone protection faults.
Edgar E. Iglesias [Mon, 11 Jan 2010 14:32:47 +0000 (15:32 +0100)]
ppc-40x: Correct ESR for zone protection faults.

Raise the zone protection fault in ESR for TLB faults caused by
zone protection bits.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoppc-40x: Correct decoding of zone protection bits.
Edgar E. Iglesias [Mon, 11 Jan 2010 14:23:58 +0000 (15:23 +0100)]
ppc-40x: Correct decoding of zone protection bits.

The 40x MMU has 15 zones in the ZPR register.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoppc-40x: Correct check for Endian swapping TLB entries.
Edgar E. Iglesias [Mon, 11 Jan 2010 13:41:53 +0000 (14:41 +0100)]
ppc-40x: Correct check for Endian swapping TLB entries.

Bailout on 40x TLB entries with endianess swapping only if the entry
is valid.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoppc-40x: Get TLB attributes from TLBLO.
Edgar E. Iglesias [Mon, 11 Jan 2010 13:21:58 +0000 (14:21 +0100)]
ppc-40x: Get TLB attributes from TLBLO.

The ZSEL was incorrectly beeing decoded from TLBHI. Decode it from
TLBLO instead.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agodocs: New qdev-device-use.txt
Markus Armbruster [Thu, 17 Dec 2009 16:19:17 +0000 (17:19 +0100)]
docs: New qdev-device-use.txt

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQemu's internal TFTP server breaks lock-step-iness of TFTP
Milan Plzik [Thu, 7 Jan 2010 12:39:43 +0000 (13:39 +0100)]
Qemu's internal TFTP server breaks lock-step-iness of TFTP

According to RFC 1350 and RFC 2347, TFTP server should answer RRQ by
either OACK or DATA packet. Qemu's internal TFTP server answers RRQ with
additional options by sending both OACK and DATA packet, thus breaking
the "lock-step" feature of the protocol, and also confuses client.

  Proposed solution would be to, in case of OACK packet, wait for ACK
from client and just then start sending data. Attached patch implements
this.

Signed-off-by: Thomas Horsten <thomas@horsten.com>
Signed-off-by: Milan Plzik <milan.plzik@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd KVM paravirt cpuid leaf
Gleb Natapov [Wed, 13 Jan 2010 13:25:06 +0000 (15:25 +0200)]
Add KVM paravirt cpuid leaf

Initialize KVM paravirt cpuid leaf and allow user to control guest
visible PV features through -cpu flag.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-blk: remove dead variable in virtio_blk_handle_scsi
Christoph Hellwig [Wed, 13 Jan 2010 12:30:32 +0000 (13:30 +0100)]
virtio-blk: remove dead variable in virtio_blk_handle_scsi

As pointed out by clang size is only ever written to, but never actually
used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqcow/qcow2: implement bdrv_aio_flush
Kevin Wolf [Tue, 12 Jan 2010 12:49:43 +0000 (13:49 +0100)]
qcow/qcow2: implement bdrv_aio_flush

Now that we do not have to flush the backing device anymore implementing
the bdrv_aio_flush method for image formats is trivial.

[hch: forward ported to qemu mainline from a product tree]

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: flush backing_hd in the right place
Christoph Hellwig [Tue, 12 Jan 2010 12:49:23 +0000 (13:49 +0100)]
block: flush backing_hd in the right place

The backing device is only modified from bdrv_commit.  So instead of
flushing it every time bdrv_flush is called for the front-end device
only flush it after we're written data to it in bdrv_commit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agojson-parser: remove dead increment
Amit Shah [Wed, 13 Jan 2010 10:54:47 +0000 (16:24 +0530)]
json-parser: remove dead increment

clang-analyzer points out a redundant increment.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqcow2-refcount: remove dead assignment
Amit Shah [Wed, 13 Jan 2010 10:54:46 +0000 (16:24 +0530)]
qcow2-refcount: remove dead assignment

clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agohw/vga.c: remove dead assignment
Amit Shah [Wed, 13 Jan 2010 10:54:45 +0000 (16:24 +0530)]
hw/vga.c: remove dead assignment

clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agox86: translate.c: remove dead assignment
Amit Shah [Wed, 13 Jan 2010 10:54:44 +0000 (16:24 +0530)]
x86: translate.c: remove dead assignment

clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio: net: remove dead assignment
Amit Shah [Wed, 13 Jan 2010 10:54:43 +0000 (16:24 +0530)]
virtio: net: remove dead assignment

clang-analyzer points out value assigned to 'len' is not used.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovl.c: Remove dead assignment
Amit Shah [Wed, 13 Jan 2010 10:54:42 +0000 (16:24 +0530)]
vl.c: Remove dead assignment

clang-analyzer pointed out the value of 'sockets' is never reused.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoosdep.c: Fix accept4 fallback
Kevin Wolf [Wed, 13 Jan 2010 15:20:56 +0000 (16:20 +0100)]
osdep.c: Fix accept4 fallback

Commit 3a03bfa5 added a fallback in case the Linux kernel running qemu is older
than the kernel of the build system. Unfortunately, v1 was committed instead of
v2, so the code has a bug that was revealed in the review (checking for the
wrong error code).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqemu-img rebase
Kevin Wolf [Tue, 12 Jan 2010 11:55:18 +0000 (12:55 +0100)]
qemu-img rebase

This adds a rebase subcommand to qemu-img which allows to change the backing
file of an image.

In default mode, both the current and the new backing file need to exist, and
after the rebase, the COW image is guaranteed to have the same guest visible
content as before. To achieve this, old and new backing file are compared and,
if necessary, data is copied from the old backing file into the COW image.

With -u an unsafe mode is enabled that doesn't require the backing files to
exist. It merely changes the backing file reference in the COW image. This is
useful for renaming or moving the backing file. The user is responsible to make
sure that the new backing file has no changes compared to the old one, or
corruption may occur.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: Add bdrv_change_backing_file
Kevin Wolf [Tue, 12 Jan 2010 11:55:17 +0000 (12:55 +0100)]
block: Add bdrv_change_backing_file

Introduce the functions needed to change the backing file of an image. The
function is implemented for qcow2.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: Introduce BDRV_O_NO_BACKING
Kevin Wolf [Tue, 12 Jan 2010 11:55:16 +0000 (12:55 +0100)]
block: Introduce BDRV_O_NO_BACKING

If an image references a backing file that doesn't exist, qemu-img info fails
to open this image. Exactly in this case the info would be valuable, though:
the user might want to find out which file is missing.

This patch introduces a BDRV_O_NO_BACKING flag to ignore the backing file when
opening the image. qemu-img info is the first user and provides info now even
if the backing file is invalid.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomove kbd/mouse handling to input.c
Paolo Bonzini [Wed, 13 Jan 2010 13:05:34 +0000 (14:05 +0100)]
move kbd/mouse handling to input.c

Move 200 lines out of vl.c already into common code that only needs to
be compiled once.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agouse pkg-config for libcurl whenever available
Paolo Bonzini [Wed, 13 Jan 2010 08:52:56 +0000 (09:52 +0100)]
use pkg-config for libcurl whenever available

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agouse pkg-config for sdl whenever available
Paolo Bonzini [Wed, 13 Jan 2010 08:52:55 +0000 (09:52 +0100)]
use pkg-config for sdl whenever available

Together with the first patch this enables using the prefixed
pkg-config, thus picking up the correct flags for SDL.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agofixes to the static compilation case for sdl
Paolo Bonzini [Wed, 13 Jan 2010 08:52:54 +0000 (09:52 +0100)]
fixes to the static compilation case for sdl

After the next commit, pkg-config could be used for the shared library
configuration case and sdl-config for static libraries.  So I prepare
the test here by doing two changes:

at the same time I remove useless backslashes from the invocation of
grep;

1) fixing a typo ($sd_cflags).  The typo has been there since commit
1ac88f2 (remove sdl_static. Just do the right thing if static is yes,
2009-07-27).

2) fixing an erroneous "test `... | grep > /dev/null`" idiom that would
never succeed since grep's output would be empty;

3) checking the status code after executing sdl-config --static --libs;
this is needed for the next patch only.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agouse cross-prefix for pkgconfig
Paolo Bonzini [Wed, 13 Jan 2010 08:52:53 +0000 (09:52 +0100)]
use cross-prefix for pkgconfig

Since pkgconfig can give different output for different targets,
it should be tried with the cross-compilation prefix first.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopcnet: remove dead nested assignment, spotted by clang
Blue Swirl [Wed, 13 Jan 2010 18:59:54 +0000 (18:59 +0000)]
pcnet: remove dead nested assignment, spotted by clang

Although the value stored to 'addr' is used in the enclosing expression,
the value is never actually read from 'addr'.

Probably a typo.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: remove dead increment, spotted by clang
Blue Swirl [Wed, 13 Jan 2010 18:58:51 +0000 (18:58 +0000)]
Sparc32: remove dead increment, spotted by clang

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: remove a variable used only for debugging to avoid a clang warning
Blue Swirl [Wed, 13 Jan 2010 18:55:11 +0000 (18:55 +0000)]
Sparc32: remove a variable used only for debugging to avoid a clang warning

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc: comment out unused variable, spotted by clang
Blue Swirl [Wed, 13 Jan 2010 18:54:54 +0000 (18:54 +0000)]
Sparc: comment out unused variable, spotted by clang

The variable is_annulled is referenced in a FIXME comment, so instead
of removing the variable, comment out the lines so that the FIXME
can be understood.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: remove unused env/envs variables, spotted by clang
Blue Swirl [Wed, 13 Jan 2010 18:52:50 +0000 (18:52 +0000)]
Sparc32: remove unused env/envs variables, spotted by clang

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc32: remove unused variable, spotted by clang
Blue Swirl [Wed, 13 Jan 2010 18:49:40 +0000 (18:49 +0000)]
Sparc32: remove unused variable, spotted by clang

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopci: Add missing 'const' in argument to pci_get_xxx
Stefan Weil [Mon, 11 Jan 2010 20:20:13 +0000 (21:20 +0100)]
pci: Add missing 'const' in argument to pci_get_xxx

pci_get_byte, pci_get_word, pci_get_long and pci_get_quad
all take a const uint8_t pointer, because they only read
the configuration data.

Their prototypes should reflect this fact.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Update ROM file support
Stefan Weil [Thu, 7 Jan 2010 16:13:30 +0000 (17:13 +0100)]
eepro100: Update ROM file support

Use new way to associate ROM files to devices.

Currently, there is only a ROM file for i82559er
included in QEMU, so the patch does not add
.romfile for the other devices.

When flexible mode is fixed in eepro100, adding
more ROM files will be possible. It should be
possible to create them from pxe-i82559er.bin,
because etherboot uses the same driver for all
eepro100 devices (only PCI ids differ).

Maybe it is even possible to create a single
pxe-i8255x.bin which supports all eepro100 devices
(not supported with current etherboot).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Fix initial value for PCI_STATUS
Stefan Weil [Thu, 7 Jan 2010 11:15:25 +0000 (12:15 +0100)]
eepro100: Fix initial value for PCI_STATUS

The numerical value was wrong (0x2800 instead of 0x0280)
which indeed did not make sense.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoWorkaround for broken OSS_GETVERSION on FreeBSD, part two
Juergen Lock [Tue, 12 Jan 2010 22:48:04 +0000 (23:48 +0100)]
Workaround for broken OSS_GETVERSION on FreeBSD, part two

Turns out on those versions of FreeBSD (>= 7.x) that know OSS_GETVERSION
the ioctl doesn't actually work yet (except in the Linuxolator), so if
building on FreeBSD assume the sound drivers are new enough if the ioctl
returns the errno it does currently on FreeBSD.

(Rev 2 after private discussion with malc.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: malc <av1474@comtv.ru>
14 years agovirtio-net: mac property is mandatory
Michael S. Tsirkin [Tue, 12 Jan 2010 18:50:17 +0000 (20:50 +0200)]
virtio-net: mac property is mandatory

Mac feature bit isn't going to work as all network cards already have a
'mac' property to set the mac address.  Remove it from mask and add in
get_features.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokvm: Detect availability of kvm_para.h
Jan Kiszka [Tue, 12 Jan 2010 18:53:48 +0000 (19:53 +0100)]
kvm: Detect availability of kvm_para.h

Will be required for upcoming KVM cpuid leaf. Host kernels >= 2.6.32 as
well as future kvm-kmod releases (more recent than kvm-kmod-2.6.32.3)
do/will provide them.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokvm: Use kvm-kmod headers if available
Jan Kiszka [Tue, 12 Jan 2010 18:53:45 +0000 (19:53 +0100)]
kvm: Use kvm-kmod headers if available

Since kvm-kmod-2.6.32.2 we have an alternative source for recent KVM
kernel headers. Use it when available and not overruled by --kerneldir.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: fix dead assignment spotted by clang
Blue Swirl [Tue, 12 Jan 2010 20:27:43 +0000 (20:27 +0000)]
monitor: fix dead assignment spotted by clang

Value stored to 'nb_per_line' is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc64: Fix PCI config accessor order
Blue Swirl [Tue, 12 Jan 2010 20:04:53 +0000 (20:04 +0000)]
Sparc64: Fix PCI config accessor order

Fix by Igor Kovalenko.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg-sparc: Implement ext32[su]_i64
Richard Henderson [Tue, 12 Jan 2010 19:59:34 +0000 (19:59 +0000)]
tcg-sparc: Implement ext32[su]_i64

The 32-bit right-shift instructions is defined to extend the shifted
output to 64-bits.  A shift count of zero therefore is a simple
extension without actually shifting.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>