monitor: introduce query-command-line-options

Libvirt has no way to probe if an option or property is supported,
This patch introduces a new qmp command to query command line
option information. hmp command isn't added because it's not needed.

Signed-off-by: Amos Kong <akong@redhat.com>
CC: Luiz Capitulino <lcapitulino@redhat.com>
CC: Osier Yang <jyang@redhat.com>
CC: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
console: qom-ify QemuConsole

Just the minimal bits to turn QemuConsoles into Objects.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: add device link to QemuConsoles

So it is possible to figure which qemu console displays which device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: add qemu_console_lookup_by_device

Look up the QemuConsole for a given device, using the new link.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: switch ppm_save to qemu_open

... so it works with fdset.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: zap ds arg from register_displaychangelistener

We don't have multiple DisplayStates any more,
so passing it in as argument is not needed.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: add dummy surface for guests without graphic card

So users get a notification instead of a crash.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Remove unnecessary FreeBSD #include

sys/param.h was included to define __FreeBSD_version, but the conditional
using it was removed by commit d05ef160453e98546a4197496dc8a3cb2defac53
(Brad Smith, "Allow clock_gettime() monotonic clock to be utilized on more
OS's"), so the include is no longer needed here.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1366906631-2680-1-git-send-email-emaste@freebsd.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Set foo_tag = 0 when returning FALSE from callbacks

While reviewing some patches I found this problem where tcp_chr_accept
does not clear listen_tag when returning FALSE, leading to a double
g_source_remove of the underlying source. Not really a problem unless the id
gets re-used in between, but still something we should fix.

While at it I've also reviewed all the other code in qemu-char.c for
similar problems and found that pty_chr_timer has the same problem.

Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1366890782-10311-1-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Amos Kong
# Via Luiz Capitulino
* luiz/queue/qmp:
  monitor: introduce query-command-line-options

Message-id: 1366922656-32545-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Makefile: Don't build shared libfdt

The submodule DTC should just build and use DTC as static (the whole
motivation for using submod is lack of widespread distro support).

The .so causes build failures on some platforms, so adjust the make
target to just build the static lib.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Makefile: Use QEMU_FLAGS for DTC compilation

Build DTC as QEMU is built. Fixes the issue with mingw build which can't
handles DTC's default CFLAGS.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Add internal base vectors reg

Configurable at CPU synthesis/instantiation.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
linux-user: fix compile error due to stray colon at end of #ifdef line

Remove a stray colon from the end of a #ifdef line. Some versions
of gcc complain about this:
 linux-user/syscall.c: In function ‘do_syscall’:
 linux-user/syscall.c:7606:28: error: extra tokens at end of #ifdef directive [-Werror]

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
s390x: use CONFIG_INT128 to detect __uint128_t

Target s390x uses ad-hoc macro magic to guess if the compiler
supports the GCC extension __uint128_t.  This patch uses the
the dedicated macro CONFIG_INT128 defined by configure instead.

This fixes compilation with the CIL source code analyzer, which
uses GCC as a preprocessor but does not support __uint128_t.

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-doc: Option -ignore-environment removed.

Has been removed in commit fc9c54124d134dbd76338a92a91804dab2df8166.

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
virtio: Fix compilation without CONFIG_VHOST_SCSI

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
bsd-user: Track change in FreeBSD SYSCTL(9) types

Originally from Garrett Cooper in FreeBSD PR ports/155558
http://www.freebsd.org/cgi/query-pr.cgi?pr=155558

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/ssh: Require libssh2 >= 1.2.8.

libssh2 >= 1.2.8 is required to enable this block device (because
that version introduced the libssh2_session_handshake call).

Change the test to use pkg-config exclusively.  If the user requests
--enable-libssh2 and the minimum version is not available, then the
following error is displayed:

  $ ./configure --enable-libssh2

  ERROR: libssh2 >= 1.2.8 required for --enable-libssh2

If --enable-libssh2 is not specified, then the feature is silently
disabled if sufficiently new libssh2 is not available.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
sheepdog: add discard/trim support for sheepdog

The 'TRIM' command from VM that is to release underlying data storage for
better thin-provision is already supported by the Sheepdog.

This patch adds the TRIM support at QEMU part.

For older Sheepdog that doesn't support it, we return 0(success) to upper layer.

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>