Commit Graph

2630 Commits

Author SHA1 Message Date
malc 435c247a9f gus: Do not manually free the state, qdev does it for us
Signed-off-by: malc <av1474@comtv.ru>
2009-09-12 02:50:58 +04:00
Juan Quintela 7e72abc382 vmstate: port cirrus_vga device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:09 -05:00
Juan Quintela 747791f11a vmstate: port serial device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:09 -05:00
Juan Quintela e6cb4d4589 vmstate: port hpet device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:09 -05:00
Juan Quintela 67f0875ebc hpet: it is imposible that qemu_timer field is NULL at this point
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:08 -05:00
Juan Quintela 3e9e98889b vmstate: port ioapic device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:08 -05:00
Juan Quintela 80a04bbe90 vmstate: add uint64 array support
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:08 -05:00
Juan Quintela 3c619b5975 vmstate: port pckbd device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:08 -05:00
Juan Quintela bcb58d9ac9 vmstate: port vmmouse device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:08 -05:00
Juan Quintela 7b5045c555 vmstate: port dma device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:07 -05:00
Juan Quintela 632cf0730c vmstate: add support for arrays of uint16_t
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:06 -05:00
Juan Quintela d7a6c27035 vmstate: port fdc device
We can't move fifo back to an embeded array because it needs to be aligned

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:06 -05:00
Juan Quintela 80cd83e7b2 vmstate: add support for uint8_t equal
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:06 -05:00
Juan Quintela 77eea83830 vmstate: port i8259 device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:06 -05:00
Juan Quintela 7d2edd40fb vmstate: port fw_cfg device
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:06 -05:00
Juan Quintela 8fb0791d30 vmstate: Add pre/post_save() hooks
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:05 -05:00
Juan Quintela fd4d52deab vmstate: Add pre_load() hook
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:05 -05:00
Juan Quintela 752ff2fa31 vmstate: rename run_after_load() -> post_load()
This naming was used in kvm tree, and is easier to remember

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:05 -05:00
Juan Quintela 1eb7538b77 vmstate: add sensible arguments to vmstate_unregister()
vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd).

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 11:10:05 -05:00
Juan Quintela 6ee093c907 Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:52 -05:00
Gerd Hoffmann 06113719be qdev: add parser for chardev properties
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:49 -05:00
Gerd Hoffmann dc1c21e60c convert braille chardev to QemuOpts.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:48 -05:00
Gerd Hoffmann f0457e8d88 convert msmouse chardev to QemuOpts.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:48 -05:00
Markus Armbruster d03f09ccde qdev: Fix i6300 upcast
Use DO_UPCAST() instead of container_of() to go from PCIDevice to
I6300State.  This ensures that PCIDevice is the first member of struct
I6300State.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:47 -05:00
Yan Vugenfirer ed757e140c VirtIO: Fix QEMU crash during Windows PNP tests
Hello,

In some cases bus driver can deassert "bus master" bit in PCI command
register. The driver will no longer be able to update related registers in
the device. Eventually it will cause QEMU to exit in "virtqueue_num_heads"
function.

Attached path that fixes the described issue.

Best regards,
Yan Vugenfirer.

>From 3fdafbdfad676ec8479dc073cff70bf356868bfe Mon Sep 17 00:00:00 2001
From: Yan Vugenfirer <yvugenfi@redhat.com>
Date: Tue, 8 Sep 2009 10:08:14 -0400
Subject: [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:47 -05:00
Christoph Hellwig aa659be3dc virtio-blk: add volatile writecache feature
Add a new VIRTIO_BLK_F_WCACHE feature to virtio-blk to indicate that we have
a volatile write cache that needs controlled flushing.  Implement a
VIRTIO_BLK_T_FLUSH operation to flush it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:46 -05:00
Christoph Hellwig b0484ae464 ide: use bdrv_aio_flush
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:46 -05:00
Christoph Hellwig e900a7b748 block: add enable_write_cache flag
Add a enable_write_cache flag in the block driver state, and use it to
decide if we claim to have a volatile write cache that needs controlled
flushing from the guest.  The flag is off if cache=writethrough is
defined because O_DSYNC guarantees that every write goes to stable
storage, and it is on for cache=none and cache=writeback.

Both scsi-disk and ide now use the new flage, changing from their
defaults of always off (ide) or always on (scsi-disk).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:46 -05:00
Michael S. Tsirkin b8193adbda qemu: init all queues to NO_VECTOR value
initialize vectors for all vqs to VIRTIO_NO_VECTOR rather than 0 which
is a valid vector. This fixes migration which happened before driver
was loaded.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Amit Shah <amit.shah@redhat.com>
Tested-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:46 -05:00
Michael S. Tsirkin 711bf3d954 qemu: make virtio-blk PCI compliant by default
commit bf011293fa made virtio-blk-pci not
PCI-compliant, since it makes region 0 (which is an i/o region)
size > 256, and, since PCI 2.1, i/o regions are limited to 256 bytes size.

When the ATA serial number feature is off, which is the default,
make the device spec compliant again, by making region 0 smaller.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Tested-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:19:46 -05:00
Kevin Wolf 91553dcc9e virtio-blk: Use bdrv_aio_multiwrite
It is quite common for virtio-blk to submit more than one write request in a
row to the qemu block layer. Use bdrv_aio_multiwrite to allow block drivers to
optimize its handling of the requests.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:18:06 -05:00
Anthony Liguori 1c3173b9ed Revert "don't call cpu_sychronize_state from reset handlers"
This reverts commit 733318ea9c.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11 10:18:06 -05:00
malc 31226166bb Fix formatting 2009-09-10 19:59:50 +04:00
malc a5e8e46bfb Fix formatting, get rid of conf and fix description 2009-09-10 19:59:41 +04:00
malc 41875be5b4 Fix formatting and and description field 2009-09-10 19:59:00 +04:00
Gerd Hoffmann 32e0c8260d qdev/isa: convert real time clock
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:48:01 +04:00
Gerd Hoffmann 11d23c352d qdev/isa: finish pckbd conversion
drop old init path and switch remaining users to
isa_create_simple().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:48:01 +04:00
Gerd Hoffmann 9453c5bc26 qdev/isa: convert ne2000
Also split the isa bits into a separate source file, so we don't drag in
a dependency for isa-bus.o for machines which want ne2k_pci only.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:48:01 +04:00
Gerd Hoffmann 9df34396d5 qdev/isa: convert gravis ultrasound
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:48:00 +04:00
Gerd Hoffmann f8ba784657 qdev/isa: convert cs4231a sound card
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:48:00 +04:00
Gerd Hoffmann f7b4f61f63 qdev/isa: convert soundblaster
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:48:00 +04:00
Gerd Hoffmann 924f6d72d3 qdev: add isa_create() function
Like isa_create_simple, but doesn't call qdev_init, so one can set
properties after creating and before initializing the device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:59 +04:00
Gerd Hoffmann 787aa97a3e qdev: tag isabus-bridge as no-user
isabus-bridge isn't supposed to be added via -device ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:59 +04:00
Gerd Hoffmann 2e15e23b8a qdev: simplify isa irq assignments
isa-bus owns the isa irqs now, so it can hand them out directly.
There is no need for the separate isa_connect_irqs step, drop it.

Also hard-code isa interrupts which can't be configured anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:59 +04:00
Gerd Hoffmann 86c8615784 qdev: drop iobase properties from isa bus
Lot of ISA devices work at fixed addresses, so having iobase
as bus property doesn't make much sense.  Devices which can
have different iobases will get a device property.

Also simply hard-code stuff which can't be configured anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:58 +04:00
Gerd Hoffmann 316940b062 qdev: add property type for 32bit signed integers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:58 +04:00
Gerd Hoffmann 679a37afc4 isapc: pick a more sane default cpu for such old hardware.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:58 +04:00
Gerd Hoffmann 2c8d934020 isapc: Fix irq routing
Only send irqs to ioapic in case we have one.
Fixes qemu segfault.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10 19:47:57 +04:00
Juan Quintela 13f5545daa Fix VMSTATE_PCI_DEVICE version
PCI device entries have to have a default version, not 2, because they are
used in the midle of other structures that can have _any_ version number.

We can't use proper versioning here until we have SubSections support.
Why we didn't noticed before?  Because in a PC, the only device ported with
a version less that 2 is piix_pm, and for that one, default pci values are
right.  If you use a virtio-console, you will see that its state it is not
loaded back.

Thanks to Amit Shah for reporting the problem and help debug the fix.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 18:20:58 -05:00
Glauber Costa 733318ea9c don't call cpu_sychronize_state from reset handlers
Doing this will make the vcpu ioctl be issued from the I/O thread, instead
of cpu thread. The correct behaviour is to call it from within the cpu thread,
as soon as we are ready to go.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 17:31:27 -05:00
Bernhard Kauer 98815437f7 RTC polling mode broken
The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.

The original MC146818A datasheet from 1984 notes:
        "flag bits in Register C [...] are set independent of the
        state of the corresponding enable bits in Register B"
Similar sections can be found in newer documentation e.g. in rtc82885.

Qemu and Bochs set the IRQ flags only if they are enabled,
which breaks drivers polling on them.

The following patch corrects this for the update-ended-flag in Qemu only.
It does not fix the handling of the other flags.

Signed-off-by: Bernhard Kauer <kauer@tudos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 17:31:27 -05:00
Naphtali Sprei 0859df68df Fix for commit 3f9cb1c14d
Here's a patch to fix the issue introduced by me, as Reimar Döffinger pointed out,

Reimar Döffinger wrote:
> On Thu, Aug 13, 2009 at 03:01:20PM +0300, Naphtali Sprei wrote:
>> Bug fix for segfault when run as i82551 HW:
>> Use Extended TBD only when HW supports it (i82558 and up).
>>
>> Added assertions to guard from such buffer overflow
>> Introduce the MAX_TCB_BYTE_COUNT macro
>> Allocate buf big enough as HW needs (MAX_ETH_FRAME_SIZE -> MAX_TCB_BYTE_COUNT)
>>
>>
>> I don't feel 100% OK with the "s->device >= i82558B" condition
>> since it relies on the numeric (hex) value of those defines, which currently
>> is correct, but changes (which I don't forsee now) might break it.
>
> It seems this was applied. Unfortunately this breaks things on FreeBSD.
> There seem to be multiple issues.
> First, the intel document says the 82551, 82550, 82559 models are all
> supersets of the 82558. Or in other words: they all support this
> feature.
> Only the 82557 does not.
> But then even for that the FreeBSD driver will fail.
> The reason for that is this line:
>     eeprom_contents[0xa] = 0x4000;
> the value here must be 0x01000 for all 82557 models it seems.

 Correct the logic of determining devices that supports
 extended TxCB: only the 82557 do not support it.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:21 -05:00
Stefan Weil d6fd1e6603 eepro100: Clean code which sets the PCI device id
* Use function pci_config_set_device_id
* Use new macro PCI_DEVICE_ID_INTEL_82557

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:21 -05:00
Gerd Hoffmann 20bb82770e qdev: convert tcx to reset + vmsd
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:20 -05:00
Gerd Hoffmann 391a079edb qdev: integrate vmstate
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:20 -05:00
Gerd Hoffmann f82de8f08a qdev: convert rtl8139 to reset
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:20 -05:00
Gerd Hoffmann 959f733a29 qdev: integrate reset
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:20 -05:00
Gerd Hoffmann 7fc2f2c086 qdev/scsi+usb: convert usb-storage to qdev.
Full coverage with properties and everything.  You can add virtual usb
sticks this way now:

  -drive if=none,id=pendrive,path=/some/where
  -device usb-storage,drive=pendrive

-usbdevice disk:/path/to/image continues to work.

Other side effects:
usb storage is listed in 'info block' now.
kvm tree should be able to boot from usb via extboot (untested though).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:19 -05:00
Gerd Hoffmann d52affa7f6 qdev/scsi: add scsi bus support to qdev, convert drivers.
* Add SCSIBus.
 * Add SCSIDeviceInfo, move device callbacks here.
 * add qdev/scsi helper functions.
 * convert drivers.

Adding scsi disks via -device works now, i.e. you can do:

 -drive id=sda,if=none,...
 -device lsi
 -device scsi-disk,drive=sda

legacy command lines (-drive if=scsi,...) continue to work.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:19 -05:00
Gerd Hoffmann 5b19d9a247 qdev/usb: convert ohci.
Drop num_ports argument for usb_ohci_init_pci(), everybody
calls it with num_ports == 3, so it is pointless.

Convert ohci pci device into qdev.
TODO: convert non-pci ohci adapters.

You can add a OHCI USB Controller to your virtual pc now using
'-device pci-ohci'.  Specifying a id is a good idea, so you can
attach usb devices to it, like this:

  -device pci-ohci,id=ohci
  -device usb-mouse,bus=ohci.0

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:18 -05:00
Gerd Hoffmann 6cf9b6f17a qdev/usb: convert uhci.
Hookup pci device into qdev.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:18 -05:00
Gerd Hoffmann 274945b633 qdev/usb: add some convinience aliases.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:18 -05:00
Gerd Hoffmann a5d2f7273c qdev/usb: make qemu aware of usb busses.
Move usb code from vl.c to usb-bus.c and make it use the new data
structures added by qdev conversion.  qemu usb core should be able
to handle multiple USB busses just fine now (untested though).

Kill some usb_*_init() legacy functions, use usb_create_simple()
instead.

Kill some FIXMEs added by the first qdev/usb patch.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:17 -05:00
Gerd Hoffmann 806b602482 qdev/usb: add usb bus support to qdev, convert drivers.
* Add USBBus.
 * Add USBDeviceInfo, move device callbacks here.
 * Add usb-qdev helper functions.
 * Switch drivers to qdev.

TODO:
 * make the rest of qemu aware of usb busses and kill the FIXMEs
   added by this patch.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:17 -05:00
Gerd Hoffmann 7557008854 qdev: add error message to qdev_device_add().
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:17 -05:00
Juan Quintela 93ec8b321c cirrus_vga: CIRRUS_HOOK_* is not used anymore
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:16 -05:00
Juan Quintela 4ec1ce048e cirrus_vga: rename cirrus_hook_write_cr() cirrus_vga_write_cr()
Simplify the logic to do everything inside the function.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:16 -05:00
Juan Quintela b863d51490 cirrus_vga: rename cirrus_hook_read_cr() cirrus_vga_read_cr()
Simplify the logic to do everything inside the function.  Return 0xff if index is out of range independetly of DEBUG_CIRRUS

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:16 -05:00
Juan Quintela 22286bc646 cirrus_vga: rename cirrus_hook_write_gr() cirrus_vga_write_gr()
Simplify the logic to do everything inside the function.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:15 -05:00
Juan Quintela f705db9df0 cirrus_vga: rename cirrus_hook_read_gr() cirrus_vga_read_gr()
Simplify the logic to do everything inside the function.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:15 -05:00
Juan Quintela 86948bb104 cirrus_vga: rename cirrus_hook_write_palette() cirrus_vga_write_palette()
Simplify the logic to do everything inside the function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:15 -05:00
Juan Quintela 5deaeee32f cirrus_vga: rename cirrus_hook_read_palette() cirrus_vga_read_palette()
Simplify the logic to do everything inside the function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:15 -05:00
Juan Quintela 31c63201c9 cirrus_vga: rename cirrus_hook_write_sr() cirrus_vga_write_sr()
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:15 -05:00
Juan Quintela 8a82c322ce cirrus_vga: rename cirrus_hook_read_sr() cirrus_vga_read_sr()
And make it a real function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:14 -05:00
Juan Quintela cedd91d20f vga: Rename last VGAState occurrences to VGACommonState
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:14 -05:00
Juan Quintela a46007a021 vga and cirrus_vga: substitute switch for equivalent assigntment
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:14 -05:00
Juan Quintela 957c9db562 cirrus_vga: make cirrus_read_hidden_dac() return its result
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:14 -05:00
Juan Quintela e9b43ea36a vga: change tabs to spaces
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:14 -05:00
Juan Quintela b634307306 cirrus_vga: Add a VGACommonState local var to cirrus_vga_ioport_{read, write}
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:13 -05:00
Juan Quintela 25a18cbd27 vga and cirrus_vga: create vga_ioport_invalid() and use it everywhere
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:13 -05:00
Juan Quintela 79b97bf2e7 vga: split vga-isa-mm.o
It is only used in mips softmmu, compile only there.
it_shift field was only used for vga_isa_mm, move it from VGACommonState
to ISAVGAMMstate.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:11 -05:00
Juan Quintela f97e36b9d6 vga: export vga_mem_{read,write}
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:11 -05:00
Juan Quintela 76323919df vga: split isa bits inco vga-isa.c
Adjust all the VGAState in VGACommonState
Compile vga-isa.o in the targets that use it

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:11 -05:00
Juan Quintela 47d37dd9c8 vga: split pci bits into vga-pci.c
Adjust all the VGAState in VGACommonState
Compile vga-pci.o only for targets that use it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:11 -05:00
Juan Quintela 0d65ddc384 vga: split vga_{load, save} into pci and common parts
Once there adjust VGAState <-> VGACommonState
Export vga_common_save/vga_common_load (nreeded by wmvare_vga
Remove vga.pci_dev field, it is not needed anymore

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:11 -05:00
Juan Quintela 43bf782b1a vga: export vga_ioport_{read,write}
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:10 -05:00
Juan Quintela 0ceac75b8c cirrus_vga: prefix vga_ioport_{read, write} with cirrus
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:10 -05:00
Juan Quintela 1a5ab75712 vga: remove useless cast from void *
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:10 -05:00
Blue Swirl 1e43a8e4d2 Sparc64: use ISA bus for i8042
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-06 16:34:18 +00:00
Blue Swirl 5bc89ef61b Sparc64: remove unused variables
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-06 16:32:34 +00:00
Blue Swirl 82663ee220 Fix indentation
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-06 16:31:58 +00:00
Artyom Tarasenko f2818f2201 esp: handle "select without attention"
Up to now "select without attention" was handled the same way as
"select with attention". According to

http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt

select without ATN sends the CDB (Command Descriptor Block) directly,
whereas select with ATN sends one message phase byte
followed by 6, 10, or 12 command phase bytes.

The attached patch implements the behaviour described above.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
[blauwirbel@gmail.com: cleaned up formatting]
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-05 06:24:47 +00:00
Stefan Weil ae027ad3c5 mips malta: Fix fdc regression and use qdev for i8042 setup
8baf73adf6 (qdev/isa: convert fdc)
breaks MIPS Malta:

Tried to create isa device isa-fdc with no isa bus present

Fix this by creating an isa bus for piix4.
This change also requires some more qdev related changes
(similar changes were applied to pc.c) and allows
cleaning of piix3/piix4 code.

Thanks to Gerd Hoffmann for his hints.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:34 -05:00
Luiz Capitulino 1d4daa91ff 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>
2009-09-04 09:37:31 -05:00
Luiz Capitulino f18c16de4a 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>
2009-09-04 09:37:31 -05:00
Luiz Capitulino d54908a55b 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>
2009-09-04 09:37:31 -05:00
Luiz Capitulino 3818318682 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>
2009-09-04 09:37:29 -05:00
Gerd Hoffmann 9cdd03a791 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>
2009-09-04 09:37:27 -05:00
Gerd Hoffmann f455e98cf4 ide: pass down DriveInfo instead of BlockDriverState
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:27 -05:00
Amit Shah b84a5c6fa7 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>
2009-09-04 09:37:26 -05:00
Juan Quintela d1f171bd3a piix3: use new vmstate infrastructure
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:26 -05:00
Juan Quintela 0c7d19e538 i440fx: use new vmstate infrastructure
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:25 -05:00
Juan Quintela da64182c4e 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>
2009-09-04 09:37:25 -05:00
Juan Quintela 8372615d3f 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>
2009-09-04 09:37:25 -05:00
Juan Quintela 867a0d7dd0 Save irq_state into PCII440FXState
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:24 -05:00
Juan Quintela fd83e9b9dc 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>
2009-09-04 09:37:24 -05:00
Juan Quintela 85a750ca90 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>
2009-09-04 09:37:24 -05:00
Juan Quintela bd7dce87ea Introduce PIIX3IrqState for piix3 irq's state
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:24 -05:00
Juan Quintela fd37d8813c 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>
2009-09-04 09:37:24 -05:00
Juan Quintela 5d4e84c8b9 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>
2009-09-04 09:37:23 -05:00
Juan Quintela 6c009fa446 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>
2009-09-04 09:37:23 -05:00
Juan Quintela 0a3bacf34c Use PCII440FXState instead of generic PCIDevice
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:23 -05:00
Juan Quintela 15dc11286f low_set_irq is not used anywhere
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:22 -05:00
Juan Quintela 823e675a07 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>
2009-09-04 09:37:22 -05:00
Juan Quintela a4bf1f3e17 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>
2009-09-04 09:37:22 -05:00
Blue Swirl 9902571dcd Sparc32: port sun4c interrupt controller to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-31 19:30:21 +00:00
Blue Swirl f4b19cd021 Sparc32: port timers to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-31 19:30:18 +00:00
Blue Swirl 9ebec28b6c Sparc32: timer field is never NULL
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-31 19:30:17 +00:00
Blue Swirl 55a6e51f2a Add VMState support for ptimers
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-31 19:30:15 +00:00
Artyom Tarasenko 4e2a68c1e1 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>
2009-08-31 17:12:11 +00:00
Blue Swirl 757506d282 Fix gcc 3 warning: comparison is always true due to limited range of data type
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-29 16:37:34 +03:00
Blue Swirl d37adb099c Sparc32: port Slavio misc devices to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-29 16:37:09 +03:00
Blue Swirl c21011a963 Sparc32: port ECC memory controller to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-29 16:36:58 +03:00
Blue Swirl db3c9e08e0 Sparc32: port IOMMU to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 20:46:21 +00:00
Blue Swirl 75c497dca9 Sparc32: port DMA controller to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 20:46:15 +00:00
Blue Swirl c0c41a4b49 Sparc32: port TCX to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 20:43:01 +00:00
Blue Swirl c9e9502950 Sparc32: port interrupt controller to VMState design
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 20:22:52 +00:00
Blue Swirl 73538c31a8 Suppress kraxelisms
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 19:12:16 +00:00
Blue Swirl 1387fe4a95 Fix Sparc64 breakage: add dummy ISA irqs
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 19:04:13 +00:00
Blue Swirl bdae2298d1 Fix merge of 59f2a78793
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-28 18:30:54 +00:00
malc f827497194 Fix sb16 breakage due to unassigned s->irq
Signed-off-by: malc <av1474@comtv.ru>
2009-08-28 14:34:29 +04:00
malc 660cfb6b7c Fix formatting
Signed-off-by: malc <av1474@comtv.ru>
2009-08-28 14:34:27 +04:00
Juan Quintela 7d9e52bd70 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>
2009-08-27 20:47:01 -05:00
Juan Quintela 0abaa7c100 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>
2009-08-27 20:47:00 -05:00
Juan Quintela 9fdab57bed 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>
2009-08-27 20:47:00 -05:00
Juan Quintela 1f235a737b 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>
2009-08-27 20:47:00 -05:00
Juan Quintela 4f335febba 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>
2009-08-27 20:47:00 -05:00
Juan Quintela f3566bf92d 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>
2009-08-27 20:47:00 -05:00
Juan Quintela e05587e8be cirrus_vga: remove pointless cast from void *
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:47:00 -05:00
Juan Quintela a60380a561 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>
2009-08-27 20:47:00 -05:00
Juan Quintela 2b7a050abd We need PCINE2000State for save/load functions
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:47:00 -05:00
Juan Quintela 377a7f0694 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>
2009-08-27 20:46:59 -05:00
Juan Quintela 94a943ef5b 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>
2009-08-27 20:46:59 -05:00
Juan Quintela a10fcec616 ne2000: remove casts from void *
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:46:59 -05:00
Juan Quintela 505da59965 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>
2009-08-27 20:46:59 -05:00
Juan Quintela a4a2f59cda 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>
2009-08-27 20:46:59 -05:00
Juan Quintela 2191dffcf6 vga: Rename vga_state -> vga
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:46:59 -05:00
Juan Quintela 03a3e7ba5a 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>
2009-08-27 20:46:59 -05:00
Juan Quintela 63124a0d88 lsi53c895a: LSIState is a DeviceHost
Go figure.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:46:59 -05:00
Juan Quintela f305261fbb 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>
2009-08-27 20:46:59 -05:00