diff options
| author | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-18 10:34:59 -0500 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-18 10:34:59 -0500 |
| commit | 0b0cb9d310edfe2b2d108f18be4f013a1e552cfd (patch) | |
| tree | 895e26169ccbcbeb7e7c40eaecb353dadd7afb21 /hw/fdc.c | |
| parent | df6606f4556a752d30a4eab26c626b6c34717ea8 (diff) | |
| parent | d551cd50a43b9998c7aa562db7c567f557fb58fd (diff) | |
| download | focaccia-qemu-0b0cb9d310edfe2b2d108f18be4f013a1e552cfd.tar.gz focaccia-qemu-0b0cb9d310edfe2b2d108f18be4f013a1e552cfd.zip | |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony: (39 commits) qemu-iotests: add 036 autoclear feature bit test qemu-iotests: add qcow2.py set-feature-bit command fdc-test: introduced qtest read_without_media fdc: fix implied seek while there is no media in drive qcow2: fix autoclear image header update xen: Don't peek behind the BlockDriverState abstraction xen: Don't change -drive if=xen device name during machine init block: Replace bdrv_get_format() by bdrv_get_format_name() qemu-img: document qed format on qemu-img man page qemu-iotests: COW with many AIO requests on the same cluster qemu-iotests: Some backing file COW tests qcow2: Fix avail_sectors in cluster allocation code qcow2: Simplify calculation for COW area at the end qcow2: always operate caches in writeback mode ide: support enable/disable write cache block: always open drivers in writeback mode block: add bdrv_set_enable_write_cache block: copy enable_write_cache in bdrv_append savevm: flush after saving vm state block: flush in writethrough mode after writes ...
Diffstat (limited to 'hw/fdc.c')
| -rw-r--r-- | hw/fdc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/fdc.c b/hw/fdc.c index 30d34e3f1d..78b4e3309c 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -159,6 +159,10 @@ static int fd_seek(FDrive *drv, uint8_t head, uint8_t track, uint8_t sect, drv->sect = sect; } + if (drv->bs == NULL || !bdrv_is_inserted(drv->bs)) { + ret = 2; + } + return ret; } @@ -1888,6 +1892,26 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl) return 0; } +ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds) +{ + ISADevice *dev; + + dev = isa_try_create(bus, "isa-fdc"); + if (!dev) { + return NULL; + } + + if (fds[0]) { + qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv); + } + if (fds[1]) { + qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv); + } + qdev_init_nofail(&dev->qdev); + + return dev; +} + void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, target_phys_addr_t mmio_base, DriveInfo **fds) { |