1. 11 1月, 2019 1 次提交
  2. 17 12月, 2018 1 次提交
  3. 31 8月, 2018 1 次提交
    • E
      tests/libqos: Utilize newer glib spawn check · b8e1f74b
      Eric Blake 提交于
      During development, I got a 'make check' failure that claimed:
      
      qemu-img returned status code 32512
      **
      ERROR:tests/libqos/libqos.c:202:mkimg: assertion failed: (!rc)
      
      But 32512 is too big for a normal exit status value, which means we
      failed to use WEXITSTATUS() to shift the bits to the desired value
      for printing.  However, instead of worrying about how to portably
      parse g_spawn()'s rc in the proper platform-dependent manner, it's
      better to just rely on the fact that we now require glib 2.40 (since
      commit e7b3af81) and can therefore use glib's portable checker
      instead, where the message under my same condition improves to:
      
      Child process exited with code 127
      **
      ERROR:tests/libqos/libqos.c:192:mkimg: assertion failed: (ret && !err)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      b8e1f74b
  4. 24 8月, 2018 1 次提交
  5. 16 8月, 2018 3 次提交
    • M
      tests: Clean up string interpolation around qtest_qmp_device_add() · 82cab70b
      Markus Armbruster 提交于
      Leaving interpolation into JSON to qmp() is more robust than building
      QMP input manually, as explained in the commit before previous.
      
      qtest_qmp_device_add() and its wrappers interpolate into JSON as
      follows:
      
      * qtest_qmp_device_add() interpolates members into a JSON object.
      
      * So do its wrappers qpci_plug_device_test() and usb_test_hotplug().
      
      * usb_test_hotplug() additionally interpolates strings and numbers
        into JSON strings.
      
      Clean them up:
      
      * Have qtest_qmp_device_add() take its extra device properties as
        arguments for qdict_from_jsonf_nofail() instead of a string
        containing JSON members.
      
      * Drop qpci_plug_device_test(), use qtest_qmp_device_add()
        directly.
      
      * Change usb_test_hotplug() parameter @port to string, to avoid
        interpolation.  Interpolate @hcd_id separately.
      
      Bonus: gets rid of a non-literal format string.  A step towards
      compile-time format string checking without triggering
      -Wformat-nonliteral.
      
      Cc: Thomas Huth <thuth@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180806065344.7103-15-armbru@redhat.com>
      82cab70b
    • M
      tests: Clean up string interpolation into QMP input (simple cases) · 015715f5
      Markus Armbruster 提交于
      When you build QMP input manually like this
      
          cmd = g_strdup_printf("{ 'execute': 'migrate',"
                                "'arguments': { 'uri': '%s' } }",
                                uri);
          rsp = qmp(cmd);
          g_free(cmd);
      
      you're responsible for escaping the interpolated values for JSON.  Not
      done here, and therefore works only for sufficiently nice @uri.  For
      instance, if @uri contained a single "'", qobject_from_vjsonf_nofail()
      would abort.  A sufficiently nasty @uri could even inject unwanted
      members into the arguments object.
      
      Leaving interpolation into JSON to qmp() is more robust:
      
          rsp = qmp("{ 'execute': 'migrate', 'arguments': { 'uri': %s } }", uri);
      
      It's also more concise.
      
      Clean up the simple cases where we interpolate exactly a JSON value.
      
      Bonus: gets rid of non-literal format strings.  A step towards
      compile-time format string checking without triggering
      -Wformat-nonliteral.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180806065344.7103-13-armbru@redhat.com>
      015715f5
    • M
      libqtest: Rename functions to send QMP messages · 4277f1eb
      Markus Armbruster 提交于
      The functions to receive messages are called qtest_qmp_receive() and
      qmp_receive(), qmp_fd_receive().  The ones to send messages are called
      qtest_async_qmp(), qtest_async_qmpv(), qmp_async(), qmp_fd_send(),
      qmp_fd_sendv().  Inconsistent.  Rename the *_async* ones to
      qmp_send(), qtest_qmp_send(), qtest_qmp_vsend().  Rename
      qmp_fd_sendv() to qmp_fd_vsend().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180806065344.7103-2-armbru@redhat.com>
      4277f1eb
  6. 26 6月, 2018 1 次提交
    • P
      ahci: fix FIS I bit and PIO Setup FIS interrupt · ae79c2db
      Paolo Bonzini 提交于
      The "I" bit in PIO Setup and D2H FISes is exclusively a device concept
      and the irqstatus register in the controller does not matter.  The SATA
      spec says when it should be one; for D2H FISes in practice it is always
      set, while the PIO Setup FIS has several subcases that are documented in
      the patch.
      
      Also, the PIO Setup FIS interrupt is actually generated _after_ data
      has been received.
      
      Someone should probably spend some time reading the SATA specification and
      figuring out the more obscure fields in the PIO Setup FIS, but this is enough
      to fix SeaBIOS booting from ATAPI CD-ROMs over an AHCI controller.
      
      Fixes: 956556e1Reported-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 20180622165159.19863-1-pbonzini@redhat.com
      [Minor edit to avoid ATAPI comment ambiguity. --js]
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      ae79c2db
  7. 09 6月, 2018 2 次提交
    • J
      ahci: move PIO Setup FIS before transfer, fix it for ATAPI commands · 956556e1
      John Snow 提交于
      The PIO Setup FIS is written in the PIO:Entry state, which comes before
      the ATA and ATAPI data transfer states.  As a result, the PIO Setup FIS
      interrupt is now raised before DMA ends for ATAPI commands, and tests have
      to be adjusted.
      
      This is also hinted by the description of the command header in the AHCI
      specification, where the "A" bit is described as
      
          When ‘1’, indicates that a PIO setup FIS shall be sent by the device
          indicating a transfer for the ATAPI command.
      
      and also by the description of the ACMD (ATAPI command region):
      
          The ATAPI command must be either 12 or 16 bytes in length. The length
          transmitted by the HBA is determined by the PIO setup FIS that is sent
          by the device requesting the ATAPI command.
      
      QEMU, which conflates the "generator" and the "receiver" of the FIS into
      one device, always uses ATAPI_PACKET_SIZE, aka 12, for the length.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20180606190955.20845-3-jsnow@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      956556e1
    • J
      libqos/ahci: track sector size · 27e4648c
      John Snow 提交于
      It's not always 512, and it does wind up mattering for PIO tranfers,
      because this means DRQ blocks are four times as big for ATAPI.
      Replace an instance of 2048 with the correct define, too.
      
      This patch by itself winds changing no behavior. fis->count is ignored
      for CMD_PACKET, and sect_count only gets used in non-ATAPI cases.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20180606190955.20845-2-jsnow@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      27e4648c
  8. 08 6月, 2018 1 次提交
  9. 04 5月, 2018 1 次提交
  10. 05 3月, 2018 1 次提交
  11. 14 2月, 2018 7 次提交
  12. 09 2月, 2018 1 次提交
  13. 02 2月, 2018 1 次提交
    • G
      libqos/virtio: return length written into used descriptor · be3a6781
      Greg Kurz 提交于
      When a 9p request is flushed (ie, cancelled) by the guest, the device
      is expected to simply mark the request as used, without sending a 9p
      reply (ie, without writing anything into the used buffer).
      
      To be able to test this, we need access to the length written by the
      device into the used descriptor. This patch adds a uint32_t * argument
      to qvirtqueue_get_buf() and qvirtio_wait_used_elem() for this purpose.
      
      All existing users are updated accordingly.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      be3a6781
  14. 16 10月, 2017 1 次提交
  15. 20 9月, 2017 1 次提交
  16. 15 9月, 2017 2 次提交
  17. 30 6月, 2017 2 次提交
  18. 01 3月, 2017 5 次提交
  19. 31 1月, 2017 1 次提交
  20. 15 11月, 2016 4 次提交
  21. 28 10月, 2016 2 次提交
    • D
      libqos: Change PCI accessors to take opaque BAR handle · b4ba67d9
      David Gibson 提交于
      The usual use model for the libqos PCI functions is to map a specific PCI
      BAR using qpci_iomap() then pass the returned token into IO accessor
      functions.  This, and the fact that iomap() returns a (void *) which
      actually contains a PCI space address, kind of suggests that the return
      value from iomap is supposed to be an opaque token.
      
      ..except that the callers expect to be able to add offsets to it.  Which
      also assumes the compiler will support pointer arithmetic on a (void *),
      and treat it as working with byte offsets.
      
      To clarify this situation change iomap() and the IO accessors to take
      a definitely opaque BAR handle (enforced with a wrapper struct) along with
      an offset within the BAR.  This changes both the functions and all the
      callers.
      
      There were a number of places that checked if iomap() returned non-NULL,
      and or initialized it to NULL before hand.  Since iomap() already assert()s
      if it fails to map the BAR, these tests were mostly pointless and are
      removed.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      b4ba67d9
    • D
      tests: Don't assume structure of PCI IO base in ahci-test · e7c8526b
      David Gibson 提交于
      In a couple of places ahci-test makes assumptions about how the tokens
      returned from qpci_iomap() are formatted in ways it probably shouldn't.
      
      First in verify_state() it uses a non-NULL token to indicate that the AHCI
      device has been enabled (part of enabling is to iomap()).  This changes it
      to use an explicit 'enabled' flag instead.
      
      Second, it uses the fact that the token contains a PCI address, stored when
      the BAR is mapped during initialization to check that the BAR has the same
      value after a migration.  This changes it to explicitly read the BAR
      register before and after the migration and compare.
      
      Together, these changes will  make the test more robust against changes to
      the internals of the libqos PCI layer.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      e7c8526b