Commit graph

43045 commits

Author SHA1 Message Date
Thomas Huth fe02fc5209 hw/s390x: Remove superfluous return statements
The "return;" statements at the end of functions do not make
much sense, so let's remove them.

Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Thomas Huth 1063477834 hw/core/qdev: Remove superfluous return statement
The "return;" statement at the end of device_set_realized()
does not make much sense, so let's remove it.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Thomas Huth ff433bbb82 hw/acpi: Remove superfluous return statement
The "return;" statement at the end of acpi_memory_plug_cb()
does not make much sense, so let's remove it.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Thomas Huth 4e6f7cfbf9 hw/ide: Remove superfluous return statements
The "return;" statements at the end of functions do not make
much sense, so let's remove them.

Cc: qemu-block@nongnu.org
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Peter Maydell 529490e5d6 osdep.h: Include glib-compat.h in osdep.h rather than qemu-common.h
Our use of glib is now pervasive across QEMU. Move the include of glib-compat.h
from qemu-common.h to osdep.h so that it is more widely accessible and doesn't
get forgotten by accident. (Failure to include it will result in build failure
on old versions of glib which is likely to be unnoticed by most developers.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Peter Maydell 8f32510f1c scripts/checkpatch.pl: Don't allow special cases of unspaced operators
The checkpatch.pl script has a special case to permit the following
operators to have no spaces around them:
 <<  >>  &  ^  |  +  -  *  /  %

QEMU style prefers all operators to consistently have spacing around
them, so remove this special case handling. This avoids reviewers
having to manually note it during code review.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Cao jin a2a645d967 PCI Bonito: QOMify and cleanup
Also clear the code

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Cao jin 9f23b27d0d SH PCI Host: convert to realize()
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Cao jin b429d363ed gt64120: convert to realize()
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Johan Ouwerkerk 9763af08f8 Add missing syscall nrs. according to more recent Linux kernels
This change covers arm, aarch64, mips. Others to follow?

The change was prompted by QEMU warning about a syscall 384 (get_random())
with Debian armhf binaries (ARMv7).

Signed-off-by: Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Cao jin f922254c87 hw/misc/edu: Convert to realize()
for educational PCI device

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Marc-André Lureau 713572a7b5 configure: fix trace backend check
Found thanks to shellcheck!

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Cao jin 66c058cb69 xen/Makefile.objs: simplify
merge last two lines, keep alphabetic order.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Eric Blake b3afe33526 crypto: Fix typo in example
The example code wouldn't even compile, since it did not use
a consistent spelling for the Error ** parameter.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Thomas Huth 82407515fe MAINTAINERS: Add the correct device_tree.h file
device_tree.h is not in the main directory, but under
include/sysemu/ nowadays.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Zhu Lingshan 240125bc49 iscsi: fix readcapacity error message
fix:The error message for readcapacity 16 incorrectly mentioned
a readcapacity 10 failure, fixed the error message.

Signed-off-by: Zhu Lingshan <lszhu@suse.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Paolo Bonzini 34f22fc034 net: convert qemu_log to error_report, fix message
Ensure that the error is printed with the proper timestamp.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11 11:39:28 +03:00
Michael Tokarev 477cea9e6d linux-user: enable sigaltstack for all architectures
There is no reason to limit sigaltstack syscall to just a few
architectures and pretend it is not implemented for others.

If some architecture is not ready for this, that architecture
should be fixed instead.

This fixes LP#1516408.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-11 11:39:13 +03:00
Michael Tokarev 6e50216461 unicore32: convert get_sp_from_cpustate from macro to inline
All other architectures define get_sp_from_cpustate as an inline function,
only unicore32 uses a #define.  With this, some usages are impossible, for
example, enabling sigaltstack in linux-user/syscall.c results in

linux-user/syscall.c: In function ‘do_syscall’:
linux-user/syscall.c:8299:39: error: dereferencing ‘void *’ pointer [-Werror]
  get_sp_from_cpustate(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env));
                                       ^
linux-user/syscall.c:8299:39: error: request for member ‘regs’ in something not a structure or union

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-10 10:25:38 +03:00
Peter Maydell 6bb9ead762 sdl2/opengl: add opengl context and scanout support
ui/curses: Fix color attribute of monitor for curses
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWj66aAAoJEEy22O7T6HE4rSgP/iBVMpm5wZrOvxGZ7XV0wx7D
 /JiQ7J7oS6aWBpz0LFHeiseWMDX1/V2kEDe/3mwHqeNULfeZqlf9PIXwM8N6FX2Q
 tIO0DB7iTDg/nT10Q2gHsYQtaNcsuw1c8+mwOw20ogcBVTXqHw4tACPhZWthVNDQ
 sLeIwH0OU/n/Gf6E+tMAfourDH0SIM8wtw9UguGcR1PxbyDnvRv8gEiPty2qOnGq
 nTdIdmf54eCgll6qQRhZ3+53k1ShrTv7hn5GKRmQZSOFXe5JgBeUfoT6xZf/lIAf
 D9LdmAU9vuNK7m4TceEsIAzUvNG49jAsVQGUO6Ebk3rT3FSoNLfx7ION/N0xjDvt
 CAKGN1Ub/vuqPBl57/qb9AxTYcRPW5KgHSrALWrM7TTLY8xLa2cRjEd6kVYfPsvs
 rhhrfHeac3qiwg9sjKaHeXvcmOCSRX/pTzkER9RK7bIeMHyDu7x+WJvIkW5qdfSe
 1G62aXZIeSRlSfKDvdbn1zfu/gZ7uy8xtvG/3CrCcT5Qf3PqEr2KOPsq/S1C1BKN
 GSCnt+DcLNmdiwyESMluibdVx9Vh7urbOdCh9pebFjgswCPNRSXzyUji0Xkzwe8b
 BkBoSCqdu5Z0QmiapG83Y2e9e/uWqfyr/DAB/CiFf2wLgoiiP1usof3Euzez96oa
 i7q5dNgGuBlv25Z8ngT8
 =4sRO
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging

sdl2/opengl: add opengl context and scanout support
ui/curses: Fix color attribute of monitor for curses

# gpg: Signature made Fri 08 Jan 2016 12:42:02 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-ui-20160108-1:
  sdl2/opengl: add opengl context and scanout support
  ui/curses: Fix color attribute of monitor for curses

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-08 12:50:19 +00:00
Peter Maydell 9df2513730 usb: mtp and ohci fixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWj4wjAAoJEEy22O7T6HE4PegP/A9occg8K/vXW9WKm4qJLX3w
 MCSlyEnIVWkK6nRx8xQnzINxvxFg7KXmWU8Rkp8JY7NZOFpdo4/ivGObfl4B7bCY
 uHfdXAmU7RycT3m0TERS92fK95LPurN19q/66me1HH8orfOMBYmoVr7UILJaehUW
 ZHEka0lnPeTcs7AY59svUn8g6Xr4dn5zN0v0mEJemAjWmOiolMcX9P/hKskn7nPc
 kC3vu/vVFEXmKWVwAYrDasFltAJ1670tIvI8sNhPZeoD+wucMBLx29JJ8760AmJT
 kQO4vZkD0GM4AjDCvKt8tCn6XQt/5D+Fg9gdXtX7Nv8IbHhrLYrTM8iQsvT7dyCX
 JhY4USoKERjjttzDo6JbGZDYe5YwUP5U9QNXVTCw9oM8jfTA9o6evnFgASMEbGlW
 CZpZG+PCYe/x2MG4pMSVHYR/RZxNfncqdjX7jxr376zDGWt5ptnZWrNlL92O/+XI
 3biXorhsiJUtHMmrDIR8xhGn44F1/zVAvuP+1oqt7kMSr9p7wtxQ2RQEcVFQ7QJN
 KU6DEoC5EYjUEv74HIylHyrLGa1s+l1LUFS0c4TQGslO5BcjprF37l48q+o+3G9V
 nN6s+UqUhI8J8mvx7jE04xROPZmMf6oztw28j8EEMbHVvdyPgnCcJcHX0QuEBEWH
 fZrVjBLAT12RZk4Z7X6f
 =mdBV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160108-1' into staging

usb: mtp and ohci fixes.

# gpg: Signature made Fri 08 Jan 2016 10:14:59 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-usb-20160108-1:
  ohci: clear pending SOF on suspend
  ohci: delay first SOF interrupt
  usb-mtp: fix call to trace function
  usb-mtp: use safe variant when cleaning events list
  ohci: fix command HostControllerReset
  ohci: fix Host Controller USBRESET
  ohci: split reset method in 3 parts

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-08 11:24:15 +00:00
Gerd Hoffmann cb47dc9ab9 sdl2/opengl: add opengl context and scanout support
This allows virtio-gpu to render in 3d mode.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
2016-01-08 12:20:15 +01:00
OGAWA Hirofumi 4083733db5 ui/curses: Fix color attribute of monitor for curses
Current text_console_update() writes totally broken color attributes
to console_write_ch(). The format now is writing,

[WRONG]
	bold << 21 | fg << 12 | bg << 8 | char
	fg == 3bits curses color number
	bg == 3bits curses color number

I can't see this format is where come from. Anyway, this doesn't work
at all.

What curses expects is actually (and vga.c is using),

[RIGHT]
	bold << 21 | bg << 11 | fg << 8 | char
	fg == 3bits vga color number
	bg == 3bits vga color number

And curses set COLOR_PAIR() up to match this format, and curses's
chtype. I.e,

	bold | color_pair | char
	color_pair == (bg << 3 | fg)

To fix, this simply uses VGA color number everywhere except curses.c
internal. Then, convert it to above [RIGHT] format to write by
console_write_ch(). And as bonus, this reduces to expose curses define
to other parts (removes COLOR_* from console.c).

[Tested the first line is displayed as white on blue back for monitor
in curses console]

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Message-id: 87r3j95407.fsf@mail.parknet.co.jp
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 12:20:07 +01:00
Peter Maydell d9767f1bfa Block patches from 2015-12-23 until 2016-01-07.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQEcBAABCAAGBQJWjuqwAAoJEDuxQgLoOKytznIH/Ap0ldYSdwBouhZkpKRDwIwf
 5/9skIgwuDJ2DeGDqAcVEC4Nxq9HuUCz7DcXPAiTfFRM7ccpnSJJ5O0vfTuC353t
 59h1JYh2kLDLXEm4RdylLMeuLNGuc+avUtWGVVQOrjFmSQAO7z3nexmoNRL6ccqE
 Cd/Oe1I2QU65p/4YpyslKg0N8A/WrHjOsf58Coo2ZCGNh3GLCNuE5mpofXBeSfWB
 bFdaq2Uv9x3F+vVq5zx3iNt2J8kHXlwZBEEYACzs+2j7j7O5TedjHDjgBrirbxl/
 C3F8d+4JqhzAP141yZMO35z1hbehCaKddDZRuN8ryeMXSnBLU3hP9wm4Y1HLrJc=
 =bxBe
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-for-peter-2016-01-07' into staging

Block patches from 2015-12-23 until 2016-01-07.

# gpg: Signature made Thu 07 Jan 2016 22:46:08 GMT using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"

* remotes/maxreitz/tags/pull-block-for-peter-2016-01-07: (21 commits)
  iotests: Add test cases for blockdev-mirror
  qmp: Add blockdev-mirror command
  block: Add check on mirror target
  block: Extract blockdev part of qmp_drive_mirror
  block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE
  qemu-iotests: s390x: fix test 051
  iotests: 095: Filter _img_info output
  iotests: 095: Use TEST_IMG override instead of "mv"
  iotests: 050: Use TEST_IMG override instead of "mv"
  iotests: 038: Use TEST_IMG override instead of "mv"
  iotests: 037: Use TEST_IMG override instead of "mv"
  iotests: 034: Use TEST_IMG override instead of "mv"
  iotests: 028: Use TEST_IMG override instead of "mv"
  iotests: 024: Use TEST_IMG override instead of "mv"
  iotests: 020: Use TEST_IMG override instead of "mv"
  iotests: 019: Use TEST_IMG override instead of "mv"
  iotests: 018: Use TEST_IMG override instead of "mv"
  block/qapi: Clear err for further error
  block: use drained section in bdrv_close
  qemu-iotests: make check-block.sh work on out-of-tree builds
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-08 10:45:07 +00:00
Laurent Vivier 087462c773 ohci: clear pending SOF on suspend
On overcommitted CPU, kernel can be so slow that an interrupt can
be triggered by the device whereas the driver is not ready to receive
it. This drives us into an infinite loop.

On suspend, if a SOF interrupt is raised between the stop of the
device processing and the change of the device internal state to
OHCI_USB_SUSPEND (QEMU stops SOF timer on this state change), this
interrupt is never acknowledged.

This patch clears pending SOF interrupt on OHCI_USB_SUSPEND setting.

Some details:

- ohci_irq(): the OHCI interrupt handler, acknowledges the SOF IRQ
  only if the state of the driver (rh_state) is OHCI_STATE_RUNNING.
  So if this interrupt happens and the driver is not in this state,
  the function is called again and again, moving the system to a
  CPU starvation.

- ohci_rh_suspend(): the function stop the operation and acknowledge
  pending interrupts (but doesn't disable it). Later in the function,
  the device is moved to OHCI_SUSPEND_STATE, and the driver to
  OHCI_RH_SUSPENDED. If between the moment when the interrupt is
  acknowledged and the moment when the device is suspended a new
  interrupt is raised, it will be never acknowledged because the
  driver is now not in OHCI_RH_RUNNING state.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1452109525-32150-3-git-send-email-lvivier@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:29:24 +01:00
Laurent Vivier fd0a10cd20 ohci: delay first SOF interrupt
On overcommitted CPU, kernel can be so slow that an interrupt can
be triggered by the device whereas the driver is not ready to receive
it. This drives us into an infinite loop.

This does not happen on real hardware because real hardware never send
interrupt immediately after the controller has been moved to OPERATION state.

This patch tries to delay the first SOF interrupt to let driver exits from
the critical section (which is not protected against interrupts...)

Some details:

- ohci_irq(): the OHCI interrupt handler, acknowledges the SOF IRQ
  only if the state of the driver (rh_state) is OHCI_STATE_RUNNING.
  So if this interrupt happens and the driver is not in this state,
  the function is called again and again, moving the system to a
  CPU starvation.

- ohci_rh_resume(): the driver re-enables operation with OHCI_USB_OPER.
  In QEMU this start the SOF timer and QEMU starts to send IRQs. As
  the driver is not in OHCI_STATE_RUNNING and not protected against IRQ,
  the ohci_irq() can be called and the driver never moved to
  OHCI_STATE_RUNNING.

Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1452109525-32150-2-git-send-email-lvivier@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:29:24 +01:00
Bandan Das ec93e158b1 usb-mtp: fix call to trace function
trace_usb_mtp_inotify_event() was being called after the object was
being freed.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 1450861787-16213-3-git-send-email-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Bandan Das c22d5dcd7a usb-mtp: use safe variant when cleaning events list
usb_mtp_inotify_cleanup uses QLIST_FOREACH to pick events
from a list and free them which is incorrect. Use QLIST_FOREACH_SAFE
instead.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 1450861787-16213-2-git-send-email-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Hervé Poussineau 0922c3f606 ohci: fix command HostControllerReset
Specification says that: "This bit is set by HCD to initiate a software reset of HC."

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-4-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Hervé Poussineau 7d938fd14b ohci: fix Host Controller USBRESET
Specification says that, when entering this state, "the contents of the registers
(except Root Hub registers) are preserved by the HC. [...] The Root Hub is being reset,
which causes the Root Hub's downstream ports to be reset and possibly powered off."

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-3-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Hervé Poussineau 84d04e2162 ohci: split reset method in 3 parts
The three parts are:
- root hub reset (ohci_roothub_reset)
- host controller soft reset (ohci_soft_reset)
- host controller hard reset (ohci_hard_reset)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-2-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Fam Zheng 94ca2c7395 iotests: Add test cases for blockdev-mirror
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-6-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:18 +01:00
Fam Zheng df92562e68 qmp: Add blockdev-mirror command
This will start a mirror job from a named device to another named
device, its relation with drive-mirror is similar with blockdev-backup
to drive-backup.

In blockdev-mirror, the target node should be prepared by blockdev-add,
which will be responsible for assigning a name to the new node, so
we don't have 'node-name' parameter.

Signed-off-by: Fam Zheng <famz@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1450932306-13717-5-git-send-email-famz@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:18 +01:00
Fam Zheng e40e5027f6 block: Add check on mirror target
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-4-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:18 +01:00
Fam Zheng 4193cdd771 block: Extract blockdev part of qmp_drive_mirror
This is the part that will be reused by blockdev-mirror.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-3-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:18 +01:00
Fam Zheng 05e4d14bf3 block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE
It's necessary to distinguish source and target before we can add
blockdev-mirror, because we would want a concrete type of operation to
check on target bs before starting.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-2-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Bo Tu dd87de06fa qemu-iotests: s390x: fix test 051
Replace the remaining "-drive file..."
by "-drive file=...,if=none,id=$device_id", then x86 and s390x
can get the common output.
"if=ide, if=floppy, if=scsi" are not supported by s390x,
so these test cases are not executed for s390x platform.

Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com>
Message-id: 1451885360-20236-2-git-send-email-tubo@linux.vnet.ibm.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng f943078e42 iotests: 095: Filter _img_info output
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1450752561-9300-12-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 61b422265e iotests: 095: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1450752561-9300-11-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng ae7e0bf461 iotests: 050: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-10-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 1b935e1dc9 iotests: 038: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-9-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 9b652fbe1d iotests: 037: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-8-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 5581018400 iotests: 034: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-7-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 49557d656c iotests: 028: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-6-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng f19f11896e iotests: 024: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-5-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 71ad761766 iotests: 020: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-4-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng f2bbcd3f7f iotests: 019: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-3-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 9b337ae90a iotests: 018: Use TEST_IMG override instead of "mv"
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-2-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Fam Zheng 0fa296eb00 block/qapi: Clear err for further error
Since a5002d5 (block/qapi: allow best-effort query) we don't return at
this error, however err must be cleared before passing to
bdrv_query_snapshot_info_list below, as required by error API.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1450779107-26765-1-git-send-email-famz@redhat.com
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Paolo Bonzini fc27291daf block: use drained section in bdrv_close
bdrv_close is used when ejecting a medium.  Use a drained section to ensure
that all I/O goes to either the old medium or the bitbucket.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1450867706-19860-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00