Statistics
| Branch: | Revision:

root / hw / ide @ 7d0d6950

# Date Author Comment
f8b6cc00 07/02/2010 02:18 pm Markus Armbruster

qdev: Decouple qdev_prop_drive from DriveInfo

Make the property point to BlockDriverState, cutting out the DriveInfo
middleman. This prepares the ground for block devices that don't have
a DriveInfo.

Currently all user-defined ones have a DriveInfo, because the only way...

18846dee 07/02/2010 02:18 pm Markus Armbruster

block: Catch attempt to attach multiple devices to a blockdev

For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
happily creates two SCSI disks connected to the same block device.
It's all downhill from there.

Device usb-storage deliberately attaches twice to the same blockdev,...

7d0d6950 07/02/2010 02:18 pm Markus Armbruster

block: Fix virtual media change for if=none

BlockDriverState member removable controls whether virtual media
change (monitor commands change, eject) is allowed. It is set when
the "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.

The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...

fa12fbbe 07/02/2010 02:18 pm Markus Armbruster

ide: Make it explicit that ide_create_drive() can't fail

All callers of ide_create_drive() ignore its value. Currently
harmless, because it fails only when qdev_init() fails, which fails
only when ide_drive_initfn() fails, which never fails.

Brittle. Change it to die instead of silently ignoring failure....

016512f3 06/30/2010 12:07 am Huacai Chen

MIPS: Initial support of VIA IDE controller used by fulong mini pc

Signed-off-by: Huacai Chen <>
Signed-off-by: Aurelien Jarno <>

abd7f68d 06/15/2010 10:41 am Markus Armbruster

block: Move error actions from DriveInfo to BlockDriverState

That's where they belong semantically (block device host part), even
though the actions are actually executed by guest device code.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

666daa68 06/04/2010 04:20 pm Markus Armbruster

blockdev: Collect block device code in new blockdev.c

Anything that moves hundreds of lines out of vl.c can't be all bad.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

124964b5 06/04/2010 12:43 pm Markus Armbruster

ide: Remove useless IDEDeviceInfo members unit, drive

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

57dac7ef 06/04/2010 12:43 pm Markus Armbruster

ide: Remove redundant IDEState member conf

Commit 428c149b added IDEState member conf to let commit 0009baf1 find
the BlockConf from there. It exists only for qdev drives, created via
ide_drive_initfn(), not for drives created via ide_init2().

But for a qdev drive, we can just as well reach its IDEDevice, which...

d459da0e 06/04/2010 12:43 pm Markus Armbruster

ide: Split ide_init1() off ide_init2()

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

870111c8 06/04/2010 12:43 pm Markus Armbruster

ide: Change ide_init_drive() to require valid dinfo argument

IDEState members drive_serial_str and version are now left empty until
an actual drive is connected. Before, they got a default value that
was overwritten when a drive got connected. Doesn't matter, because...

57234ee4 06/04/2010 12:43 pm Markus Armbruster

ide: Split non-qdev code off ide_init2()

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

6ced55a5 06/04/2010 12:43 pm Markus Armbruster

ide: Turn drive serial into a qdev property ide-drive.serial

It needs to be a qdev property, because it belongs to the drive's
guest part.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

03432407 06/04/2010 12:43 pm Markus Armbruster

ide: Fix info qtree for ide-drive.ver

Show the actual default value instead of <null> when the property has
not been set.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

38d8dfa1 05/17/2010 11:20 am Kevin Wolf

ide: Fix ide_dma_cancel

When cancelling a request, bdrv_aio_cancel may decide that it waits for
completion of a request rather than for cancellation. IDE therefore can't
abandon its DMA status before calling bdrv_aio_cancel; otherwise the callback
of a completed request would use invalid data....

117e1e82 05/14/2010 10:32 pm Blue Swirl

ide: make a table 'const'

Signed-off-by: Blue Swirl <>

50a48094 05/01/2010 10:44 pm Igor V. Kovalenko

cmd646: fix abort due to changed opaque pointer for ioport read

We cannot install different opaque pointer for read and write
of the same i/o address.

- handle zero address in bmdma_writeb_common and install
the same opaque pointer for both read and write access....

70ae65f5 05/01/2010 10:44 pm Igor V. Kovalenko

cmd646: pass pci_dev as it needs it

Instead of doing tricks to get the pci_dev, just pass it in the 1st
place. Patch is a bit longer that reverting the pci_dev field, but it
states more clearly (IMHO) what we are doing.

It also fixes the bm test, now that you told me that ->unit is not...

02c7c992 03/29/2010 10:23 pm Blue Swirl

Compile ide/macio only once

Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <>

6450a334 03/27/2010 08:58 am Blue Swirl

Fix build

Actually some systems don't define PAGE_SIZE. Fixes build breakage
by f7736b91c40a617e93505e32dcbd2cb56aad8a23.

Signed-off-by: Blue Swirl <>

f7736b91 03/27/2010 08:20 am Blue Swirl

Compile ide/core only once

Make win2k install hack unconditional as it is still restricted to
x86 only in vl.c.

Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.

Signed-off-by: Blue Swirl <>

554a310b 03/08/2010 07:30 pm Luiz Capitulino

block: Emit BLOCK_IO_ERROR before vm_stop() call

The next commit will move the STOP event into do_vm_stop(), to
have the expected event sequence we need to emit the I/O error
event before calling vm_stop().

The expected sequence is:

{ "event": "BLOCK_IO_ERROR" [...] }...

4fc8d671 02/20/2010 10:29 am Blue Swirl

Fix warning on mingw32

/src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save':
/src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type

Signed-off-by: Blue Swirl <>

ed487bb1 02/19/2010 11:33 pm Marcelo Tosatti

ide save/restore pio/atapi cmd transfer fields and io buffer

Save/restore information necessary to continue in progress PIO/ATAPI CMD
transfers.

This includes the IO buffer.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Anthony Liguori <>

0009baf1 02/11/2010 12:53 am Christoph Hellwig

ide: add topology support

Export the physical block size in the ATA IDENTIFY command. The
other topology values are not supported in ATA so skip them.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

428c149b 02/11/2010 12:53 am Christoph Hellwig

block: add topology qdev properties

Add three new qdev properties to export block topology information to
the guest. This is needed to get optimal I/O alignment for RAID arrays
or SSDs.

The options are:

- physical_block_size to specify the physical block size of the device,...
7ad7e3c3 02/10/2010 07:57 pm Luiz Capitulino

ide: Generate BLOCK_IO_ERROR QMP event

Just call bdrv_mon_event() in the right place.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

42ee76fe 01/26/2010 11:42 pm Marcelo Tosatti

ide save/restore current transfer fields

If migration takes place between write of the bmdma address register and
write of the command register (to initiate DMA), the destination will
not properly start the DMA op, hanging the guest:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen...

47c06340 01/20/2010 12:31 am Gerd Hoffmann

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=......
1e68f8c4 12/23/2009 04:35 pm Michael S. Tsirkin

piix: symbolic constants

No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <>
Acked-by: Juan Quintela <>
Acked-by: Glauber Costa <>

409570a7 12/23/2009 04:35 pm Michael S. Tsirkin

cmd646: symbolic names for pci registers

No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <>
Acked-by: Juan Quintela <>
Acked-by: Glauber Costa <>

90228ee3 12/13/2009 09:03 pm Igor V. Kovalenko

workaround for cmd646 bmdma register access while no dma is active

This is a workaround only, and is a partial revert
of a few changes to BMDMAState which removed pci_dev
field on the way.

- cmd646 pci_from_bm() expects bm->unit value to
correspond with bm data being passed to callback...

556cd098 12/12/2009 03:59 pm Markus Armbruster

qdev: Replace device names containing whitespace

Device names with whitespace require quoting in the shell and in the
monitor. Some of the offenders are also overly long. Some have a
more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc. The...

d05ac8fa 12/04/2009 10:44 pm Blue Swirl

Add "static" to please Sparse

Signed-off-by: Blue Swirl <>

a70089ce 12/03/2009 11:26 pm Thadeu Lima de Souza Cascardo

ide: Use some already defined page macros instead of constants

Some PAGE constants were used instead of the macros we already have
defined in internal.h.

Signed-off-by: Thadeu Lima de Souza Cascardo <>
Signed-off-by: Anthony Liguori <>

fe0d6123 12/03/2009 11:26 pm Thadeu Lima de Souza Cascardo

ide: implement stub for audio control/volume read

This implements the audio control or volume read support as needed by
some systems. A Conectiva Parolin system required this to detect an IDE
device as CD-ROM, through the CDVOLREAD ioctl.

Signed-off-by: Thadeu Lima de Souza Cascardo <>...

f7850099 12/03/2009 07:45 pm Kevin Wolf

Rename DriveInfo.onerror to on_write_error

Either rename variables and functions to refer to write errors (which is what
they actually do) or introduce a parameter to distinguish reads and writes.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

ce4b6522 12/03/2009 07:45 pm Kevin Wolf

ide: Implement rerror option

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

6e355d90 11/09/2009 04:43 pm Isaku Yamahata

pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t

This patch is preliminary for 64 bit BAR support.
Introduce dedicated type, pcibus_t, to represent pci bus address/size
instead of uint32_t.
Later this type will be changed to uint64_t....

0392a017 11/09/2009 04:43 pm Isaku Yamahata

pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h

make constants for pci base address match pci_regs.h by
renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.

Signed-off-by: Isaku Yamahata <>
Acked-by: Michael S. Tsirkin <>...

43b443b6 11/09/2009 04:43 pm Gerd Hoffmann

scsi: move scsi-disk.h -> scsi.h

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

39a51dfd 11/09/2009 04:43 pm Markus Armbruster

qdev: Tag isa-fdc, PIIX3 IDE and PIIX4 IDE as no-user

These devices are created automatically, and attempting to create
another one with -device fails with "qemu: hardware error:
register_ioport_write: invalid opaque".

Signed-off-by: Markus Armbruster <>...

4a643563 11/07/2009 04:13 pm Blue Swirl

IDE: Fix reset handling

Problem: x86 systems could not survive a few system_resets.

Clear most of IDE state when reset. Implement the missing reset handlers.

Signed-off-by: Blue Swirl <>

44a99354 11/07/2009 12:05 pm Blue Swirl

Sparc64/x86: remove unneeded calls to device reset

Signed-off-by: Blue Swirl <>

e4394131 11/07/2009 11:32 am Blue Swirl

PPC: remove unneeded calls to device reset

Signed-off-by: Blue Swirl <>

c1699988 11/07/2009 10:06 am Glauber Costa

v3: don't call reset functions on cpu initialization

There is absolutely no need to call reset functions when initializing
devices. Since we are already registering them, calling qemu_system_reset()
should suffice. Actually, it is what happens when we reboot the machine,...

24daf35c 10/27/2009 07:28 pm Juan Quintela

ide: port ide mmio to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

200ab5e2 10/27/2009 07:28 pm Juan Quintela

ide: port isa ide to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

44bfa332 10/27/2009 07:28 pm Juan Quintela

ide: port pmac ide to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

407a4f30 10/27/2009 07:28 pm Juan Quintela

ide: port pci ide to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

b3a7d328 10/27/2009 07:28 pm Juan Quintela

ide: pre VMState functions are not needed anymore

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

37159f13 10/27/2009 07:28 pm Juan Quintela

ide: port ide_drive to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

8a72f380 10/27/2009 07:28 pm Juan Quintela

ide: microdrive cycle field is set as uint8_t

Really, it is used as a boolean
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

b38436e3 10/27/2009 07:28 pm Juan Quintela

ide: add VMSTATE_IDE_BUS and VMSTATE_IDE_DRIVES

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

5f637ce0 10/27/2009 07:28 pm Juan Quintela

ide: port microdrive to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

0ce51e92 10/27/2009 07:28 pm Juan Quintela

ide: include bus in MMIOState

Change pointer to struct by embedded struct.

Adjust all callers
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

6521dc62 10/27/2009 07:28 pm Juan Quintela

ide: port idebus to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

96c35ceb 10/27/2009 07:28 pm Juan Quintela

ide: change identify_data type to uint8_t

It is used everywhere as uint8_t except in one place. Cast to uint16_t
in that place
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

0cde1b4c 10/12/2009 05:42 pm Juan Quintela

ide: cmd646 ->unit has just the value that we want

Patchworks-ID: 35307
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

d1570baa 10/12/2009 05:42 pm Juan Quintela

ide: BMDMAState don't need a pci_dev field anymore

Patchworks-ID: 35306
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

61073e0f 10/12/2009 05:42 pm Juan Quintela

ide: change cast to DO_UPCAST

Patchworks-ID: 35293
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

e6a7830a 10/12/2009 05:42 pm Juan Quintela

ide: Remove cast in pci_register_bar

We already have a PCIDevice at that point

Patchworks-ID: 35296
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

edcca5a3 10/12/2009 05:42 pm Juan Quintela

ide: Remove duplicated definitions

Patchworks-ID: 35297
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

18c0fb30 10/12/2009 05:42 pm Juan Quintela

ide: remove uselsess casts from void *

Patchworks-ID: 35298
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

65c0f135 10/12/2009 05:42 pm Juan Quintela

ide: create ide/pci.h for common ide pci definitions

Patchworks-ID: 35299
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

3e7e1558 10/12/2009 05:42 pm Juan Quintela

ide: export needed ide-pci functions for split

Patchworks-ID: 35300
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

4c3df0ec 10/12/2009 05:42 pm Juan Quintela

ide: split cmd646 and piix from pci.c

This patch splits cmd646 specific code from pci.c.
This patch splits piix4 specific code from pci.c.
And compile new piix.o and cmd646.o when they are needed.
The only change that is not code movemet is removal of cmd646 specific parts...

58c0e732 10/12/2009 05:42 pm Juan Quintela

ide: PCIIDEState type field is not needed anymore

We have split the functions that needed it for cmd646

Patchworks-ID: 35302
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

7e078316 10/12/2009 05:42 pm Juan Quintela

ide: 'secondary' field is only used by cmd646

Patchworks-ID: 35303
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

61f58e59 10/12/2009 05:42 pm Juan Quintela

ide: cmd646 we can get the pci device with container_of

Patchworks-ID: 35305
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

5c17ca25 10/07/2009 04:54 pm Markus Armbruster

Clean up test for qdev_init() failure

Some callers test for != 0, some for < 0. Normalize to < 0.

Patchworks-ID: 35171
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

e23a1b33 10/07/2009 04:54 pm Markus Armbruster

New qdev_init_nofail()

Like qdev_init(), but terminate program via hw_error() instead of
returning an error value.

Use it instead of qdev_init() where terminating the program on failure
is okay, either because it's during machine construction, or because...

499cf102 10/05/2009 05:32 pm Markus Armbruster

Rename pci_create_noinit() to pci_create()

It's qdev_create() specialized for PCI, so name it accordingly.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

1f850f10 10/05/2009 05:32 pm Gerd Hoffmann

switch ide bus to inplace allocation.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

c227f099 10/02/2009 12:12 am Anthony Liguori

Revert "Get rid of _t suffix"

In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem. Something
like this must be presented on the list first so people can provide input...

99a0949b 10/01/2009 09:45 pm malc

Get rid of _t suffix

Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <>

dea21e97 09/15/2009 11:05 pm Gerd Hoffmann

ide/isa: convert to qdev.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Blue Swirl <>

feef3102 09/15/2009 11:04 pm Gerd Hoffmann

ide/pci: convert to qdev.

With this patch applied ide drives (when attached to a pci adapter) can
be created via -device, like this:

-drive if=none,id=mydisk,file=/path/to/disk.img
-device ide-drive,drive=mydisk,bus=ide.0,unit=0

Note that creating a master on ide1 doesn't work that way. That is a...

9a43dba0 09/15/2009 11:00 pm Gerd Hoffmann

ide/pci: fix indention

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Blue Swirl <>

da4d0419 09/15/2009 10:23 pm Gerd Hoffmann

ide/qdev: add ide bus.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Blue Swirl <>

88804180 09/15/2009 10:23 pm Gerd Hoffmann

split away drive init from ide_init2()

This allows the ide bus being initialized without drives attached
and the drives being attached and initialization later on as
separate step.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Blue Swirl <>

6ee093c9 09/11/2009 06:19 pm Juan Quintela

Unexport ticks_per_sec variable. Create get_ticks_per_sec() function

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

e900a7b7 09/11/2009 06:19 pm Christoph Hellwig

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...

b0484ae4 09/11/2009 06:19 pm Christoph Hellwig

ide: use bdrv_aio_flush

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

ae027ad3 09/04/2009 05:37 pm Stefan Weil

mips malta: Fix fdc regression and use qdev for i8042 setup

8baf73adf664e79eae201c3f618078a220a661d9 (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...

f455e98c 09/04/2009 05:37 pm Gerd Hoffmann

ide: pass down DriveInfo instead of BlockDriverState

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

9cdd03a7 09/04/2009 05:37 pm Gerd Hoffmann

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 <>
Signed-off-by: Anthony Liguori <>

757506d2 08/29/2009 04:37 pm Blue Swirl

Fix gcc 3 warning: comparison is always true due to limited range of data type

Signed-off-by: Blue Swirl <>

bdae2298 08/28/2009 09:30 pm Blue Swirl

Fix merge of 59f2a78793b6d17634f39646d604e84af51e0919

Signed-off-by: Blue Swirl <>

59f2a787 08/28/2009 04:46 am Gerd Hoffmann

ide: move code to hw/ide/

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>