qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] acd800: tests: Introduce generic device hot-p


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] acd800: tests: Introduce generic device hot-plug/hot-unplu...
Date: Fri, 15 Sep 2017 14:32:39 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: acd80015fbe28f4f513e036ad1db2a76738d1f53
      
https://github.com/qemu/qemu/commit/acd80015fbe28f4f513e036ad1db2a76738d1f53
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/libqos/pci.c
    M tests/libqos/usb.c
    M tests/libqtest.c
    M tests/libqtest.h
    M tests/usb-hcd-uhci-test.c
    M tests/usb-hcd-xhci-test.c
    M tests/virtio-scsi-test.c
    M tests/virtio-serial-test.c

  Log Message:
  -----------
  tests: Introduce generic device hot-plug/hot-unplug functions

A lot of tests provide code for adding and removing a device via the
device_add and device_del QMP commands. Maintaining this code in so many
places is cumbersome and error-prone (some of the code parts check the
responses for device deletion in an incorrect way, for example, we've got
to deal with both, error code and DEVICE_DEL event here). So let's provide
some proper generic functions for adding and removing a device instead.

The code for correctly unplugging a device has been taken from a patch
from Peter Xu.

Reviewed-by: Peter Xu <address@hidden>
Tested-by: Peter Xu <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: 33ea6cf712c2e98bb4cb266034e59958027e4b00
      
https://github.com/qemu/qemu/commit/33ea6cf712c2e98bb4cb266034e59958027e4b00
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/test-hmp.c

  Log Message:
  -----------
  tests/test-hmp: Remove puv3 and tricore_testboard from the blacklist

The problem with puv3 has been fixed with 0ac241bcf9f9d99a252a352a162f
('unicore32: abort when entering "x 0" on the monitor') and the problem
with tricore_testboard has been fixed with b190f477e29c7cd03a8fee49c96d
('qemu-system-tricore: segfault when entering "x 0" on the monitor').

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: db221e66d8117f810c8046ce42c156580e4292aa
      
https://github.com/qemu/qemu/commit/db221e66d8117f810c8046ce42c156580e4292aa
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/libqtest.c

  Log Message:
  -----------
  tests/libqtest: Use a proper error message if QTEST_QEMU_BINARY is missing

The user can currently still cause an abort() if running certain tests
(like the prom-env-test) without setting the QTEST_QEMU_BINARY first.
A similar problem has been fixed with commit 7c933ad61b8f3f51337
already, but forgot to also take care of the qtest_get_arch() function,
so let's introduce a proper wrapper around getenv("QTEST_QEMU_BINARY")
that can be used in both locations now.

Buglink: https://bugs.launchpad.net/qemu/+bug/1713434
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: 4446158a1a89d51d8724090aa8bd115729533e3a
      
https://github.com/qemu/qemu/commit/4446158a1a89d51d8724090aa8bd115729533e3a
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/libqos/pci.c

  Log Message:
  -----------
  tests: Fix broken ivshmem-server-msi/-irq tests

Broken with commit b4ba67d9a7025 ("libqos: Change PCI accessors to take
opaque BAR handle") a while ago, but nobody noticed since the tests are
not run by default: The msix_pba_bar is not correctly initialized
anymore if bir_pba has the same value as bir_table. With this fix,
"make check SPEED=slow" should work fine again.

Fixes: b4ba67d9a702507793c2724e56f98e9b0f7be02b
Tested-by: Cornelia Huck <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: f94b3f64e6572c8cec73a538588f7cd754bcfa88
      
https://github.com/qemu/qemu/commit/f94b3f64e6572c8cec73a538588f7cd754bcfa88
  Author: Eric Blake <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/test-qga.c

  Log Message:
  -----------
  test-qga: Kill broken and dead QGA_TEST_SIDE_EFFECTING code

Back when the test was introduced, in commit 62c39b307, the
test was set up to run qemu-ga directly on the host performing
the test, and defaults to limiting itself to safe commands.  At
the time, it was envisioned that setting QGA_TEST_SIDE_EFFECTING
in the environment could cover a few more commands, while noting
the potential danger of those side effects running in the host.

But this has NEVER been tested: if you enable the environment
variable, the test WILL fail.  One obvious reason: if you are not
running as root, you'll probably get a permission failure when
trying to freeze the file systems, or when changing system time.
Less obvious: if you run the test as root (wow, you're brave), you
could end up hanging if the test tries to log things to a
temporarily frozen filesystem.  But the cutest reason of all: if
you get past the above hurdles, the test uses invalid JSON in
test_qga_fstrim() (missing '' around the dictionary key 'minimum'),
and will thus fail an assertion in qmp_fd().

Rather than leave this untested time-bomb in place, rip it out.
Hopefully, as originally envisioned, we can find an opportunity
to test an actual sandboxed guest where the guest-agent has
full permissions and will not unduly affect the host running
the test - if so, 'git revert' can be used if desired, for
salvaging any useful parts of this attempt.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: 147731258d6087bc3ba0b299009bc2a3beec3c99
      
https://github.com/qemu/qemu/commit/147731258d6087bc3ba0b299009bc2a3beec3c99
  Author: Eric Blake <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M qtest.c

  Log Message:
  -----------
  qtest: Don't perform side effects inside assertion

Assertions should be separate from the side effects, since in
theory, g_assert() can be disabled (in practice, we can't really
ever do that).

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: e8fc894b6718e3e8bee783e5492cce4519423bdf
      
https://github.com/qemu/qemu/commit/e8fc894b6718e3e8bee783e5492cce4519423bdf
  Author: Eric Blake <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/numa-test.c

  Log Message:
  -----------
  numa-test: Use hmp()

Don't open-code something that has a convenient helper available.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: 4fb609adc91c9352ae72b82cef53002c2e32d7fb
      
https://github.com/qemu/qemu/commit/4fb609adc91c9352ae72b82cef53002c2e32d7fb
  Author: Eric Blake <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/libqtest.c

  Log Message:
  -----------
  libqtest: Remove dead qtest_instances variable

Prior to commit 063c23d9, we were tracking a list of parallel
qtest objects, in order to safely clean up a SIGABRT handler
only after the last connection quits.  But when we switched to
more of glib's infrastructure, the list became dead code that
is never assigned to.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: 7b899f4dd596dbb7d271f7fab36fbfffec84868e
      
https://github.com/qemu/qemu/commit/7b899f4dd596dbb7d271f7fab36fbfffec84868e
  Author: Eric Blake <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M tests/libqtest.h
    M tests/test-hmp.c

  Log Message:
  -----------
  qtest: Avoid passing raw strings through hmp()

hmp() passes its string argument through the sprintf() family;
with a proper attribute, gcc -Wformat warns us when we do something
dangerous like passing a non-constant format string.  Fortunately,
all our strings were safe, but checking whether the string can
contain an unintended % is easy to avoid and therefore worth doing.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>


  Commit: 5faf2d376af3cb4eb92da44c2580e08d39832caa
      
https://github.com/qemu/qemu/commit/5faf2d376af3cb4eb92da44c2580e08d39832caa
  Author: Peter Maydell <address@hidden>
  Date:   2017-09-15 (Fri, 15 Sep 2017)

  Changed paths:
    M qtest.c
    M tests/libqos/pci.c
    M tests/libqos/usb.c
    M tests/libqtest.c
    M tests/libqtest.h
    M tests/numa-test.c
    M tests/test-hmp.c
    M tests/test-qga.c
    M tests/usb-hcd-uhci-test.c
    M tests/usb-hcd-xhci-test.c
    M tests/virtio-scsi-test.c
    M tests/virtio-serial-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/huth/tags/check-20170915' into staging

Some fixes and improvements for various qtests by Eric and me.

# gpg: Signature made Fri 15 Sep 2017 08:37:21 BST
# gpg:                using RSA key 0x2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <address@hidden>"
# gpg:                 aka "Thomas Huth <address@hidden>"
# gpg:                 aka "Thomas Huth <address@hidden>"
# gpg:                 aka "Thomas Huth <address@hidden>"
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth/tags/check-20170915:
  qtest: Avoid passing raw strings through hmp()
  libqtest: Remove dead qtest_instances variable
  numa-test: Use hmp()
  qtest: Don't perform side effects inside assertion
  test-qga: Kill broken and dead QGA_TEST_SIDE_EFFECTING code
  tests: Fix broken ivshmem-server-msi/-irq tests
  tests/libqtest: Use a proper error message if QTEST_QEMU_BINARY is missing
  tests/test-hmp: Remove puv3 and tricore_testboard from the blacklist
  tests: Introduce generic device hot-plug/hot-unplug functions

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/d535f5d363e2...5faf2d376af3

reply via email to

[Prev in Thread] Current Thread [Next in Thread]