Statistics
| Branch: | Revision:

root / hw / ide / internal.h @ f487b677

History | View | Annotate | Download (20.8 kB)

# Date Author Comment
0ee20e66 05/08/2013 04:28 pm Kevin Wolf

ahci: Don't allow creating slave drives

An IDE bus provided by AHCI can only take a single IDE drive. If you add
a drive as slave, qemu used to accept the command line but the device
wouldn't be actually usable. Catch the situation instead and error out....

0bc3cd62 04/15/2013 07:19 pm Paolo Bonzini

include: avoid useless includes of exec/ headers

Headers in include/exec/ are for the deepest innards of QEMU,
they should almost never be included directly.

Signed-off-by: Paolo Bonzini <>

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

61f52e06 08/10/2012 11:25 am Jason Baron

ahci: Fix ahci cdrom read corruptions for reads > 128k

While testing q35, which has its cdrom attached to the ahci controller, I found
that the Fedora 17 install would panic on boot. The panic occurs while
squashfs is trying to read from the cdrom. The errors are:...

31e404f4 07/17/2012 05:48 pm Markus Armbruster

hw/block-common: Move BlockConf & friends from block.h

This stuff doesn't belong to block layer, and was put there only
because a better home didn't exist then. Now it does.

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

ba801960 07/17/2012 05:48 pm Markus Armbruster

ide: qdev properties for disk geometry

Geometry needs to be qdev properties, because it belongs to the
disk's guest part.

Maintain backward compatibility exactly like for serial: fall back to
DriveInfo's geometry, set with -drive cyls=...

Do this only for ide-hd. ide-drive is legacy. ide-cd doesn't have a...

6e6f61a6 07/17/2012 05:48 pm Markus Armbruster

ide: qdev property for BIOS CHS translation

This isn't quite orthodox. CHS translation is firmware configuration,
communicated via the RTC's CMOS RAM, not a property of the disk. But
it's best to treat it just like geometry anyway.

Maintain backward compatibility exactly like for geometry: fall back...

9139046c 07/17/2012 05:48 pm Markus Armbruster

ide pc: Cut out the block layer geometry middleman

PC BIOS setup needs IDE geometry information. Get it directly from
the device model rather than through the block layer. In preparation
of purging geometry from the block layer, which will happen later in...

0d936928 06/18/2012 04:14 pm Anthony Liguori

qdev: Convert busses to QEMU Object Model

This is far less interesting than it sounds. We simply add an Object to each
BusState and then register the types appropriately. Most of the interesting
refactoring will follow in the next patches.

Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...

bef0fd59 04/19/2012 05:03 pm Stefan Hajnoczi

ide: convert ide_sector_read() to asynchronous I/O

The IDE PIO interface currently uses bdrv_read() to perform reads
synchronously. Synchronous I/O in the vcpu thread is bad because it
prevents the guest from executing code - it makes the guest
unresponsive....

27e0c9a1 04/05/2012 03:54 pm Floris Bos

ide: Add "model=s" qdev option

Allow the user to override the default disk model name "QEMU HARDDISK".

Some Linux distributions use the /dev/disk/by-id/scsi-SATA_name-of-disk-
model_serial addressing scheme when refering to partitions in /etc/fstab
and elsewhere. This causes problems when starting a disk image taken from...

95ebda85 04/05/2012 03:54 pm Floris Bos

ide: Adds wwn=hex qdev option

Allow the user to specify a disk's World Wide Name.

Linux guests can address disks by their unique World Wide Name number
(e.g. /dev/disk/by-id/wwn-0x5001517959123522). This patch adds support
for assigning a World Wide Name number to a virtual IDE disk....

d148211c 01/27/2012 06:50 pm Anthony Liguori

ide: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

67cc61e4 10/28/2011 08:25 pm Paolo Bonzini

atapi/scsi: unify definitions for MMC

The definitions in ide/internal.h are duplicates, since ATAPI commands
actually come from SCSI. Use the ones in scsi-defs.h and move the
missing ones there. Two exceptions:

- MODE_PAGE_WRITE_PARMS conflicts with the "flexible disk geometry"...

4a91d3b3 10/11/2011 04:57 pm Richard Henderson

ide: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <>
Signed-off-by: Avi Kivity <>

1dfb4dd9 09/15/2011 10:39 pm Luiz Capitulino

Replace the VMSTOP macros with a proper state type

Today, when notifying a VM state change with vm_state_notify(),
we pass a VMSTOP macro as the 'reason' argument. This is not ideal
because the VMSTOP macros tell why qemu stopped and not exactly
what the current VM state is....

d1a0739d 09/12/2011 04:17 pm Markus Armbruster

block: Move BlockConf & friends from block_int.h to block.h

It's convenience stuff for block device models, so block.h isn't the
ideal home either, but better than block_int.h.

Permits moving some #include "block_int.h" from device model .h into
.c.

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

dd063333 09/12/2011 04:17 pm Markus Armbruster

ide/atapi: Track tray open/close state

We already track it in BlockDriverState since commit 4be9762a. As
discussed in that commit's message, we should track it in the device
device models instead, because it's device state.

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

a0a7573b 09/12/2011 04:17 pm Markus Armbruster

ide/atapi: Track tray locked state

We already track it in BlockDriverState. Just like tray open/close
state, we should track it in the device models instead, because it's
device state.

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

1d4316d3 09/06/2011 12:23 pm Markus Armbruster

ide: Update command code definitions as per ACS-2 Table B.2

Drop WIN_SRST, it has the same value as WIN_DEVICE_RESET.

Drop unused WIN_RESTORE, it has the same value as WIN_RECAL.

Drop codes that are not implemented and long obsolete: WIN_READ_LONG,
WIN_READ_LONG_ONCE, WIN_WRITE_LONG, WIN_WRITE_LONG_ONCE, WIN_FORMAT...

a597e79c 08/25/2011 07:18 pm Christoph Hellwig

block: explicit I/O accounting

Decouple the I/O accounting from bdrv_aio_readv/writev/flush and
make the hardware models call directly into the accounting helpers.

This means:
- we do not count internal requests from image formats in addition
to guest originating I/O...

4e1e0051 06/15/2011 03:36 pm Christoph Hellwig

ide: allow other dma comands than read and write

Replace the is_read flag with a dma_cmd flag to allow the dma and
restart logic to handler other commands like TRIM.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

d353fb72 06/15/2011 03:36 pm Christoph Hellwig

ide: add TRIM support

Add support for TRIM sub function of the data set management command,
and wire it up to the qemu discard infrastructure.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

def93791 06/15/2011 03:36 pm Kevin Wolf

ide: Split error status from status register

When adding the werror=stop mode, some flags were added to s->status
which are used to determine what kind of operation should be restarted
when the VM is continued.

Unfortunately, it turns out that s->status is in fact a device register...

1f56e32a 05/19/2011 11:26 am Markus Armbruster

ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"

An "ide-drive" is either a hard disk or a CD-ROM, depending on the
associated BlockDriverState's type hint. Unclean; disk vs. CD belongs
to the guest part, not the host part.

Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in...

33231e0e 04/27/2011 05:20 pm Kevin Wolf

ide: Split atapi.c out

Besides moving code, this patch only fixes some whitespace issues in the moved
code and makes all functions in atapi.c static which can be static.

Signed-off-by: Kevin Wolf <>

996faf1a 04/13/2011 01:20 pm Amit Shah

atapi: GESN: implement 'media' subcommand

Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION
command. This helps us report tray open, tray closed, no media, media
present states to the guest.

Newer Linux kernels (2.6.38+) rely on this command to revalidate discs...

cd369c46 01/24/2011 12:08 pm Christoph Hellwig

ide: factor dma handling helpers

Factor the DMA I/O path that is duplicated between read and write
commands, into common helpers using the s->is_read flag added for
the macio ATA controller.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

ccf0fd8b 12/17/2010 05:11 pm Roland Elek

ide: add ncq identify data for ahci sata drives

I modified ide_identify() to include the zero-based queue length
value in word 75, and set bit 8 in word 76 to signal NCQ support
in the identify data for AHCI SATA drives.

Signed-off-by: Roland Elek <>...

40a6238a 12/17/2010 05:11 pm Alexander Graf

ide: Split out BMDMA code from ATA core

The ATA core is currently heavily intertwined with BMDMA code. Let's loosen
that a bit, so we can happily replace the DMA backend with different
implementations.

Signed-off-by: Alexander Graf <>
Signed-off-by: Kevin Wolf <>

7cff87ff 12/17/2010 05:11 pm Alexander Graf

ide: split ide command interpretation off

The ATA command interpretation code can be used for PATA and SATA
interfaces alike. So let's split it out into a separate function.

Signed-off-by: Alexander Graf <>
Signed-off-by: Kevin Wolf <>

3835510f 12/11/2010 11:27 pm Gleb Natapov

Store IDE bus id in IDEBus structure for easy access.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

9fbef1ac 11/24/2010 06:31 pm Avi Kivity

ide: convert bmdma address ioport to ioport_register()

cmd646, via compile tested, pci lightly boot tested.

Signed-off-by: Avi Kivity <>
Signed-off-by: Kevin Wolf <>

e2bcadad 10/22/2010 03:49 pm Kevin Wolf

ide: Handle flush failure

Instead of always assuming success for bdrv_aio_flush, actually do something
with the error. This respects the werror option and accordingly ignores the
error, reports it to the guest or stops the VM and retries after cont.

Ignoring the error is trivial, obviously. For stopping the VM and retrying...

50641c5c 07/27/2010 12:19 am Juan Quintela

ide: fix migration in the middle of pio operation

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

3abb6260 07/27/2010 12:19 am Juan Quintela

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

This reverts commit ed487bb1d69040b9dac64a4fc076d8dd82b131d6.

The conflicts are due to commit 4fc8d6711aff7a9c11e402c3d77b481609f9f486
that is a fix to the ide_drive_pre_save() function. It reverts both...

cd8722bb 07/06/2010 06:05 pm Markus Armbruster

ide: Replace IDEState members is_cdrom, is_cf by drive_kind

The two aren't independent variables. Make that obvious.

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

c4d74df7 07/06/2010 06:05 pm Markus Armbruster

ide: Make ide_init_drive() return success

It still always succeeds. The next commits will add failures.

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

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

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

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

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

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

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

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

ide: Implement rerror option

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

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

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

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

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

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

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

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

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

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

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