Commit Graph

2267 Commits

Author SHA1 Message Date
Gerd Hoffmann bb36f66a97 qdev/prop: convert integratorcp.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:51 -05:00
Gerd Hoffmann 368eb5d488 qdev/prop: convert i2c.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:51 -05:00
Gerd Hoffmann ddde095c8f qdev/prop: convert etraxfs_pic.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:51 -05:00
Gerd Hoffmann ec02f7dec2 qdev/prop: convert escc.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:50 -05:00
Gerd Hoffmann d210a1b43a qdev/prop: convert eccmemctl.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:50 -05:00
Gerd Hoffmann 1832efa29d qdev/prop: convert armv7m.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:50 -05:00
Gerd Hoffmann e325775b35 qdev/prop: convert arm_sysctl.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:50 -05:00
Gerd Hoffmann 54586bd17d qdev/prop: convert pci.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:50 -05:00
Gerd Hoffmann 313feaabc6 qdev/prop: add CharDriverState property.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:49 -05:00
Gerd Hoffmann cf12b95bf5 qdev/prop: macros for creating typechecked properties.
There are DEFINE_PROP_$TYPE("name", struct, field, default) macros for
each property type.  These macros link the qdev_prop_$name struct to the
type used by that property.  typeof(struct->field) is verifyed to be the
correct one for the given property.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:48 -05:00
Gleb Natapov 93c8cfd9e6 make windows notice media change
Windows seems to be very stupid about cdrom media change. It polls
cdrom status and if status goes ready->media not present->ready
it assumes that media was changed. If "media not present" step doesn't
happen even if "medium may have changed" was seen it assumes media
haven't changed. Fake "media not present" step.

Filip Navara did a great job debugging this issue in Windows and this is
what he found out:

BINGO! ... The media present notifications were broken ever since
Windows 2000 it seems. The media change is detected properly and it's
passed to ClassSetMediaChangeState function which in turn calls
ClasspInternalSetMediaChangeState. This function is responsible for
changing some internal state of the device object and sending the PnP
events which later result in application notifications. It has this
tiny bit of code (not copied byte for byte):

if (oldMediaState == NewState) {
  // Media is in the same state it was before.
  return;
}

so the end result is that for the case of UNIT NEEDS ATTENTION /
MEDIUM MAY HAVE CHANGED without NOT READY in-between is really broken.
It results in the internal media change counter incremented, so the
media contents are re-read when necessary, instead of relying on the
cache, but the notifications to applications are never sent.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:48 -05:00
Beth Kon 09c0848e52 Add/Fix command-line checks for smbios options v2
- One type 4 table is required per cpu. Add a check for this.
- Fix check for smbios file.

Changes from v1:
- static designation of smbios_validate_table, and remove whitespace

Signed-off-by: Beth Kon <eak@us.ibm.com>
--
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:48 -05:00
Stefano Stabellini 0bd8246bfe vga: do not resize the screen on hw_invalidate
Hi all,
currently vga always resizes the screen when vga_hw_invalidate is called
while this is not required and all the other graphic emulators don't.
This patch fixes it, making vga invalidate behaviour consistent with the
other emulated devices.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:31 -05:00
Gerd Hoffmann 8baf73adf6 qdev/isa: convert fdc.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:30 -05:00
Gerd Hoffmann b399963830 qdev/isa: make pc use qdev for i8042 setup.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:29 -05:00
Gerd Hoffmann f75247f172 qdev/isa: make the piix isa bridge register an isa bus.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:28 -05:00
Gerd Hoffmann da85ccfb77 qdev/isa: add qdev support to i8042 (aka ps/2 kbd+mouse).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:28 -05:00
Gerd Hoffmann f915a11563 qdev/isa: add isa bus support to qdev.
Pretty simple and straigt forward.
IRQs modeled simliar to sysbus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:28 -05:00
Gerd Hoffmann d176c495b6 qdev-ify virtio-blk.
First user of the new drive property.  With this patch applied host
and guest config can be specified separately, like this:

  -drive if=none,id=disk1,file=/path/to/disk.img
  -device virtio-blk-pci,drive=disk1

You can set any property for virtio-blk-pci now.  You can set the pci
address via addr=.  You can switch the device into 0.10 compat mode
using class=0x0180.  As this is per device you can have one 0.10 and one
0.11 virtio block device in a single virtual machine.

Old syntax continues to work.  Internally it does the same as the two
lines above though.  One side effect this has is a different
initialization order, which might result in a different pci address
being assigned by default.

Long term plan here is to have this working for all block devices, i.e.
once all scsi is properly qdev-ified you will be able to do something
like this:

  -drive if=none,id=sda,file=/path/to/disk.img
  -device lsi,id=lsi,addr=<pciaddr>
  -device scsi-disk,drive=sda,bus=lsi.0,lun=<n>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:28 -05:00
Gerd Hoffmann 14b41872fd qdev/prop: add drive property.
Adds a (host) drive property, intended to be used by virtual disk
backend drivers.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:27 -05:00
Gerd Hoffmann f31d07d175 QemuOpts: switch over -device.
Make -device switch use the QemuOpts framework.
Everything should continue to work like it did before.

New: "-set device.$id.$property=$value" works.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:27 -05:00
Christoph Egger bb87ece518 tolower -> qemu_tolower
Use qemu_tolower() instead of tolower().
Fixes warning on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:24 -05:00
Blue Swirl d9c3231019 Use qemu_irq for system_powerdown
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-09 08:42:19 +00:00
Blue Swirl b2b6f6ec39 Sparc32: use qemu_irq for system_powerdown
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-09 07:27:29 +00:00
Blue Swirl 74ff8d90a1 Sparc32: move sparc32_dma init to sun4m.c
Also connect ESP and Lance reset signals to DMA.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 21:43:12 +00:00
Blue Swirl d95d8f1c11 Sparc32: remove VRAM and NVRAM sizes from hwdef
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 21:04:18 +00:00
Blue Swirl c533e0b34d Sparc32: remove IRQ numbers from hwdef
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 20:55:37 +00:00
Blue Swirl 68556e2e9e Sparc32: move intbit_to_level table back to slavio_intctl.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 20:36:08 +00:00
Blue Swirl 4b48bf059b Sparc32: move device instantiation to sun4m.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 20:24:47 +00:00
Blue Swirl 7204ff9c79 Sparc32: Refactor slavio timer
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 20:08:15 +00:00
Blue Swirl 10696b4fb2 ppc_newworld: configure screen size from QEMU command line options
Use the FW_CFG interface to send user requested screen size and depth to
OpenBIOS like 7f1aec5f93 for ppc_oldworld.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 10:47:15 +00:00
Blue Swirl 7589690c2a Sparc64: configure screen size from QEMU command line options
Use the FW_CFG interface to send user requested screen size and depth to
OpenBIOS like 7f1aec5f93 for ppc_oldworld.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 10:44:56 +00:00
Laurent Vivier 7f1aec5f93 ppc_oldworld: configure screen size from qemu command line options
This patch uses the FW_CFG interface to send user requested screen size
and depth to openbios.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08 10:19:24 +00:00
Blue Swirl 660f11be54 Fix Sparse warnings: "Using plain integer as NULL pointer"
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-31 21:16:51 +00:00
Blue Swirl 2e29bd0478 PPC: convert Uni-north to qdev: also fixes Mac99 machine crash
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-31 20:23:28 +00:00
Blue Swirl 426f17bb0b PPC: convert Grackle to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-31 20:23:02 +00:00
Blue Swirl 2814df28ef esp: fix interrupt register read
Read of interrupt register should clear it and also sequence step and status.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-31 07:26:44 +00:00
Blue Swirl bfdb36293f Fix SDL zooming with pl110 (cf. d3ffcafe25)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-31 09:10:02 +03:00
Bill Paul b1332393cd e1000.c doesn't properly emulate EERD and ICS registers
Once again, the emulation of the EERD and ICS registers in e1000.c is
incorrect. Nobody has noticed this before because none of the Intel-written
e1000 drivers use these registers, and all of the independently written open
source drivers copy Intel's example, so they don't use them either.
Regardless, these registers are documented in the programmer's manuals, and
their emulated behavior doesn't match the verified behavior of real hardware,
so any software that does use them doesn't function correctly.

-Bill

Signed-off-by: Bill Paul <wpaul@windriver.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:38 -05:00
Gerd Hoffmann a414c306c0 qdev: convert all vga devices.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:37 -05:00
Gerd Hoffmann 9316d30fbb qdev/core: add monitor command to list all drivers
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:37 -05:00
Gerd Hoffmann 1b524b0441 qdev: factor out qdev_print_devinfo.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:37 -05:00
Markus Armbruster 213189ab65 Fix VM state change handlers running out of order
When a VM state change handler changes VM state, other VM state change
handlers can see the state transitions out of order.

bmdma_map(), scsi_disk_init() and virtio_blk_init() install VM state
change handlers to restart DMA.  These handlers can vm_stop() by
running into a write error on a drive with werror=stop.  This throws
the VM state change handler callback into disarray.  Here's an example
case I observed:

0. The virtual IDE drive goes south.  All future writes return errors.

1. Something encounters a write error, and duly stops the VM with
   vm_stop().

2. vm_stop() calls vm_state_notify(0).

3. vm_state_notify() runs the callbacks in list vm_change_state_head.
   It contains ide_dma_restart_cb() installed by bmdma_map().  It also
   contains audio_vm_change_state_handler() installed by audio_init().

4. audio_vm_change_state_handler() stops audio stuff.

5. User continues VM with monitor command "c".  This runs vm_start().

6. vm_start() calls vm_state_notify(1).

7. vm_state_notify() runs the callbacks in vm_change_state_head.

8. ide_dma_restart_cb() happens to come first.  It does its work, runs
   into a write error, and duly stops the VM with vm_stop().

9. vm_stop() runs vm_state_notify(0).

10. vm_state_notify() runs the callbacks in vm_change_state_head.

11. audio_vm_change_state_handler() stops audio stuff.  Which isn't
   running.

12. vm_stop() finishes, ide_dma_restart_cb() finishes, step 7's
   vm_state_notify() resumes running handlers.

13. audio_vm_change_state_handler() starts audio stuff.  Oopsie.

Fix this by moving the actual write from each VM state change handler
into a new bottom half (suggested by Gleb Natapov).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:37 -05:00
Mark McLoughlin 85c2c7359b Remove the virtio-{blk, console}-pci-0-10 device types
These are now unused.

However, perhaps the idea is that when we add -device, they will be
useful? In that case, we should add virtio-net-pci-0-10 too.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:37 -05:00
Mark McLoughlin caea79a9db Remove the pc-0-10 machine type
We have the pc-0.10 machine type now which does exactly the same
thing.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-30 09:50:36 -05:00
Juan Quintela e2542fe2bc rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:21 -05:00
Juan Quintela 84f1581861 Refactor code to remove one #ifdef CONFIG_FDT
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:19 -05:00
Juan Quintela 3f0855b14b Rename HAVE_FDT to CONFIG_FDT and define it also in Makefile
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:19 -05:00
Michael S. Tsirkin 3174ecd128 qemu: msix nit: clear msix_entries_nr on error
I don't think it's critical to do this, but it's
best to keep uninit and error recovery consistent.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:14 -05:00
Jes Sorensen 6be68d7eb9 Introduce -smp , maxcpus= flag to specify maximum number of CPUS.
Follow on patch will use it to determine the size of the MADT and
other BIOS tables.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:14 -05:00