Commit graph

11688 commits

Author SHA1 Message Date
Ryota Ozaki cb7cf0e3f4 qemu-nbd: Improve error reporting
- use err(3) instead of errx(3) if errno is available
  to report why failed
- let fail prior to daemon(3) if opening a nbd file
  is likely to fail after daemonizing to avoid silent
  failure exit
- add missing 'ret = 1' when unix_socket_outgoing failed

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-17 10:20:04 +02:00
Stefan Hajnoczi 3abbc4d981 block: Remove semicolon in BDRV_SECTOR_MASK macro
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-17 10:20:04 +02:00
Blue Swirl 21ffd18163 sparc: move DT and QT defines to op_helper.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-16 08:33:02 +00:00
Igor V. Kovalenko 88c8e03f5d sparc64: fix TT_WOTHER value
- fix off by one error in spill trap number bit for other window (must be bit 5)
- fixes invalid instruction issue with HelenOS

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-16 07:54:48 +00:00
Igor V. Kovalenko 170f4c550f sparc64: fix mmu demap operand typo
- must use store address operand to demap, not store value

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-16 07:54:33 +00:00
Blue Swirl 1012e960c7 Update to a hopefully more future proof FSF address
See also 70539e1850,
8167ee8839,
530e7615ce and
fad6cb1a56.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 17:52:49 +00:00
Blue Swirl 0b8f9be61c Trim unnecessary includes
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 17:36:13 +00:00
Isaku Yamahata ec51e364ed mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:42:39 +00:00
Isaku Yamahata 019ea97897 apm: remove #ifdef DEBUG.
remove #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:41:51 +00:00
Isaku Yamahata 50d8ff8b0d acpi_piix4: remove #ifdef DEBUG.
removed #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:41:05 +00:00
Isaku Yamahata b246eebb0a pm_smbus: remove #ifdef DEBUG.
remove #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:39:53 +00:00
Isaku Yamahata ac4040955b pci hotadd, acpi_piix4: remove global variables
remove global variables, gpe and pci0_status by moving them
into PIIX4PMState.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:28:56 +00:00
Isaku Yamahata 87c30546ef pci hotplug: add argument to pci hot plug callback.
Add argument, DeviceState*, to pci hot plug callback.
The argument will be used later to remove global variable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:26:32 +00:00
Isaku Yamahata e8ec0571e1 acpi_piix4: qdevfy.
qdevfy acpi_piix4.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:24:35 +00:00
Isaku Yamahata 1d914fa0af rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADevice
instead of RTCState.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:21:49 +00:00
Isaku Yamahata e1460e4707 pc: move rtc declarations from pc.h into a dedicated header file.
Move rtc_xxx declarations from pc.h into mc146818rtc.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 16:20:41 +00:00
Isaku Yamahata 845773ab03 pc: split out piix specific part from pc.c into pc_piix.c
Finally, we can safely split out the piix specific part from pc.c
into pc_piix.c.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:53:25 +00:00
Isaku Yamahata e3a5cf4250 pc: split out pci device init from pc_init1() into pc_pci_device_init()
Split out pci device initialization from pc_init1() into pc_pci_device_init().
and removed unnecessary braces.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:52:05 +00:00
Isaku Yamahata ffe513da92 pc: split out basic device init from pc_init1() into pc_basic_device_init()
Split out basic device, i.e. legacy devices like floppy, initialization
from pc_init1() into pc_basic_device_init().
Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:51:29 +00:00
Isaku Yamahata 765d79084b pc: split out vga initialization from pc_init1() into pc_vga_init().
Split out vga initialization which is independent of piix
from pc_init1() as pc_vga_init().
Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:50:24 +00:00
Isaku Yamahata 3d53f5c36f pc: split out memory allocation from pc_init1() into pc_memory_init()
Split out memory allocation and rom/bios loading which doesn't depend
on piix from pc_init1() into pc_memory_init().
Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:47:30 +00:00
Isaku Yamahata 7016647726 pc: split out cpu initialization from pc_init1() into pc_cpus_init().
split out cpu initialization which is piix independent from pc_init1()
into pc_cpus_init(). Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:45:17 +00:00
Isaku Yamahata 8e78eb28c6 pc: make pc_init1() not refer ferr_irq directly.
By introducing a registering function, make pc_init1() not refer to
ferr_irq directly in order to make ferr_irq piix independent.
Later pc_init1() will be split out into another file keeping ferr_irq
static.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:42:48 +00:00
Isaku Yamahata 6f09e686f8 pc: introduce a function to allocate cpu irq.
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irq
in order to make pic_irq_request() piix independent.
Later piix code will be split out to another file keeping pic_irq_request()
static.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:41:50 +00:00
Isaku Yamahata ec2654fb29 pc: remove global variable rtc_state by using qemu_irq.
Remove the reference to the global variable, rtc_state, by passing
function argument to cmos_init_hd(), cmos_init().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Paolo Bonzini <bonzini@gnu.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:40:34 +00:00
Isaku Yamahata 01b9e8c10e pc: remove a global variable, floppy_controller.
Remove a global variable, floppy_controller.
Since it is unnecessarily global, make it local and pass it as
a function argument.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:38:58 +00:00
Isaku Yamahata 57864959a4 pc: make an unnecessary global variable, pit, local.
remove unnecessary global static variables, pit.
Make it local.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:37:37 +00:00
Isaku Yamahata f885f1eaa8 pc, i440fx: Make smm enable/disable function i440fx independent.
make cpu_smm_update() generic to be independent on i440fx by
registering a callback.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:33:08 +00:00
Isaku Yamahata b8d6f53986 pc: initialize ioapic before use.
The changeset of 2c8d934020
prevents isa_irq_handler() from NULL refering of IsaIrqState::ioapic.
However it would be better to initialize the member before reference.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:32:28 +00:00
Isaku Yamahata 93d89f63e5 acpi: split acpi.c into the common part and the piix4 part.
Split acpi.c into the common part and the piix4 specific part.
The common part will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:30:49 +00:00
Isaku Yamahata 990b150e7c acpi: add acpi constants from linux header files and use them.
add acpi constants from linux header files and
replace the old constants with them.
The acpi constants will be used by other file.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:29:27 +00:00
Isaku Yamahata 04762841d8 acpi: split out apm register emulation from acpi.c
Split out apm register emulation for acpi.c into apm.c.
The apm emulation will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:27:19 +00:00
Isaku Yamahata fc0bdd995c acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c
Split out piix4 smbus routines from acpi.c into pm_smbus.c and
use it.
The split out smbus emulation will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 15:25:31 +00:00
Jan Kiszka dc6839100e mc146818rtc: Register vmstate via qdev
After defining the required alias ID, we can push vmstate registration
of mc146818rtc to qdev.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:34:41 +00:00
Jan Kiszka a64405d1b5 fdc: Register vmstate via qdev
Establish vmstate containers for ISA and sysbus variant, define the
iobase as instance ID alias, and let qdev do the vmstate registration
work.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:33:48 +00:00
Jan Kiszka 1cc9f51439 serial: Register vmstate via qdev
At least for isa-serial, we can already let qdev do the vmstate
registration for us. It just takes wrapping vmstate for the
encapsulating ISASerialState and defining the proper instance ID
aliases.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:32:51 +00:00
Jan Kiszka 4d2ffa08b6 vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manage
instance IDs on their own, and that unfortunately in a way that is
incompatible with automatically generated ones. This so far prevents
switching those users to vmstates that are registered by qdev.

To establish a migration path, this patch introduces the concept of
alias IDs. They can be passed to an extended vmstate registration
service, and qdev provides a set service to be used during device init.
find_se will consider the alias in addition to the default ID. We can
then start generating the default ID automatically and writing it on
vmsave, thus converting that format without breaking support for upward
migration.

The user is required specify the highest vmstate version for which the
alias is required. Once this version falls behind the minimum required
for a specific vmstate, an assertion triggers to motivate cleaning up
the obsolete alias.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:23:31 +00:00
Jan Kiszka ec86f3e1af vmstate: Drop unused post_save handler
No device makes use of it anymore.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:02:39 +00:00
Shin-ichiro KAWASAKI 604be20023 sh: sm501: add 2D engine support
In linux kernel v2.6.33, sm501 frame buffer driver modified to support
2D graphics engine on sm501 chip.  One example is "fill rectangle" operation.
But current qemu's sm501 emulation doesn't support it.  This results in
graphics console disturbance.

This patch introduces sm501 2D graphics engine emulation and solve this problem.

    Add SM501 2D hardware engine support.

     - Add 2D engine register set read/write handlers.
     - Support 'fill rectangle'. Other operations are left for future work.
     - Update SM501 support status comment.

Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 13:57:22 +00:00
Andrzej Zaborowski e5d3b98d53 tmp105: update the register in post_load where it needs updating.
This was the only user of .post_save as noticed by Jan Kiszka and
seems to have been added there wrongly during conversion to
VMStateDescription.

Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2010-05-15 14:31:27 +02:00
Blue Swirl 26a823305d cpus: add one 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:21 +00:00
Blue Swirl af2960f942 e1000: make some tables 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:18 +00:00
Blue Swirl 117e1e8244 ide: make a table 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:14 +00:00
Blue Swirl 68f04a3c62 vga: make some tables 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:11 +00:00
Blue Swirl d08555c17a Compile virtio-9p-debug and virtio-9p-local once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:31:53 +00:00
Anthony Liguori 7ac9f9be20 Merge remote branch 'qemu-kvm/uq/master' into staging 2010-05-14 10:56:56 -05:00
Anthony Liguori 14ac15d3ac Update SeaBIOS
- 7d09d0e Fix virtio compile errors on various gcc versions.
 - 89acfa3 Support for booting from virtio disks
 - 6d66316 smbios: avoid counting io hole as ram
 - e5cd945 Fix error causing USB HID "boot" protocol to not be enabled.
 - 0e88576 Add support for USB mice.
 - dd5a8a6 When USB keyboard active, don't send keyboard commands to ps2 port.
 - 5718d56 Document usb-hid.c functions.
 - e438b0c Further parallelize init when using CONFIG_THREAD_OPTIONROMS.
 - f59b5ac Handle unknown function addresses in tools/checkstack.py.
 - 9ba1dea Simplify build by manually resolving external symbols in layoutrom.py.
 - 698d3f9 USB EHCI should yield() whil waiting for controller to ack reset.
 - f9a774c Add __attribute__((__malloc__)) declaration to internal malloc funcs.
 - b7045ce Minor - remove redundant check from ata_try_dma.
 - 67f6d37 Fix possible unitialized variable issue in usb msc.
 - a7eb8fc Some improvements to optionrom preemption support.
 - d28b0fe Refactor USB hub code.
 - ba28541 Prep version for next release.
 - 12bffd5 Update version to 0.6.0.
 - 87ab2fb Improve USB EHCI timing.
 - d705e5a Disable inlining on old compilers.
 - bca0736 Force use of indirect function calls in inline assembler.
 - d7eb27e Don't move EBDA while an optionrom is running (CONFIG_THREAD_OPTIONROMS).
 - 7415270 Call to int1552 (from int1346) should set regs->dl.
 - 9dc243e Adjust debug levels of device discovery.
 - d9c9361 Default CONFIG_COREBOOT_FLASH on; make depend on CONFIG_COREBOOT.
 - c35e1e5 Restore segment limits in handle_1589 code.
 - 11cc662 Extend time for rtc to be ready.
 - 4ed378a Backup and restore registers when calling out to user funcs.
 - 68c5139 Enable irqs in kbd/clock calls that caller might "spin" on.
 - f628244 Process event on ps2 keyboard irq even if event already read.
 - a5d8458 Revert "Unify ps2 port data processing."
 - b9ed5e2 Handle variable length return of ps2 port GETID command.
 - 67a9eec Prevent ps2 irqs from messing up ps2 init.
 - 6704cf9 Revert "Rework disabling of ps2 port irqs."
 - 808939c Fix smp cpu detect on gcc 4.5.
 - a979c1c Improvements to tools/checkstack.py.
 - 190cc62 Add USB EHCI controller support.
 - 0770d67 Some USB UHCI and OHCI fixes and cleanups.
 - bfe7ca7 Minor - USB OHCI interrupt queue should be one larger.
 - 09e2f7c Reduce size of USB 'struct uhci_td'.
 - 406fad6 Dynamically allocate USB controller structures.
 - 4547eb9 Replace USB encoded 'u32 endp' scheme with explicit struct fields.
 - 8ebcac0 Further parallelize USB init by launching a thread per usb port.
 - e908665 Introduce simple "mutex" locking code.
 - 3b79f8b Only compile usb-hub.c and paravirt.c with 32bit code.
 - 357bdfa Prefer passing a USB "pipe" structure over a USB endp encoding.
 - 7fb8ba8 Add a generic "internal error" warning function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-14 10:55:58 -05:00
Blue Swirl 5acd0646b6 pckbd: don't use any static state
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 19:27:23 +00:00
Blue Swirl 9c0afd0e1d apb: don't use any static state
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 19:27:23 +00:00
Stefan Weil 113c61069c target-sparc: Fix wrong printf argument
cpu_get_ccr() returns a target_ulong, so a type cast is needed to avoid
wrong output on big endian hosts. We could also use TARGET_FMT_lx,
but that would print 8 instead of 2 digits.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 19:20:11 +00:00