migration: set f->is_write and flush in add_to_iovec

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: use a single I/O operation when writev_buffer is not defined

The recent patches to use vectored I/O for RAM migration caused a
regression in savevm speed.  To restore previous performance,
add data to the buffer in qemu_put_buffer_async whenever writev_buffer
is not available in the QEMUFile.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: drop is_write complications

The same QEMUFile is never used for both read and write.  Simplify
the logic to simply look for presence or absence of the right ops.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: simplify writev vs. non-writev logic

Check f->iovcnt in add_to_iovec, f->buf_index in qemu_put_buffer/byte.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
New cpu-max field in query-machines QMP command output

Alter the query-machines QMP command to output information about
maximum number of CPUs for each machine type with default value
set to 1 in case the number of max_cpus is not set.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Revert "New QMP command query-cpu-max and HMP command cpu_max"

This reverts commit 4d700430a20b3d53b7b15bc5f6666f7e570e3f2c as asked by
Luiz. The patch has been obsoleted by extending MachineInfo structure
by cpu-max field.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: use valid JSON in schema

* qapi-schema.json: JSON doesn't allow trailing commas.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
kvm: remove unused APIs

There are only used internally now, move them
out of header and out of stub.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
kvm: support any size for pio eventfd

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
kvm: support non datamatch ioeventfd

Adding restrictions just adds code.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Merge remote-tracking branch 'quintela/migration.next' into staging

# By Paolo Bonzini
# Via Juan Quintela
* quintela/migration.next:
  migration: simplify writev vs. non-writev logic
  migration: drop is_write complications
  migration: use a single I/O operation when writev_buffer is not defined
  migration: set f->is_write and flush in add_to_iovec

Message-id: 1365512961-15623-1-git-send-email-quintela@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Michal Novotny (2) and Eric Blake (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  qapi: use valid JSON in schema
  Revert "New QMP command query-cpu-max and HMP command cpu_max"
  New cpu-max field in query-machines QMP command output

Message-id: 1365775103-18737-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'stefanha/block' into staging

* stefanha/block:
  rbd: add an asynchronous flush
  iotests: Add 'check -ssh' option to test Secure Shell block device.
  block: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk.
  block: Add support for Secure Shell (ssh) block device.
  ide: refuse WIN_READ_NATIVE_MAX on empty device
  qemu-iotests: filter QEMU_PROG in 051.out
  qemu-iotests: Add test for -drive options
  qemu-iotests: A few more bdrv_pread/pwrite tests
  block: Introduce bdrv_pwritev() for qcow2_save_vmstate
  savevm: Implement block_writev_buffer()
  block: Introduce bdrv_writev_vmstate

Conflicts:
	savevm.c

aliguori: add f->pos parameter to writev_buffer().

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
arm: fix location of some include files

The recent rearrangement of include files had some minor errors:
 devices.h is not ARM specific and should not be in arm/
 arm.h should be in arm/

Move these two headers to correct this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add linux-headers to QEMU_INCLUDES

virtio/dataplane/vring.c requires the Linux headers and is built for all
targets. So we need to add the corresponding include to QEMU_INCLUDES to
avoid that outdated distribution headers are used.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Fix failure to create q35 machine

This is a regression introduced by c0907c9e6417c. How to reproduce:

$ qemu-system-x86_64 -nodefaults -vnc :0 -M q35
qemu-system-x86_64: Unknown device 'q35-pcihost' for default sysbus
Aborted (core dumped)

Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: Add lost ARM core again

Commit 0434e30afb6175212389811e0b28b948eb3c1e40 accidentally removed
the compilation of arm11mpcore.c.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
acpi: move declarations from pc.h to acpi.h

Functions defined in acpi/ should be declared in
acpi.h

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
acpi.h: make it self contained

Headers shouldn't assume another header is included,
pull in everything necessary.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure: fix TPM logic

A non-native i386 or x86_64 emulator should not have TPM passthrough
support, since the TPM is only present for those hosts.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>