Statistics
| Branch: | Revision:

root / hw / ide / core.c @ 43997225

History | View | Annotate | Download (66.4 kB)

# Date Author Comment
43cf8ae6 04/05/2012 03:54 pm David Gibson

Use DMADirection type for dma_bdrv_io

Currently dma_bdrv_io() takes a 'to_dev' boolean parameter to
determine the direction of DMA it is emulating. We already have a
DMADirection enum designed specifically to encode DMA directions.
This patch uses it for dma_bdrv_io() as well. This involves removing...

85e8dab1 04/05/2012 03:54 pm Paolo Bonzini

aio: move BlockDriverAIOCB to qemu-aio.h

And remove several block_int.h inclusions that should not be there.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

2844bdd9 04/05/2012 03:54 pm Kevin Wolf

ide: IDENTIFY word 86 bit 14 is reserved

Reserved bits should be cleared to zero.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

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

aa2c91bd 04/05/2012 03:54 pm Floris Bos

ide: Change serial number strncpy() to pstrcpy()

strncpy may not null-terminate the destination string.

Cc:
Signed-off-by: Floris Bos <>
Signed-off-by: Kevin Wolf <>

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

d53cdb30 02/29/2012 01:48 pm Paolo Bonzini

ide: fail I/O to empty disk

Requesting a read or a write operation on an empty disk can lead
to QEMU dumping core.

Also fix a few braces here and there.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Stefan Hajnoczi <>...

bde25388 02/22/2012 09:23 pm Luiz Capitulino

ide: drop ide_tray_state_post_load()

This is used to sync the physical tray state after migration when
using CD-ROM passthrough. However, migrating when using passthrough
is broken anyway and shouldn't be supported...

So, drop this function as it causes a problem with the DEVICE_TRAY_MOVED...

329c0a48 02/22/2012 09:22 pm Luiz Capitulino

block: Rename bdrv_mon_event() & BlockMonEventAction

They are QMP events, not monitor events. Rename them accordingly.

Also, move bdrv_emit_qmp_error_event() up in the file. A new event will
be added soon and it's good to have them next each other.

Signed-off-by: Luiz Capitulino <>...

3cfdd0da 12/19/2011 05:10 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

b61744b3 12/16/2011 11:53 am Paolo Bonzini

ide: drop argument to dma_buf_commit

The argument is unused and even wrong when the function is called
by ide_handle_rw_error. Drop it.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

b9b2008b 12/15/2011 01:40 pm Paolo Bonzini

block: dma_bdrv_* does not return NULL

Initially attempted with the following semantic patch:

rule1
expression E;
statement S;
@@
E =
(
dma_bdrv_io | dma_bdrv_read | dma_bdrv_write
)
(...);
(
- if (E == NULL) { ... } |
- if (E) { <... S ...> }...

ad54ae80 12/15/2011 01:40 pm Paolo Bonzini

block: bdrv_aio_* do not return NULL

Initially done with the following semantic patch:

rule1
expression E;
statement S;
@@
E =
(
bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl
)
(...);
(
- if (E == NULL) { ... }...

66a0a2cb 12/06/2011 11:56 am Dong Xu Wang

fix spelling in hw sub directory

Correct obvious spelling errors in qemu/hw directory.

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

2df0a3a3 11/11/2011 03:02 pm Paolo Bonzini

atapi: implement eject requests

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

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

fb60105d 10/28/2011 08:25 pm Kevin Wolf

ide: Fix off-by-one error in array index check

Signed-off-by: Kevin Wolf <>
Reviewed-by: Paolo Bonzini <>

2a22e6eb 10/14/2011 08:36 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

36f490b1 10/14/2011 06:44 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging

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

50fb1900 10/11/2011 10:42 am Luiz Capitulino

ide: Support I/O status

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

0461d5a6 10/04/2011 05:02 pm Luiz Capitulino

RunState: Rename enum values as generated by the QAPI

Next commit will convert the query-status command to use the
RunState type as generated by the QAPI.

In order to "transparently" replace the current enum by the QAPI
one, we have to make some changes to some enum values....

c8af89af 09/20/2011 11:21 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

bbca72c6 09/19/2011 12:35 pm Paolo Bonzini

dma-helpers: rename is_write to to_dev

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

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

7b6f9300 09/12/2011 04:17 pm Markus Armbruster

block: New bdrv_set_buffer_alignment()

Device models should be able to set it without an unclean include of
block_int.h.

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

7d4b4ba5 09/12/2011 04:17 pm Markus Armbruster

block: New change_media_cb() parameter load

To let device models distinguish between eject and load.

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

25ad22bc 09/12/2011 04:17 pm Markus Armbruster

ide/atapi scsi-disk: Make monitor eject -f, then change work

change fails while the tray is locked by the guest. eject -f forces
it open and removes any media. Unfortunately, the tray closes again
instantly. Since the lock remains as it is, there is no way to insert...

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

ide/atapi: Preserve tray state on migration

Use a subsection, so that migration to older version still works,
provided the tray is closed and unlocked.

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

9e6a4c91 09/12/2011 04:17 pm Markus Armbruster

block: Drop BlockDriverState member removable

It's a confused mess (see previous commit). No users remain.

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

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

block: Show whether the virtual tray is open in info block

Need to ask the device, so this requires new BlockDevOps member
is_tray_open().

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

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

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

block: Drop medium lock tracking, ask device models instead

Requires new BlockDevOps member is_medium_locked(). Implement for IDE
and SCSI CD-ROMs.

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

844505b1 09/12/2011 04:17 pm Markus Armbruster

ide: Use a table to declare which drive kinds accept each command

No functional change.

It would be nice to have handler functions in the table, like commit
e1a064f9 did for ATAPI. Left for another day.

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

3cfc2269 09/12/2011 04:17 pm Markus Armbruster

ide: Reject ATA commands specific to drive kinds

ACS-2 Table B.2 explicitly prohibits ATAPI devices from implementing
WIN_RECAL, WIN_READ_EXT, WIN_READDMA_EXT, WIN_READ_NATIVE_MAX,
WIN_MULTREAD_EXT, WIN_WRITE, WIN_WRITE_ONCE, WIN_WRITE_EXT,
WIN_WRITEDMA_EXT, WIN_MULTWRITE_EXT, WIN_WRITE_VERIFY, WIN_VERIFY,...

3f76a7c3 09/12/2011 04:17 pm Markus Armbruster

ide: Fix ATA command READ to set ATAPI signature for CD-ROM

Must set the ATAPI device signature, see ATA4 8.27.5.2 Outputs for
PACKET Command feature set devices, and ACS-2 7.36.6 Outputs for
PACKET feature set devices.

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

656fbeff 09/06/2011 12:24 pm Markus Armbruster

ide: Give vmstate structs internal linkage where possible

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

fa879d62 09/06/2011 12:23 pm Markus Armbruster

block: Attach non-qdev devices as well

For now, this just protects against programming errors like having the
same drive back multiple non-qdev devices, or untimely bdrv_delete().
Later commits will add other interesting uses.

While there, rename BlockDriverState member peer to dev, bdrv_attach()...

0e49de52 09/06/2011 12:23 pm Markus Armbruster

block: Generalize change_cb() to BlockDevOps

So we can more easily add device model callbacks.

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

145feb17 09/06/2011 12:23 pm Markus Armbruster

block: Split change_cb() into change_media_cb(), resize_cb()

Multiplexing callbacks complicates matters needlessly.

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

814839c0 09/06/2011 12:23 pm Markus Armbruster

ide: Clean up case label indentation in ide_exec_cmd()

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

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

c925400b 07/05/2011 12:23 pm Kevin Wolf

ide: Initialise buffers with zeros

Just in case there's still a way how a guest can read out buffers when it's not
supposed to, let's zero the buffers during initialisation so that we don't leak
information to the guest.

Signed-off-by: Kevin Wolf <>...

40c4ed3f 07/05/2011 12:23 pm Kevin Wolf

ide: Ignore reads during PIO in and writes during PIO out

This fixes https://bugs.launchpad.net/qemu/+bug/786209:

When the DRQ_STAT bit is set, the IDE core permits both data reads
and data writes, regardless of whether the current transfer was
initiated as a read or write....
0754f9ec 06/15/2011 03:36 pm Kevin Wolf

ide: Add forgotten VMSTATE_END_OF_LIST in subsection

Signed-off-by: Kevin Wolf <>

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

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

ide: Fix ide_drive_pio_state_needed()

When a failed PIO request caused the VM to stop, we still need to transfer the
PIO state even though DRQ=0 at this point.

Signed-off-by: Kevin Wolf <>

69c38b8f 06/08/2011 11:39 am Kevin Wolf

ide/core: Remove explicit setting of BM_STATUS_INT

BM_STATUS_INT is automatically set during ide_set_irq(), there's no reason to
set it manually in addition.

There is even one case where the interrupt status bit was set, but no IRQ was
raised. This is when the PRD table was reached but there is more data to...

95b5edcd 05/19/2011 11:26 am Markus Armbruster

blockdev: Store -drive option media in DriveInfo

DriveInfo is closely tied to -drive, and like -drive, it mixes
information about host and guest part of the block device. Unlike
DriveInfo, BlockDriverState should be about the host part only.

One of the remaining guest bits there is the "type hint". -drive...

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

4b9b7092 04/27/2011 03:36 pm Amit Shah

atapi: Add 'medium ready' to 'medium not ready' transition on cd change

MMC-5 Table F.1 lists errors that can be thrown for the TEST_UNIT_READY
command. Going from medium not ready to medium ready states is
communicated by throwing an error.

This adds the missing 'tray opened' event that we fail to report to...

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

0af63ba3 04/13/2011 01:20 pm Amit Shah

atapi: GESN: Standardise event response handling for future additions

Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a
generic way so that future additions to the code to handle other
response types is easier.

Signed-off-by: Amit Shah <>...

8f8e834d 04/13/2011 01:20 pm Amit Shah

atapi: GESN: Use structs for commonly-used field types

Instead of using magic numbers, use structs that are more descriptive of
the fields being used.

Signed-off-by: Amit Shah <>
Acked-by: Jes Sorensen <>
Acked-by: Paolo Bonzini <>...

493accd6 04/13/2011 01:20 pm Amit Shah

atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function

This makes the code more readable.

Also, there's a block like:

if () {
...
} else {
...
}

Split that into

if () {
...
return;
}
...

Signed-off-by: Amit Shah <>...

0c370a35 04/13/2011 01:19 pm Amit Shah

atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change

After a media change, the only commands allowed from the guest were
REQUEST_SENSE and INQUIRY. The guest may also issue
GET_EVENT_STATUS_NOTIFICATION commands to get media
changed notification....

8aa71917 04/13/2011 01:06 pm Amit Shah

atapi: Drives can be locked without media present

Drivers are free to lock drives without any media present. Such a
condition should not result in an error condition.

See Table 341 in MMC-5 spec for details.

Signed-off-by: Amit Shah <>...

88f2bb58 04/13/2011 01:06 pm Amit Shah

atapi: Report correct errors on guest eject request

Table 629 of the MMC-5 spec mentions two different error conditions when
a CDROM eject is requested: a) while a disc is inserted and b) while a
disc is not inserted.

Ensure we return the appropriate error for the present condition of the...

75717903 04/07/2011 02:51 pm Isaku Yamahata

ide: consolidate drive_get(IF_IDE)

factor out ide initialization to call drive_get(IF_IDE)

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Kevin Wolf <>

aa315f95 03/21/2011 10:28 pm Aurelien Jarno

Merge branch 'for-anthony' of git://github.com/bonzini/qemu

  • 'for-anthony' of git://github.com/bonzini/qemu:
    remove qemu_get_clock
    add a generic scaling mechanism for timers
    change all other clock references to use nanosecond resolution accessors
    change all rt_clock references to use millisecond resolution accessors...
74475455 03/21/2011 10:23 am Paolo Bonzini

change all other clock references to use nanosecond resolution accessors

This was done with:

sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \
$(git grep -l 'qemu_get_clock\>' )
sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \
$(git grep -l 'qemu_new_timer\>' )...
b93af93d 03/15/2011 02:21 pm Brian Wheeler

Fix ATA SMART and CHECK POWER MODE

This patch fixes two things:

1) CHECK POWER MODE

The error return value wasn't always zero, so it would show up as
offline. Error is now explicitly set to zero.

2) SMART

The smart values that were returned were invalid and tools like skdump...

e07bbac5 02/14/2011 04:39 pm Jan Kiszka

Improve vm_stop reason declarations

Define and use dedicated constants for vm_stop reasons, they actually
have nothing to do with the EXCP_* defines used so far. At this chance,
specify more detailed reasons so that VM state change handlers can
evaluate them....

db97ee6a 01/31/2011 11:03 am Christoph Hellwig

block: tell drivers about an image resize

Extend the change_cb callback with a reason argument, and use it
to tell drivers about size changes.

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

596bb44d 01/24/2011 12:08 pm Christoph Hellwig

ide: also reset io_buffer_index for writes

Currenly the code only resets the io_buffer_index field for reads,
but the code seems to expect this for all types of I/O. I guess
we simply don't hit large enough transfers that would require this
often enough....

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

ide: kill ide_dma_submit_check

Merge ide_dma_submit_check into it's only caller. Also use tail recursion
using a goto instead of a real recursion - this avoid overflowing the
stack in the pathological situation of an recurring error that is ignored.
We'll still be busy looping in ide_dma_cb, but at least won't eat up...

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

1bdaa28d 12/17/2010 05:11 pm Alexander Graf

ide: honor ncq for atapi

ATAPI also can do ncq, so let's expose the capability.

This patch makes CD-ROM support work on Windows 7 for me.

Signed-off-by: Alexander Graf <>
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 <>

2ff61ff1 12/17/2010 05:11 pm Alexander Graf

ide: move transfer_start after variable modification

We hook into transfer_start and immediately call the end function
for ahci. This means that everything needs to be in place for the
end function when we start the transfer, so let's move the function
down to where all state is in place....

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

6ef2ba5e 12/17/2010 05:11 pm Alexander Graf

ide: fix whitespace gap in ide_exec_cmd

Now that we have the function split out, we have to reindent it.
In order to increase the readability of the actual functional change,
this is split out.

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

8337606d 11/29/2010 05:15 pm Kevin Wolf

ide: Factor ide_dma_set_inactive out

Several places that stop a DMA transfer duplicate this code. Factor it out into
a common function.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

e3982b3c 11/29/2010 05:15 pm Kevin Wolf

ide: Set bus master inactive on error

BMIDEA in the status register must be cleared on error. This makes FreeBSD
respond (more) correctly to I/O errors.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

b2df7531 11/04/2010 02:54 pm Kevin Wolf

ide: Handle immediate bdrv_aio_flush failure

If bdrv_aio_flush returns NULL, this should be treated as an error.

Signed-off-by: Kevin Wolf <>

a58b8d54 10/22/2010 03:49 pm Christoph Hellwig

ide: set WCACHE supported in IDENTIFY data

ATA does not only have the WCACHE enabled bit in identify word 85, but also
a WCACHE supported bit in word 82. While the Linux kernel is fine with the
latter at least hdparm also needs the former before correctly displaying...

6bcb1a79 10/22/2010 03:49 pm Kevin Wolf

ide: Factor ide_flush_cache out

The next patch reuses this code, so put it in its own function.

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

1b2adf28 09/21/2010 04:39 pm Christoph Hellwig

ide: propagate the required alignment

IDE is a bit ugly in this respect. For one it doesn't really keep track
of a sector size - most of the protocol is in units of 512 bytes, and we
assume 2048 bytes for CDROMs which is correct most of the time.

Second IDE allocates an I/O buffer long before we know if we're dealing...

79d1d331 09/08/2010 01:39 pm Jonathan A. Kollasch

Improve ATA IDENTIFY word 64 contents.

Fill in word 64 of IDENTIFY data to indicate support for PIO modes 3 and 4.
This allows NetBSD guests to use UltraDMA modes instead of just PIO mode 0.

Signed-off-by: Jonathan A. Kollasch <>
Signed-off-by: Kevin Wolf <>

2446333c 08/24/2010 06:22 pm Blue Swirl

Rearrange block headers

Changing block.h or blockdev.h resulted in recompiling most objects.

Move DriveInfo typedef and BlockInterfaceType enum definitions
to qemu-common.h and rearrange blockdev.h use to decrease churn.

Signed-off-by: Blue Swirl <>

cdc6f542 07/30/2010 10:12 pm Aurelien Jarno

Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin

  • 'for-anthony' of git://repo.or.cz/qemu/kevin:
    Fix -snapshot deleting images on disk change
    block: Use error codes from lower levels for error message
    block: default to 0 minimal / optiomal I/O size...
7bccf573 07/27/2010 06:32 pm Blue Swirl

Fix uint8_t comparisons with negative values

Fix the following warnings:
/src/qemu/hw/ide/core.c: In function `ide_drive_pio_post_load':
/src/qemu/hw/ide/core.c:2767: warning: comparison is always false due to limited range of data type

/src/qemu/ui/vnc-enc-tight.c: In function `tight_detect_smooth_image':...

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

253cb7b9 07/26/2010 02:39 pm Aurelien Jarno

ide/atapi: add support for GET EVENT STATUS NOTIFICATION

The GET EVENT STATUS NOTIFICATION is a mandatory command according
to MMC-3, even if event status notification is not supported.

This patch adds support for this command. It returns NEA ("No Event...

98f28ad7 07/13/2010 06:48 pm Markus Armbruster

ide scsi virtio-blk: Reject empty drives unless media is removable

Disks without media make no sense. For SCSI, a Linux guest kernel
complains during boot. I didn't try other combinations.

scsi-generic doesn't need the additional check, because it already...

7aa9c811 07/06/2010 06:05 pm Markus Armbruster

ide: Reject readonly drives unless CD-ROM

drive_init() doesn't permit option readonly for if=ide, but that's
worthless: we get it via if=none and -device.

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

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

ide: Reject invalid CHS geometry

drive_init() doesn't permit invalid CHS for if=ide, but that's
worthless: we get it via if=none and -device.

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

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

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

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