Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ide: Avoid canceling IDE DMA
The reason for not actually canceling the I/O is because withvirtualization and lots of VM running, a guest fs may mistake aoverload of the host, as an IDE timeout. So rather than canceling theI/O, it's safer to wait I/O completion and simulate that the I/O has...
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
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':...
Revert "ide save/restore current transfer fields"
This reverts commit 42ee76fe82093ba914f0dc83d2decbcf68866144.
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: fix migration in the middle of pio operation
ide: fix migration in the middle of a bmdma transfer
It reintroduces Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"
but using subsections. Added bonus is the addition of ide_dummy_transfer_stopto transfer_end_table, that was missing....
Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"
This reverts commit ed487bb1d69040b9dac64a4fc076d8dd82b131d6.
The conflicts are due to commit 4fc8d6711aff7a9c11e402c3d77b481609f9f486that is a fix to the ide_drive_pre_save() function. It reverts both...
ide/atapi: add support for GET EVENT STATUS NOTIFICATION
The GET EVENT STATUS NOTIFICATION is a mandatory command accordingto MMC-3, even if event status notification is not supported.
This patch adds support for this command. It returns NEA ("No Event...
ide scsi virtio-blk: Reject empty drives unless media is removable
Disks without media make no sense. For SCSI, a Linux guest kernelcomplains during boot. I didn't try other combinations.
scsi-generic doesn't need the additional check, because it already...
pci/multi function bit: fix vt82c686.c.
The file, vt82c686.c, was added after the change set ofb80d4a9887fa4b6cc63f8c3a13ab2a45054d3e5c andfecb93c45c749a4c994d8d12bdee17ce2012de9eare created, but before the patch series was commit.So similar fix is needed to vt82c686.c....
pci: don't overwrite multi functio bit in pci header type.
Don't overwrite pci header type.Otherwise, multi function bit which pci_init_header_type() setsappropriately is lost.Anyway PCI_HEADER_TYPE_NORMAL is zero, so it is unnecessary to zerowhich is already zero cleared....
Merge remote branch 'kwolf/for-anthony' into staging
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
qemu_ram_alloc: Add DeviceState and name parameters
These will be used to generate unique id strings for ramblocks. The namefield is required, the device pointer is optional as most callers don'thave a device. When there's no device or the device isn't a child of...
ide: Reject readonly drives unless CD-ROM
drive_init() doesn't permit option readonly for if=ide, but that'sworthless: we get it via if=none and -device.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Reject invalid CHS geometry
drive_init() doesn't permit invalid CHS for if=ide, but that'sworthless: we get it via if=none and -device.
ide: Improve error messages
Use error_report(), because it points to the error location.
Reword "tried to assign twice" messages to make it clear that we'recomplaining about the unit property.
Report invalid unit property instead of failing silently....
ide: Replace IDEState members is_cdrom, is_cf by drive_kind
The two aren't independent variables. Make that obvious.
ide: Make ide_init_drive() return success
It still always succeeds. The next commits will add failures.
qdev: Decouple qdev_prop_drive from DriveInfo
Make the property point to BlockDriverState, cutting out the DriveInfomiddleman. This prepares the ground for block devices that don't havea DriveInfo.
Currently all user-defined ones have a DriveInfo, because the only way...
block: Catch attempt to attach multiple devices to a blockdev
For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foohappily 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,...
block: Fix virtual media change for if=none
BlockDriverState member removable controls whether virtual mediachange (monitor commands change, eject) is allowed. It is set whenthe "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.
The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...
ide: Make PIIX and ISA IDE init functions return the qdev
pc: Fix CMOS info for drives defined with -device
Drives defined with drive if=ide get get created along with the IDEcontroller, inside machine>init(). That's before cmos_init().Drives defined with -device get created during generic device init.That's after cmos_init(). Because of that, CMOS has no information on...
ide: Make it explicit that ide_create_drive() can't fail
All callers of ide_create_drive() ignore its value. Currentlyharmless, because it fails only when qdev_init() fails, which failsonly when ide_drive_initfn() fails, which never fails.
Brittle. Change it to die instead of silently ignoring failure....
MIPS: Initial support of VIA IDE controller used by fulong mini pc
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
block: Move error actions from DriveInfo to BlockDriverState
That's where they belong semantically (block device host part), eventhough the actions are actually executed by guest device code.
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
ide: Remove useless IDEDeviceInfo members unit, drive
ide: Remove redundant IDEState member conf
Commit 428c149b added IDEState member conf to let commit 0009baf1 findthe BlockConf from there. It exists only for qdev drives, created viaide_drive_initfn(), not for drives created via ide_init2().
But for a qdev drive, we can just as well reach its IDEDevice, which...
ide: Split ide_init1() off ide_init2()
ide: Change ide_init_drive() to require valid dinfo argument
IDEState members drive_serial_str and version are now left empty untilan actual drive is connected. Before, they got a default value thatwas overwritten when a drive got connected. Doesn't matter, because...
ide: Split non-qdev code off ide_init2()
ide: Turn drive serial into a qdev property ide-drive.serial
It needs to be a qdev property, because it belongs to the drive'sguest part.
Bonus: info qtree now shows the serial number.
ide: Fix info qtree for ide-drive.ver
Show the actual default value instead of <null> when the property hasnot been set.
ide: Fix ide_dma_cancel
When cancelling a request, bdrv_aio_cancel may decide that it waits forcompletion of a request rather than for cancellation. IDE therefore can'tabandon its DMA status before calling bdrv_aio_cancel; otherwise the callbackof a completed request would use invalid data....
ide: make a table 'const'
cmd646: fix abort due to changed opaque pointer for ioport read
We cannot install different opaque pointer for read and writeof the same i/o address.
- handle zero address in bmdma_writeb_common and install the same opaque pointer for both read and write access....
cmd646: pass pci_dev as it needs it
Instead of doing tricks to get the pci_dev, just pass it in the 1stplace. Patch is a bit longer that reverting the pci_dev field, but itstates more clearly (IMHO) what we are doing.
It also fixes the bm test, now that you told me that ->unit is not...
Compile ide/macio only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditionalsince PPC is big endian.
Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakageby f7736b91c40a617e93505e32dcbd2cb56aad8a23.
Compile ide/core only once
Make win2k install hack unconditional as it is still restricted tox86 only in vl.c.
Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.
block: Emit BLOCK_IO_ERROR before vm_stop() call
The next commit will move the STOP event into do_vm_stop(), tohave the expected event sequence we need to emit the I/O errorevent before calling vm_stop().
The expected sequence is:
{ "event": "BLOCK_IO_ERROR" [...] }...
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
ide save/restore pio/atapi cmd transfer fields and io buffer
Save/restore information necessary to continue in progress PIO/ATAPI CMDtransfers.
This includes the IO buffer.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: add topology support
Export the physical block size in the ATA IDENTIFY command. Theother topology values are not supported in ATA so skip them.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: add topology qdev properties
Add three new qdev properties to export block topology information tothe guest. This is needed to get optimal I/O alignment for RAID arraysor SSDs.
The options are:
- physical_block_size to specify the physical block size of the device,...
ide: Generate BLOCK_IO_ERROR QMP event
Just call bdrv_mon_event() in the right place.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide save/restore current transfer fields
If migration takes place between write of the bmdma address register andwrite of the command register (to initiate DMA), the destination willnot properly start the DMA op, hanging the guest:
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen...
ide: device version property
This patch adds a new property named 'ver' to ide-drive which allows tospecify the version which the virtual disk/cdrom should report to theguest. By default this is the qemu version (i.e. 0.12). usage:
-drive if=none,id=disk,file=......
piix: symbolic constants
No functional changes. I verified that the generated binarydoes not change.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
cmd646: symbolic names for pci registers
workaround for cmd646 bmdma register access while no dma is active
This is a workaround only, and is a partial revertof a few changes to BMDMAState which removed pci_devfield on the way.
- cmd646 pci_from_bm() expects bm->unit value tocorrespond with bm data being passed to callback...
qdev: Replace device names containing whitespace
Device names with whitespace require quoting in the shell and in themonitor. Some of the offenders are also overly long. Some have amore convenient alias, some don't.
The place for verbose device names is DeviceInfo member desc. The...
Add "static" to please Sparse
ide: Use some already defined page macros instead of constants
Some PAGE constants were used instead of the macros we already havedefined in internal.h.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: implement stub for audio control/volume read
This implements the audio control or volume read support as needed bysome systems. A Conectiva Parolin system required this to detect an IDEdevice as CD-ROM, through the CDVOLREAD ioctl.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>...
Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is whatthey actually do) or introduce a parameter to distinguish reads and writes.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Implement rerror option
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/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
scsi: move scsi-disk.h -> scsi.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Tag isa-fdc, PIIX3 IDE and PIIX4 IDE as no-user
These devices are created automatically, and attempting to createanother one with -device fails with "qemu: hardware error:register_ioport_write: invalid opaque".
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
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.
Sparc64/x86: remove unneeded calls to device reset
PPC: remove unneeded calls to device reset
v3: don't call reset functions on cpu initialization
There is absolutely no need to call reset functions when initializingdevices. Since we are already registering them, calling qemu_system_reset()should suffice. Actually, it is what happens when we reboot the machine,...
ide: port ide mmio to vmstate
ide: port isa ide to vmstate
ide: port pmac ide to vmstate
ide: port pci ide to vmstate
ide: pre VMState functions are not needed anymore
ide: port ide_drive to vmstate
ide: microdrive cycle field is set as uint8_t
Really, it is used as a booleanSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: add VMSTATE_IDE_BUS and VMSTATE_IDE_DRIVES
ide: port microdrive to vmstate
ide: include bus in MMIOState
Change pointer to struct by embedded struct.
Adjust all callersSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: port idebus to vmstate
ide: change identify_data type to uint8_t
It is used everywhere as uint8_t except in one place. Cast to uint16_tin that placeSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: cmd646 ->unit has just the value that we want
Patchworks-ID: 35307Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: BMDMAState don't need a pci_dev field anymore
Patchworks-ID: 35306Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: change cast to DO_UPCAST
Patchworks-ID: 35293Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Remove cast in pci_register_bar
We already have a PCIDevice at that point
Patchworks-ID: 35296Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Remove duplicated definitions
Patchworks-ID: 35297Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: remove uselsess casts from void *
Patchworks-ID: 35298Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: create ide/pci.h for common ide pci definitions
Patchworks-ID: 35299Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: export needed ide-pci functions for split
Patchworks-ID: 35300Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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...
ide: PCIIDEState type field is not needed anymore
We have split the functions that needed it for cmd646
Patchworks-ID: 35302Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: 'secondary' field is only used by cmd646
Patchworks-ID: 35303Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: cmd646 we can get the pci device with container_of
Patchworks-ID: 35305Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Clean up test for qdev_init() failure
Some callers test for != 0, some for < 0. Normalize to < 0.
Patchworks-ID: 35171Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
Rename pci_create_noinit() to pci_create()
It's qdev_create() specialized for PCI, so name it accordingly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
switch ide bus to inplace allocation.
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
ide/isa: convert to qdev.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ide/pci: convert to qdev.
With this patch applied ide drives (when attached to a pci adapter) canbe 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...