]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agoblock: Disable driver-specific options for 1.5
Kevin Wolf [Wed, 24 Apr 2013 13:29:29 +0000 (15:29 +0200)]
block: Disable driver-specific options for 1.5

We don't want to commit to the API yet before everything is worked out.
Disable it for the 1.5 release. This commit is meant to be reverted
after the 1.5 release.

The disabling of the driver-specific options is achieved by applying the
old checks while parsing the command line.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agosheepdog: implement .bdrv_co_is_allocated()
Liu Yuan [Tue, 23 Apr 2013 06:03:35 +0000 (14:03 +0800)]
sheepdog: implement .bdrv_co_is_allocated()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agosheepdog: use BDRV_SECTOR_SIZE
Liu Yuan [Tue, 23 Apr 2013 06:03:34 +0000 (14:03 +0800)]
sheepdog: use BDRV_SECTOR_SIZE

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agosheepdog: add discard/trim support for sheepdog
Liu Yuan [Tue, 23 Apr 2013 06:03:33 +0000 (14:03 +0800)]
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>
11 years agoblock/ssh: Require libssh2 >= 1.2.8.
Richard W.M. Jones [Fri, 19 Apr 2013 08:16:39 +0000 (09:16 +0100)]
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>
11 years agoMakefile: Use QEMU_FLAGS for DTC compilation
Peter Crosthwaite [Mon, 22 Apr 2013 04:41:28 +0000 (14:41 +1000)]
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>
11 years agoMakefile: Don't build shared libfdt
Peter Crosthwaite [Mon, 22 Apr 2013 04:40:49 +0000 (14:40 +1000)]
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>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Thu, 25 Apr 2013 20:57:27 +0000 (15:57 -0500)]
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>
11 years agoqemu-char: Set foo_tag = 0 when returning FALSE from callbacks
Hans de Goede [Thu, 25 Apr 2013 11:53:02 +0000 (13:53 +0200)]
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>
11 years agoRemove unnecessary FreeBSD #include
Ed Maste [Thu, 25 Apr 2013 16:17:11 +0000 (12:17 -0400)]
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>
11 years agoconsole: add dummy surface for guests without graphic card
Gerd Hoffmann [Thu, 25 Apr 2013 07:33:19 +0000 (09:33 +0200)]
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>
11 years agoconsole: zap ds arg from register_displaychangelistener
Gerd Hoffmann [Tue, 23 Apr 2013 13:44:31 +0000 (15:44 +0200)]
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>
11 years agoconsole: switch ppm_save to qemu_open
Gerd Hoffmann [Tue, 23 Apr 2013 11:26:59 +0000 (13:26 +0200)]
console: switch ppm_save to qemu_open

... so it works with fdset.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoconsole: add qemu_console_lookup_by_device
Gerd Hoffmann [Thu, 18 Apr 2013 05:30:40 +0000 (07:30 +0200)]
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>
11 years agoconsole: add device link to QemuConsoles
Gerd Hoffmann [Wed, 17 Apr 2013 08:21:27 +0000 (10:21 +0200)]
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>
11 years agoconsole: qom-ify QemuConsole
Gerd Hoffmann [Wed, 17 Apr 2013 07:45:10 +0000 (09:45 +0200)]
console: qom-ify QemuConsole

Just the minimal bits to turn QemuConsoles into Objects.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agomonitor: introduce query-command-line-options
Amos Kong [Thu, 25 Apr 2013 09:50:35 +0000 (17:50 +0800)]
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>
11 years agovirtio-ccw: Check indicators location.
Cornelia Huck [Tue, 23 Apr 2013 15:15:19 +0000 (17:15 +0200)]
virtio-ccw: Check indicators location.

If a guest neglected to register (secondary) indicators but still runs
with notifications enabled, we might end up writing to guest zero;
avoid this by checking for valid indicators and only writing to the
guest and generating an interrupt if indicators have been setup.

Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
11 years agopc: Kill the "use flash device for BIOS unless KVM" misfeature
Markus Armbruster [Fri, 12 Apr 2013 15:25:03 +0000 (17:25 +0200)]
pc: Kill the "use flash device for BIOS unless KVM" misfeature

Use of a flash memory device for the BIOS was added in series "[PATCH
v10 0/8] PC system flash support", commit 4732dca..1b89faf, v1.1.

Flash vs. ROM is a guest-visible difference.  Thus, flash use had to
be suppressed for machine types pc-1.0 and older.  This was
accomplished by adding a dummy device "pc-sysfw" with property
"rom_only":

* Non-zero rom_only means "use ROM".  Default for pc-1.0 and older.
* Zero rom_only means "maybe use flash".  Default for newer machines.

Not only is the dummy device ugly, it was also retroactively added to
the older machine types!  Fortunately, it's not guest-visible (thus no
immediate guest ABI breakage), and has no vmstate (thus no immediate
migration breakage).  Breakage occurs only if the user unwisely
enables flash by setting rom_only to zero.  Patch review FAIL #1.

Why "maybe use flash"?  Flash didn't (and still doesn't) work with
KVM.  Therefore, rom_only=0 really means "use flash, except when KVM
is enabled, use ROM".  This is a Bad Idea, because it makes enabling/
disabling KVM guest-visible.  Patch review FAIL #2.

Aside: it also precludes migrating between KVM on and off, but that's
not possible for other reasons anyway.

Fix as follows:

1. Change the meaning of rom_only=0 to mean "use flash, no ifs, buts,
or maybes" for pc-i440fx-1.5 and pc-q35-1.5.  Don't change anything
for older machines (to remain bug-compatible).

2. Change the default value from 0 to 1 for these machines.
Necessary, because 0 doesn't work with KVM.  Once it does, we can flip
the default back to 0.

3. Don't revert the retroactive addition of device "pc-sysfw" to older
machine types.  Seems not worth the trouble.

4. Add a TODO comment asking for device "pc-sysfw" to be dropped once
flash works with KVM.

Net effect is that you get a BIOS ROM again even when KVM is disabled,
just like for machines predating the introduction of flash.

To get flash instead, use "--global pc-sysfw.rom_only=0".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1365780303-26398-4-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: Split pc_init_pci_1_0() off pc_init_pci_1_2()
Markus Armbruster [Fri, 12 Apr 2013 15:25:02 +0000 (17:25 +0200)]
pc: Split pc_init_pci_1_0() off pc_init_pci_1_2()

Just to make the next commit easier to review.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1365780303-26398-3-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: Inline pc_init_pci_1_3() into pc_init_pci_1_2()
Markus Armbruster [Fri, 12 Apr 2013 15:25:01 +0000 (17:25 +0200)]
pc: Inline pc_init_pci_1_3() into pc_init_pci_1_2()

Just to make the commit after next easier to review.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1365780303-26398-2-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'alon/libcacard_ccid.1' into staging
Anthony Liguori [Wed, 24 Apr 2013 18:23:26 +0000 (13:23 -0500)]
Merge remote-tracking branch 'alon/libcacard_ccid.1' into staging

# By Alon Levy (15) and others
# Via Alon Levy
* alon/libcacard_ccid.1: (28 commits)
  libcacard/cac: change big switch functions to single return point
  dev-smartcard-reader: empty implementation for Mechanical (fail correctly)
  libcacard: move atr setting from macro to function
  libcacard/vreader: add debugging messages for apdu
  dev-smartcard-reader: copy atr protocol to ccid parameters
  dev-smartcard-reader: change default protocol to T=0
  dev-smartcard-reader: define structs for CCID_Parameter internals
  ccid-card-passthru, dev-smartcard-reader: add debug environment variables
  ccid-card-passthru: add atr check
  libcacard: change default ATR
  dev-smartcard-reader: reuse usb.h definitions
  dev-smartcard-reader: support windows guest
  dev-smartcard-reader: remove aborts (never triggered, but just in case)
  dev-smartcard-reader: nicer debug messages
  dev-smartcard-reader: white space fixes
  libcacard: remove default libcoolkey loading
  libcacard: remove sql: prefix
  libcacard: teach vscclient to use GMainLoop for portability
  libcacard: vscclient to use QemuThread for portability
  libcacard: split vscclient main() from socket reading
  ...

Message-id: 921423767.1475937.1366790789930.JavaMail.root@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agobuild: include config-{, all-}devices.mak after defining CONFIG_SOFTMMU and CONFIG_US...
Paolo Bonzini [Tue, 16 Apr 2013 08:50:38 +0000 (10:50 +0200)]
build: include config-{, all-}devices.mak after defining CONFIG_SOFTMMU and CONFIG_USER_ONLY

Moving the inclusions closer to Makefile, and before rules.mak, makes
Makefile and Makefile.target more consistent with each other.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1366102238-12374-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio: drop unused function prototypes.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:23 +0000 (10:21 +0200)]
virtio: drop unused function prototypes.

This removes the unused prototypes in virtio.h.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-8-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio: cleanup: init and exit function.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:22 +0000 (10:21 +0200)]
virtio: cleanup: init and exit function.

This clean the init and the exit functions and rename virtio_common_cleanup
to virtio_cleanup.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-7-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio: remove virtiobindings.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:21 +0000 (10:21 +0200)]
virtio: remove virtiobindings.

This remove virtio-bindings, and use class instead.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-6-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio: remove the function pointer.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:20 +0000 (10:21 +0200)]
virtio: remove the function pointer.

This remove the function pointer in VirtIODevice, and use only
VirtioDeviceClass function pointer.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-pci: cleanup.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:19 +0000 (10:21 +0200)]
virtio-pci: cleanup.

This remove the init, exit functions as they are no longer used.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-bus: make virtio_x_bus_new static.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:18 +0000 (10:21 +0200)]
virtio-bus: make virtio_x_bus_new static.

virtio_x_bus_new are only used in file scope.
So this make them static.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-bus: add new functions.
KONRAD Frederic [Wed, 24 Apr 2013 08:21:17 +0000 (10:21 +0200)]
virtio-bus: add new functions.

This add two functions:
   * virtio_bus_set_vdev_config.
   * virtio_bus_set_vdev_feature.

Needed by virtio-ccw.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366791683-5350-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: cleanup: use QOM casts.
KONRAD Frederic [Wed, 24 Apr 2013 08:08:01 +0000 (10:08 +0200)]
virtio-rng: cleanup: use QOM casts.

As the virtio-rng-pci, virtio-rng-s390 and virtio-rng-ccw are
switched to the new API, we can use QOM casts.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-9-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: cleanup: remove qdev field.
KONRAD Frederic [Wed, 24 Apr 2013 08:08:00 +0000 (10:08 +0200)]
virtio-rng: cleanup: remove qdev field.

The qdev field is no longer needed, just drop it.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-8-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: cleanup: init and exit functions.
KONRAD Frederic [Wed, 24 Apr 2013 08:07:59 +0000 (10:07 +0200)]
virtio-rng: cleanup: init and exit functions.

This remove old init and exit function as they are no longer needed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-7-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng-ccw: switch to the new API.
KONRAD Frederic [Wed, 24 Apr 2013 08:07:58 +0000 (10:07 +0200)]
virtio-rng-ccw: switch to the new API.

Here the virtio-rng-ccw is modified for the new API. The device
virtio-rng-pci extends virtio-pci. It creates and connects a virtio-rng-device
during the init. The properties are not changed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-6-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng-s390: switch to the new API.
KONRAD Frederic [Wed, 24 Apr 2013 08:07:57 +0000 (10:07 +0200)]
virtio-rng-s390: switch to the new API.

Here the virtio-rng-s390 is modified for the new API. The device
virtio-rng-s390 extends virtio-s390-device as before. It creates and
connects a virtio-rng during the init. The properties are not modified.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng-pci: switch to the new API.
KONRAD Frederic [Wed, 24 Apr 2013 08:07:56 +0000 (10:07 +0200)]
virtio-rng-pci: switch to the new API.

Here the virtio-rng-pci is modified for the new API. The device
virtio-rng-pci extends virtio-pci. It creates and connects a virtio-rng-device
during the init. The properties are not changed.

The virtio_pci_reset function, is removed as no longer used.
The virtio_pci_rst function, is renamed virtio_pci_reset.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: add virtio-rng device.
KONRAD Frederic [Wed, 24 Apr 2013 08:07:55 +0000 (10:07 +0200)]
virtio-rng: add virtio-rng device.

Create virtio-rng-device which extends virtio-device, so it can be connected on
virtio-bus.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: don't use pointer for configuration.
KONRAD Frederic [Wed, 24 Apr 2013 08:07:54 +0000 (10:07 +0200)]
virtio-rng: don't use pointer for configuration.

The configuration field must not be a pointer as it will be used for
virtio-rng properties. So *conf is replaced by conf.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoinput: introduce keyboard handler list
Gerd Hoffmann [Wed, 24 Apr 2013 10:08:38 +0000 (12:08 +0200)]
input: introduce keyboard handler list

Add a linked list of keyboard handlers.  Added handlers will go
to the head of the list.  Removed handlers will be zapped from
the list.  The head of the list will be used for events.

This fixes the keyboard-dead-after-usb-kbd-unplug issue, key events
will be re-routed to the ps/2 kbd instead of being discarded.

[ v2: fix cut+paste bug found my Markus ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1366798118-3248-3-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoinput: make QEMUPutLEDEntry + QEMUPutMouseEntry private
Gerd Hoffmann [Wed, 24 Apr 2013 10:08:37 +0000 (12:08 +0200)]
input: make QEMUPutLEDEntry + QEMUPutMouseEntry private

There is no need for anybody outside ui/input.c to access the
struct elements.  Move the definitions, leaving only the typedefs
in the header files.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1366798118-3248-2-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoich9: kill cmos_s3
Hu Tao [Wed, 24 Apr 2013 10:37:22 +0000 (18:37 +0800)]
ich9: kill cmos_s3

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366799842-18550-1-git-send-email-hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibcacard/cac: change big switch functions to single return point
Alon Levy [Mon, 4 Mar 2013 19:43:36 +0000 (21:43 +0200)]
libcacard/cac: change big switch functions to single return point

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: empty implementation for Mechanical (fail correctly)
Alon Levy [Tue, 5 Mar 2013 15:31:10 +0000 (17:31 +0200)]
dev-smartcard-reader: empty implementation for Mechanical (fail correctly)

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agolibcacard: move atr setting from macro to function
Alon Levy [Tue, 5 Mar 2013 14:27:43 +0000 (16:27 +0200)]
libcacard: move atr setting from macro to function

Only because qemu's checkpatch complains about it.

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agolibcacard/vreader: add debugging messages for apdu
Alon Levy [Tue, 5 Mar 2013 13:32:19 +0000 (15:32 +0200)]
libcacard/vreader: add debugging messages for apdu

Using g_debug with log domain libcacard

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: copy atr protocol to ccid parameters
Alon Levy [Mon, 4 Mar 2013 16:58:29 +0000 (18:58 +0200)]
dev-smartcard-reader: copy atr protocol to ccid parameters

Adds todos.

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: change default protocol to T=0
Alon Levy [Wed, 27 Mar 2013 08:14:15 +0000 (10:14 +0200)]
dev-smartcard-reader: change default protocol to T=0

We don't support T=1 so we shouldn't advertise it by default.

Two independent changes:
* Default ATR
 sets T=0. This gets overwritten by the client provided ATR later.
* Class descriptor
 changes dwAdvertise dwProtocols.PPPP to 0x1 and dwProtocols.RRRR=0 per spec.

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: define structs for CCID_Parameter internals
Alon Levy [Mon, 4 Mar 2013 16:57:45 +0000 (18:57 +0200)]
dev-smartcard-reader: define structs for CCID_Parameter internals

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agoccid-card-passthru, dev-smartcard-reader: add debug environment variables
Alon Levy [Mon, 4 Mar 2013 16:41:28 +0000 (18:41 +0200)]
ccid-card-passthru, dev-smartcard-reader: add debug environment variables

Introduces a new utility function: parse_debug_env to avoid code
duplication.

This overrides whatever debug value is set on the corresponding devices
from the command line, and is meant to ease the usage with any
management stack. For libvirt you can set environment variables by
extending the dom namespace, i.e:

<domain type='kvm' id='3' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <qemu:commandline>
    <qemu:env name='QEMU_CCID_PASSTHRU_DEBUG' value='4'/>
    <qemu:env name='QEMU_CCID_DEBUG' value='4'/>
  </qemu:commandline>
</domain>

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agoccid-card-passthru: add atr check
Alon Levy [Mon, 4 Mar 2013 16:39:09 +0000 (18:39 +0200)]
ccid-card-passthru: add atr check

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agolibcacard: change default ATR
Alon Levy [Tue, 5 Mar 2013 13:35:24 +0000 (15:35 +0200)]
libcacard: change default ATR

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: reuse usb.h definitions
Alon Levy [Tue, 5 Mar 2013 13:31:26 +0000 (15:31 +0200)]
dev-smartcard-reader: reuse usb.h definitions

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: support windows guest
Alon Levy [Mon, 4 Mar 2013 19:40:53 +0000 (21:40 +0200)]
dev-smartcard-reader: support windows guest

By not advertising USB wakeup support (which we don't).

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: remove aborts (never triggered, but just in case)
Alon Levy [Mon, 4 Mar 2013 16:55:07 +0000 (18:55 +0200)]
dev-smartcard-reader: remove aborts (never triggered, but just in case)

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: nicer debug messages
Alon Levy [Mon, 4 Mar 2013 16:50:33 +0000 (18:50 +0200)]
dev-smartcard-reader: nicer debug messages

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agodev-smartcard-reader: white space fixes
Alon Levy [Mon, 4 Mar 2013 16:45:49 +0000 (18:45 +0200)]
dev-smartcard-reader: white space fixes

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agolibcacard: remove default libcoolkey loading
Marc-André Lureau [Wed, 20 Mar 2013 13:07:49 +0000 (14:07 +0100)]
libcacard: remove default libcoolkey loading

Use only the modules defined in the NSS database.

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: remove sql: prefix
Marc-André Lureau [Wed, 20 Mar 2013 13:07:48 +0000 (14:07 +0100)]
libcacard: remove sql: prefix

For some reason, with sql:/ prefix, the PKCS11 modules are not loaded.

This patch goes on top of Alon smartcard series.

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: teach vscclient to use GMainLoop for portability
Marc-André Lureau [Mon, 25 Feb 2013 22:31:16 +0000 (23:31 +0100)]
libcacard: teach vscclient to use GMainLoop for portability

This version handles non-blocking sending and receiving from the
socket.

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: vscclient to use QemuThread for portability
Marc-André Lureau [Mon, 25 Feb 2013 22:31:15 +0000 (23:31 +0100)]
libcacard: vscclient to use QemuThread for portability

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: split vscclient main() from socket reading
Marc-André Lureau [Mon, 25 Feb 2013 22:31:14 +0000 (23:31 +0100)]
libcacard: split vscclient main() from socket reading

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: fix mingw64 cross-compilation
Marc-André Lureau [Mon, 25 Feb 2013 22:31:13 +0000 (23:31 +0100)]
libcacard: fix mingw64 cross-compilation

Compile and link with version.lo

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agobuild-sys: must link with -fstack-protector
Marc-André Lureau [Mon, 25 Feb 2013 22:31:12 +0000 (23:31 +0100)]
build-sys: must link with -fstack-protector

It is needed to give that flag to the linker as well, but latest
libtool 2.4.2 still swallows that argument, so let's pass it with
libtool -Wc argument.

qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to `__stack_chk_guard'

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agoutil: move socket_init() to osdep.c
Marc-André Lureau [Mon, 25 Feb 2013 22:31:11 +0000 (23:31 +0100)]
util: move socket_init() to osdep.c

vscclient needs to call socket_init() for portability.
Moving to osdep.c since it has no internal dependency.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: use system config directory for nss db on win32
Marc-André Lureau [Wed, 27 Feb 2013 20:08:06 +0000 (21:08 +0100)]
libcacard: use system config directory for nss db on win32

It's a bit nicer to look for default database under
CSIDL_COMMON_APPDATA\pki\nss rather that /etc/pki/nss.

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agoccid: declare DEFAULT_ATR table to be "static const"
Jim Meyering [Mon, 21 May 2012 19:51:33 +0000 (21:51 +0200)]
ccid: declare DEFAULT_ATR table to be "static const"

Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agoccid: make backend_enum_table "static const" and adjust users
Jim Meyering [Mon, 21 May 2012 19:56:20 +0000 (21:56 +0200)]
ccid: make backend_enum_table "static const" and adjust users

Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
11 years agoccid-card-emul: do not crash if backend is not provided
Marc-André Lureau [Wed, 21 Nov 2012 13:16:08 +0000 (14:16 +0100)]
ccid-card-emul: do not crash if backend is not provided

Program received signal SIGSEGV, Segmentation fault.
__strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164
164               movdqu        (%rsi), %xmm2
(gdb) bt
    at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:477
    at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:503

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agolibcacard: correct T0 historical bytes size
Marc-André Lureau [Sun, 2 Dec 2012 21:00:55 +0000 (22:00 +0100)]
libcacard: correct T0 historical bytes size

The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.

pcsc_scan was complaining before the patch:

+ Historical bytes: 56 43 41 52 44 5F 4E 53 53
 ERROR! ATR is truncated: 2 byte(s) is/are missing

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agoMove TPM passthrough specific command line options to backend structure
Stefan Berger [Mon, 22 Apr 2013 14:41:39 +0000 (10:41 -0400)]
Move TPM passthrough specific command line options to backend structure

Move the TPM passthrough specific command line options to the passthrough
backend implementation and attach them to the backend's interface structure.

Add code to tpm.c for validating the TPM command line options.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryan <coreyb@linux.vnet.ibm.com>
Message-id: 1366641699-21420-1-git-send-email-stefanb@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-9p: cleanup: QOM casts.
KONRAD Frederic [Tue, 23 Apr 2013 09:08:43 +0000 (11:08 +0200)]
virtio-9p: cleanup: QOM casts.

As the virtio-9p-pci is switched to the new API, we can use QOM casts.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-9p: cleanup: init function.
KONRAD Frederic [Tue, 23 Apr 2013 09:08:42 +0000 (11:08 +0200)]
virtio-9p: cleanup: init function.

This remove old init function as it is no longer needed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-9p-pci: switch to the new API.
KONRAD Frederic [Tue, 23 Apr 2013 09:08:41 +0000 (11:08 +0200)]
virtio-9p-pci: switch to the new API.

Here the virtio-9p-pci is modified for the new API. The device
virtio-9p-pci extends virtio-pci. It creates and connects a
virtio-9p-device during the init. The properties are not changed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-9p: add the virtio-9p device.
KONRAD Frederic [Tue, 23 Apr 2013 09:08:40 +0000 (11:08 +0200)]
virtio-9p: add the virtio-9p device.

Create virtio-9p-device which extends virtio-device, so it can be connected on
virtio-bus.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoui/gtk: Add Turkish translations
Ozan Çağlayan [Tue, 23 Apr 2013 10:04:16 +0000 (13:04 +0300)]
ui/gtk: Add Turkish translations

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Message-id: 1366711456-1935-1-git-send-email-ozancag@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoui/gtk: Use gtk_widget_get_window() to support both gtk2 and gtk3
Ozan Çağlayan [Tue, 23 Apr 2013 10:03:22 +0000 (13:03 +0300)]
ui/gtk: Use gtk_widget_get_window() to support both gtk2 and gtk3

This fixes build with gtk+-3.0.

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Message-id: 1366711402-1750-1-git-send-email-ozancag@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kraxel/usb.81' into staging
Anthony Liguori [Tue, 23 Apr 2013 15:33:45 +0000 (10:33 -0500)]
Merge remote-tracking branch 'kraxel/usb.81' into staging

# By Gerd Hoffmann (3) and Hans de Goede (1)
# Via Gerd Hoffmann
* kraxel/usb.81:
  usb-host: raise libusbx minimum version to 1.0.13
  usb: better speed mismatch error reporting
  ehci_free_packet: Discard finished packets when the queue is halted
  xhci: remove XHCIRing->base (unused)

Message-id: 1366705929-11251-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agousb-host: raise libusbx minimum version to 1.0.13
Gerd Hoffmann [Thu, 18 Apr 2013 10:16:44 +0000 (12:16 +0200)]
usb-host: raise libusbx minimum version to 1.0.13

Allows to remove one FIXME.  Makes LIBUSB_LOG_LEVEL_WARNING build errors
go away.  And starting with that version libusb has a LIBUSBX_API_VERSION
define which allows to easily #ifdef version dependencies should that
need arrive in the future.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb: better speed mismatch error reporting
Gerd Hoffmann [Thu, 18 Apr 2013 09:57:21 +0000 (11:57 +0200)]
usb: better speed mismatch error reporting

Report the supported speeds for device and port in the error message.
Also add the speeds to the tracepoint.  And while being at it drop
the redundant error message in usb_desc_attach, usb_device_attach will
report the error anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoehci_free_packet: Discard finished packets when the queue is halted
Hans de Goede [Tue, 9 Apr 2013 08:24:22 +0000 (10:24 +0200)]
ehci_free_packet: Discard finished packets when the queue is halted

With pipelining it is possible to encounter a finished packet when cleaning
the queue due to a halt. This happens when a non stall error happens while
talking to a real device. In this case the queue on the usb-host side will
continue processing packets, and we can have completed packets waiting in
the queue after an error condition packet causing a halt.

There are 2 reasons to discard the completed packets at this point, rather
then trying to writing them back to the guest:

1) The guest expect to be able to cancel and/or change packets after the
packet with the error without doing an unlink, so writing them back may
confuse the guest.

2) Since the queue does not advance when halted, the writing back of these
packets will fail anyways since p->qtdaddr != q->qtdaddr, so the
ehci_verify_qtd call in ehci_writeback_async_complete_packet will fail.

Note that 2) means that then only functional change this patch introduces
is the printing of a warning when this scenario happens.

Note that discarding these packets means that the guest driver and the device
will get out of sync! This is unfortunate, but should not be a problem since
with a non stall error (iow an io-error) the 2 are out of sync already anyways.
Still this patch adds a warning to signal this happening.

Note that sofar this has only been seen with a DVB-T receiver, which gives
of a MPEG-2 stream, which allows for recovering from lost packets, see:
https://bugzilla.redhat.com/show_bug.cgi?id=890320

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoxhci: remove XHCIRing->base (unused)
Gerd Hoffmann [Fri, 5 Apr 2013 11:03:08 +0000 (13:03 +0200)]
xhci: remove XHCIRing->base (unused)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoblock: Fix build with tracing enabled
Kevin Wolf [Mon, 22 Apr 2013 15:48:40 +0000 (17:48 +0200)]
block: Fix build with tracing enabled

filename was still uninitialised when it's used as a parameter to a
tracing function, so let's move the initialisation. Also, commit c2ad1b0c
forgot to add a NULL check, which this patch adds while we're at it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Andreas Färber <afaerber@suse.de>
Message-id: 1366645720-11384-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotpm: Simplify creation of cancel path
Stefan Berger [Tue, 16 Apr 2013 21:08:36 +0000 (17:08 -0400)]
tpm: Simplify creation of cancel path

Simplify the creation of the cancel path given the TPM's device path.
Given the path /dev/tpm0 build the path /sys/class/misc/tpm0/device/cancel.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1366146516-23814-1-git-send-email-stefanb@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqtest: Handle addresses and values for {in, out}[bwl] as unsigned
Peter Maydell [Sun, 21 Apr 2013 13:30:03 +0000 (14:30 +0100)]
qtest: Handle addresses and values for {in, out}[bwl] as unsigned

Handle the addresses and values for {in,out}[bwl] as unsigned (ie
with strtoul), as per the protocol specification comment. This fixes
a test failure in test_i440fx_defaults on 32-bit hosts where the test
tries to write 0x80000000 and qtest was instead writing 0x7fffffff.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1366551003-16649-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoAdd option to mlock qemu and guest memory
Satoru Moriya [Fri, 19 Apr 2013 14:42:06 +0000 (16:42 +0200)]
Add option to mlock qemu and guest memory

In certain scenario, latency induced by paging is significant and
memory locking is needed. Also, in the scenario with untrusted
guests, latency improvement due to mlock is desired.

This patch introduces a following new option to mlock guest and
qemu memory:

-realtime mlock=on|off

Signed-off-by: Satoru Moriya <satoru.moriya@hds.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366382526-26146-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: do not operate on sources from finalize callbacks
Paolo Bonzini [Fri, 19 Apr 2013 15:32:09 +0000 (17:32 +0200)]
qemu-char: do not operate on sources from finalize callbacks

Due to a glib bug, the finalize callback is called with the GMainContext
lock held.  Thus, any operation on the context from the callback will
cause recursive locking and a deadlock.  This happens, for example,
when a client disconnects from a socket chardev.

The fix for this is somewhat ugly, because we need to forego polymorphism
and implement our own function to destroy IOWatchPoll sources.  The
right thing to do here would be child sources, but we support older
glib versions that do not have them.  Not coincidentially, glib developers
found and fixed the deadlock as part of implementing child sources.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Message-id: 1366385529-10329-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: correct return value from chr_read functions
Paolo Bonzini [Fri, 19 Apr 2013 15:32:08 +0000 (17:32 +0200)]
qemu-char: correct return value from chr_read functions

Even if a CharDriverState's source is blocked by the front-end,
it must not be dropped. The IOWatchPoll that wraps it will take
care of adding and removing it to the main loop.  Only remove
the source when the channel is closed; and in that case, make sure
that the wrapping IOWatchPoll is removed too.

These should just be theoretical bugs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366385529-10329-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: simplify pty polling
Paolo Bonzini [Fri, 19 Apr 2013 15:32:07 +0000 (17:32 +0200)]
qemu-char: simplify pty polling

There is no need to use a timer and pty_chr_read to detect a connected
pty.  It is simpler to just call g_poll periodically and check for POLLHUP.
It is done once per second, and only if the pty is disconnected, so it
is cheap enough.

Tested with "-monitor pty" and "-serial mon:pty", both of which work
correctly and do not freeze QEMU.  (How to test ptys?  "socat -,raw,echo=0
/dev/pts/4,raw").

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366385529-10329-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: use consistent idiom for removing sources
Paolo Bonzini [Fri, 19 Apr 2013 15:32:06 +0000 (17:32 +0200)]
qemu-char: use consistent idiom for removing sources

Always check that the source is active, and zero the tag afterwards.

The occurrence in pty_chr_state will trigger with the next patch, the
others are just theoretical.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366385529-10329-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotranslate-all: fix compiler warning and linked error
Alexey Kardashevskiy [Mon, 22 Apr 2013 07:42:50 +0000 (17:42 +1000)]
translate-all: fix compiler warning and linked error

The code did use profile_getclock() but did not include
include/qemu/timer.h where this function is defined. The patch fixes this.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1366616571-4321-1-git-send-email-aik@ozlabs.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 22 Apr 2013 13:08:22 +0000 (08:08 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Kevin Wolf (16) and Stefan Hajnoczi (4)
# Via Kevin Wolf
* kwolf/for-anthony:
  qemu-iotests: add 053 unaligned compressed image size test
  block: Allow overriding backing.file.filename
  block: Remove filename parameter from .bdrv_file_open()
  vvfat: Use bdrv_open options instead of filename
  sheepdog: Use bdrv_open options instead of filename
  rbd: Use bdrv_open options instead of filename
  iscsi: Use bdrv_open options instead of filename
  gluster: Use bdrv_open options instead of filename
  curl: Use bdrv_open options instead of filename
  blkverify: Use bdrv_open options instead of filename
  blkdebug: Use bdrv_open options instead of filename
  raw-win32: Use bdrv_open options instead of filename
  raw-posix: Use bdrv_open options instead of filename
  block: Enable filename option
  block: Add driver-specific options for backing files
  block: Fail gracefully when using a format driver on protocol level
  qemu-iotests: Fix _filter_qemu
  qemu-img: do not zero-pad the compressed write buffer
  qcow: allow sub-cluster compressed write to last cluster
  qcow2: allow sub-cluster compressed write to last cluster

Message-id: 1366630294-18984-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/nbd-next' into staging
Anthony Liguori [Mon, 22 Apr 2013 13:05:14 +0000 (08:05 -0500)]
Merge remote-tracking branch 'bonzini/nbd-next' into staging

# By Stefan Hajnoczi
# Via Paolo Bonzini
* bonzini/nbd-next:
  nbd: set TCP_NODELAY
  nbd: use TCP_CORK in nbd_co_send_request()
  nbd: unlock mutex in nbd_co_send_request() error path

Message-id: 1366381830-11267-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Mon, 22 Apr 2013 13:05:05 +0000 (08:05 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

# By Paolo Bonzini (5) and others
# Via Paolo Bonzini
* bonzini/scsi-next:
  vhost-scsi-s390: new device supporting the tcm_vhost Linux kernel module
  vhost-scsi-ccw: new device supporting the tcm_vhost Linux kernel module
  vhost-scsi-pci: new device supporting the tcm_vhost Linux kernel module
  vhost-scsi: new device supporting the tcm_vhost Linux kernel module
  virtio: simplify Makefile conditionals
  virtio-scsi: create VirtIOSCSICommon
  vhost: Add vhost_commit callback for SeaBIOS ROM region re-mapping
  scsi: VMWare PVSCSI paravirtual device implementation
  scsi: avoid assertion failure on VERIFY command

Message-id: 1366381460-6041-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Mon, 22 Apr 2013 13:04:21 +0000 (08:04 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Amos Kong (1) and Luiz Capitulino (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event
  monitor: fix the wrong order of releasing keys

Message-id: 1366375833-995-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-iotests: add 053 unaligned compressed image size test
Stefan Hajnoczi [Tue, 16 Apr 2013 09:14:23 +0000 (11:14 +0200)]
qemu-iotests: add 053 unaligned compressed image size test

Test that qemu-img convert -c works when input image length is not a
multiple of the cluster size.

Previously an error message would be produced:

  qemu-img: error while compressing sector 0: Input/output error

Now that qcow2 and qcow handle this case the test passes successfully.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: Allow overriding backing.file.filename
Kevin Wolf [Fri, 12 Apr 2013 18:27:07 +0000 (20:27 +0200)]
block: Allow overriding backing.file.filename

If a filename is passed in the driver-specific options from the command
line, the backing file path from the image is ignored now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoblock: Remove filename parameter from .bdrv_file_open()
Kevin Wolf [Fri, 12 Apr 2013 18:02:37 +0000 (20:02 +0200)]
block: Remove filename parameter from .bdrv_file_open()

It is unused now in all block drivers.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agovvfat: Use bdrv_open options instead of filename
Kevin Wolf [Fri, 12 Apr 2013 17:42:04 +0000 (19:42 +0200)]
vvfat: Use bdrv_open options instead of filename

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agosheepdog: Use bdrv_open options instead of filename
Kevin Wolf [Fri, 12 Apr 2013 16:10:49 +0000 (18:10 +0200)]
sheepdog: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agorbd: Use bdrv_open options instead of filename
Kevin Wolf [Fri, 12 Apr 2013 16:05:35 +0000 (18:05 +0200)]
rbd: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>