Commit Graph

3537 Commits (6164e6d6e86e8f3f0b5ff7ae08b677026cb291c3)

Author SHA1 Message Date
Blue Swirl a303f9e37b sh4: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 20:42:43 +00:00
Blue Swirl 9fad3eb7fa ppc: add missing 'break', spotted by clang analyzer
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 20:33:43 +00:00
Blue Swirl 05f92404cd ppc: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 20:32:49 +00:00
Blue Swirl f88fe4e370 alpha: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 20:30:17 +00:00
Blue Swirl 183aa45407 microblaze: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 20:00:33 +00:00
Blue Swirl 0d84be5bd0 cris: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 19:46:46 +00:00
Blue Swirl 22ed1d3478 arm: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 19:31:06 +00:00
Blue Swirl 7f5b7d3e2c x86: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:58:25 +00:00
Blue Swirl 9678d9501b Remove dead assignments in various common files, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:35:52 +00:00
Blue Swirl d4c4e6fdc7 usb: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:23:04 +00:00
Blue Swirl 7300c07991 bt: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:20:28 +00:00
Blue Swirl 4aa720f717 Fix harmless if statement with empty body, spotted by clang
This clang error is harmless but worth fixing:
  CC    libhw32/rc4030.o
/src/qemu/hw/rc4030.c:244:66: error: if statement has empty body [-Wempty-body]
        DPRINTF("read 0x%02x at " TARGET_FMT_plx "\n", val, addr);

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-23 19:22:12 +00:00
Bruce Rogers 3cc128bb1e Remove un-needed code
The bdrv_set_geometry_hint call below is not needed - it's just setting
what was just read.

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23 16:21:57 +02:00
Kevin Wolf d6e9098e10 Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
callers of the old function are converted to the new one. In some places they
even know the right format, so they should have used bdrv_open2 from the
beginning.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23 16:08:46 +02:00
Kevin Wolf 25920d6ad6 Make qemu-config available for tools
To be able to use config files for blkdebug, we need to make these functions
available in the tools. This involves moving two functions that can only be
built in the context of the emulator.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23 16:08:45 +02:00
Andrzej Zaborowski a6e4b14388 bt-sdp: Fix an excessive ; and assignment of the wrong variable
Problem-spotted-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
2010-04-22 03:55:46 +02:00
Blue Swirl 7b1df88f28 bt-l2cap: fix if statement with empty body, spotted by clang
Fix clang error:
  CC    bt-l2cap.o
/src/qemu/hw/bt-l2cap.c:1000:41: error: if statement has empty body
[-Wempty-body]
            /* TODO: Signal an error? */;

This means that l2cap_sframe_in() may now get called.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
2010-04-22 03:41:24 +02:00
Isaku Yamahata 470e63633f pci: fix pci_find_bus().
When looking down child bus, it should look parent bridge's
bus number, not child bus's.
Optimized tail recursion and style fix.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-20 17:15:41 +00:00
M. Mohan Kumar d6fa4b77fb Check for invalid initrd file
When qemu is invoked with an invalid initrd file, it crashes. Following
patch prints a error message and exits if an invalid initrd is
specified. Includes changes suggested by JV.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-19 00:07:10 +02:00
Kevin Wolf 908bb9497b virtio-blk: Fix use after free in error case
virtio_blk_req_complete frees the request, so we can't access it any more when
calling bdrv_mon_event. Use the pointer that was copied earlier.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:55:19 +02:00
Markus Armbruster e17ba87c52 error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:46:48 +02:00
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
Markus Armbruster 17a38eaa2f monitor: convert do_device_del() to QObject, QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:46:48 +02:00
Markus Armbruster cc601cb785 qdev: Convert qdev_unplug() to QError
Note: our device unplug methods don't need conversion work, because
they can't currently fail.

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 6ad6135dca Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing:
  CC    ppc-softmmu/usb-ohci.o
/src/qemu/hw/usb-ohci.c:1104:59: error: if statement has empty body [-Wempty-body]
                          ohci->ctrl_head, ohci->ctrl_cur);
/src/qemu/hw/usb-ohci.c:1371:57: error: if statement has empty body [-Wempty-body]
        DPRINTF("usb-ohci: port %d: SUSPEND\n", portnum);
  CC    sparc64-softmmu/translate.o
/src/qemu/target-sparc/translate.c:3173:37: error: if statement has empty body [-Wempty-body]
                                    ; // XXX

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 14:22:14 +00:00
Artyom Tarasenko 676d9b9b88 sparc32 use empty_slot for missing RAM v1
use empty_slot device for the RAM which is not installed

Models without ECC don't trap when missing ram is accessed.

v0->v1 compile only once and fix indentation

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 08:55:20 +00:00
Artyom Tarasenko da9fcfa544 create empty_slot device
The empty_slot device emulates known to a bus but not connected devices.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 08:55:12 +00:00
Blue Swirl 3c83eb4f17 Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing:
  CC    libhw64/fdc.o
/src/qemu/hw/fdc.c:998:74: error: if statement has empty body [-Wempty-body]
        FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);
  CC    libhw64/cuda.o
/src/qemu/hw/cuda.c:320:66: error: if statement has empty body [-Wempty-body]
        CUDA_DPRINTF("read: reg=0x%x val=%02x\n", (int)addr, val);

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 08:46:35 +00:00
Anthony Liguori bf3de7f16f Merge remote branch 'mst/for_anthony' into staging 2010-04-13 20:59:12 -05:00
Marcelo Tosatti 11078ae37f vhost.c: include <linux/vhost.h> last
So the userspace headers define KERNEL_STRICT_NAMES and there's no
conflict on type definition for older kernels.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-14 00:12:04 +02:00
Michael S. Tsirkin 5751995a20 vhost-net: disable mergeable buffers
vhost in current kernels doesn't support mergeable buffers.
Disable this feature if vhost is enabled, until such
support is implemented.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-13 23:59:49 +02:00
David L Stevens dc14a39781 vhost: fix features ack
vhost driver in qemu didn't ack features, and this happens
to work because we don't really require any features. However,
it's better not to rely on this. This patch passes features to
vhost as guest acks them.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-13 23:58:20 +02:00
Aurelien Jarno 5ba9e9522c sh_pci: fix memory and I/O access
Since commit 8da3ff1809 ("MMIO callback
interface changes"), the addresses passed to the I/O functions are an
offset to the start of the area. As a consequence, there is no need to
correct the address using the value of IOBR. This make possible the use
of the default MMIO functions. Moreover the addresses are now remaped
when the value if IOBR change.

The memory area corresponds to the devices behing the PCI bus, it should
not be mapped by the PCI controller. Remove the corresponding code.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-13 20:17:24 +02:00
Aurelien Jarno 612b2bd0ac r2d: always enable IDE and flash
IDE and flash are part of the R2D board, and can't be removed. Emulate
them even if there is no hard-drive plugged to the IDE or if the flash
content is empty.
2010-04-13 20:17:24 +02:00
Aurelien Jarno 73f190352d hw/r2d: add initrd support
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-11 19:20:32 +02:00
Marcelo Tosatti 15a2cb7b70 vhost.c: include <linux/vhost.h> last
So the userspace headers define KERNEL_STRICT_NAMES and there's no
conflict on type definition for older kernels.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 20:16:28 +03:00
Michael S. Tsirkin c6b35ac4c4 vhost-net: disable mergeable buffers
vhost in current kernels doesn't support mergeable buffers.
Disable this feature if vhost is enabled, until such
support is implemented.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 20:15:55 +03:00
David L Stevens af4c828e70 vhost: fix features ack
vhost driver in qemu didn't ack features, and this happens
to work because we don't really require any features. However,
it's better not to rely on this. This patch passes features to
vhost as guest acks them.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 20:15:48 +03:00
Michael S. Tsirkin 8bbd1ce236 eepro100: convert to new capability API
Using new pci_add_capability_at_offset makes
eepro100 code cleaner.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
2010-04-11 19:37:33 +03:00
Michael S. Tsirkin 1db5a3aad3 pci: add API to add capability at a known offset
Unlike virtio, device emulations need to add pci capabilities
at known offsets to match real hardware. Make this possible
by adding an appropriate API.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 19:37:28 +03:00
Aurelien Jarno 56839a19e8 hw/r2d: add flash memory
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-11 03:58:19 +02:00
Alexander Graf baf0b55a9e Implement virtio reset
The guest may issue a RESET command for virtio. So far we didn't bother
to implement it, but with my new bootloader we actually need it for Linux
to get back to a safe state.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 22:06:22 +02:00
Gerd Hoffmann 6ac08101f9 lsi: fix segfault in lsi_command_complete
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 21:52:01 +02:00
Paolo Bonzini 37b76cfd93 move targphys.h and hw/poison.h inclusion to cpu-common.h
With more files from outside the hw/ directory being placed into
libhw, avoid the need to include hw/hw.h for the sake of targ_phys_addr_t.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 18:55:55 +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
Adam Lackorzynski 0534163f5b Debugcon: Fix debugging printf
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:44:38 +02:00
Thomas Monjalon 98835fe30f e1000: fix build on Ubuntu with _FORTIFY_SOURCE
There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled.

_FORTIFY_SOURCE had been disabled by 4a24470497
and reenabled by 849583050d.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:32:31 +02:00
Lars Munch 14da561698 smc91c111: allow access to reserved register
Some drivers seems to access the reserved register in bank 0 so allow and
ignore these accesses.

Signed-off-by: Lars Munch <lars@segv.dk>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:24:34 +02:00
Lars Munch 3b4b86aace smc91c111: mask register offset
this fixes the smc91c111 emulation which has been broken for gumstix and
mainstone and maybe others since the "MMIO callback interface changes"
8da3ff1809 was commited.

Signed-off-by: Lars Munch <lars@segv.dk>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:22:43 +02:00
Samuel Thibault 2c7faf318d baum: add destroy hook
Add a destroy hook for the baum character device, to properly close the BrlAPI
connection.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:17:10 +02:00