hw: move char backends to backends/

Braille and msmouse support is in hw/, but it is not hardware.
Move it to the backends/ directory.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move fifo.[ch] to libqemuutil

fifo.c is generic code that can be easily unit tested.  So it
belongs in libqemuutil.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move qdev-monitor.o to toplevel directory

qdev-monitor.c is the only "core qdev" file that is not used in
user-mode emulation, and it does not define anything that is used
by hardware models.  Remove it from the hw/ directory and
remove hw/qdev-monitor.h from hw/qdev.h too; this requires
some files to have some new explicitly includes.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move device-hotplug.o to toplevel, compile it once

The situation with device-hotplug.c is similar to qdev-monitor.c.
Add a stub for pci_drive_hot_add, so that it can be compiled once,
and move it out of hw/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-9p: use CONFIG_VIRTFS, not CONFIG_LINUX

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-9p: remove PCI dependencies from hw/9pfs/

Also move the 9p.h file to 9pfs/virtio-9p-device.h, for consistency
with the corresponding .c file.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
vt82c686: vt82c686 is not a PCI host bridge

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ppc: do not use ../ in include files

This simplifies the scripted execution of the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: include hw header files with full paths

Done with this script:

cd hw
for i in `find . -name '*.h' | sed 's/^..//'`; do
  echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
done | sed -i -f - `find . -type f`

This is so that paths remain valid as files are moved.

Instead, files in hw/dataplane are referenced with the relative path.
We know they are not going to move to include/, and they are the only
include files that are in subdirectories _and_ move.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
build: always link device_tree.o into emulators if libfdt available

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ppc: express FDT dependency of pSeries and e500 boards via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move boards and other isolated files to hw/ARCH

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arm: move files referencing CPU to hw/arm/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
i386: move files referencing CPU to hw/i386/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
m68k: move files referencing CPU to hw/m68k/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ppc: move files referencing CPU to hw/ppc/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ppc: move more files to hw/ppc

These sPAPR files do not implement devices, move them over.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
sh: move files referencing CPU to hw/sh4/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
iscsi: retry read, write, flush and unmap on unit attention check conditions

the storage might return a check condition status for various reasons.
(e.g. bus reset, capacity change, thin-provisioning info etc.)

currently all these informative status responses lead to an I/O error
which is populated to the guest. this patch introduces a retry mechanism
to avoid this.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
iscsi: add iscsi_truncate support

this patch adds iscsi_truncate which effectively allows for
online resizing of iscsi volumes. for this to work you have
to resize the volume on your storage and then call
block_resize command in qemu which will issue a
readcapacity16 to update the capacity.

v4:
  - factor out complete readcapacity logic into a separate function
  - handle capacity change check condition in readcapacity function
    (this happens if the block_resize cmd is the first iscsi task
    executed after a resize on the storage)

v3:
  - remove switch statement in iscsi_open
  - create separate patch for brdv_drain_all() in bdrv_truncate()

v2:
  - add a general bdrv_drain_all() before bdrv_truncate() to avoid
    in-flight AIOs while the device is truncated
  - since no AIOs are in flight we can use a sync libiscsi call
    to re-read the capacity
  - factor out the readcapacity16 logic as it is redundant
    to iscsi_open() and iscsi_truncate().

Signed-off-by: Peter Lieven <pl@kamp.de>
[allow any type of unit attention check condition in iscsi_readcapacity_sync(),
 as in Message-ID: <51263A2A.6070304@dlhnet.de> - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>