[Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards

Philippe Mathieu-Daudé posted 4 patches 7 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180103214925.16677-1-f4bug@amsat.org
Test checkpatch failed
Test docker passed
Test ppc passed
Test s390x passed
qapi-schema.json         |  41 +++++++++++++
tests/libqos/sdbus.h     |  45 ++++++++++++++
hw/sd/sdbus-qmp.c        |  65 ++++++++++++++++++++
stubs/qmp_sdbus.c        |  12 ++++
tests/libqos/sdbus-qmp.c | 130 ++++++++++++++++++++++++++++++++++++++++
tests/libqos/sdbus.c     |  74 +++++++++++++++++++++++
tests/sdbus-test.c       | 151 +++++++++++++++++++++++++++++++++++++++++++++++
hw/sd/Makefile.objs      |   2 +-
stubs/Makefile.objs      |   1 +
tests/Makefile.include   |   3 +
10 files changed, 523 insertions(+), 1 deletion(-)
create mode 100644 tests/libqos/sdbus.h
create mode 100644 hw/sd/sdbus-qmp.c
create mode 100644 stubs/qmp_sdbus.c
create mode 100644 tests/libqos/sdbus-qmp.c
create mode 100644 tests/libqos/sdbus.c
create mode 100644 tests/sdbus-test.c
[Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards
Posted by Philippe Mathieu-Daudé 7 years, 9 months ago
Hi,

This RFC series intends to add a sdcard test in C using the libqos.

As I intended to explain previous series threads, I want a way to
access slave devices via their bus rather than the bus master (SDHCI
in this case).
This way I can be sure the slave behaves correctly, then I can test
the host master device.

After spending too long different devices, I came back to the original
idea than using QMP is the simplest way to do it.

- patch 1 adds a QMP command to run commands on the bus,
- patch 2 exposes the libqos sdbus API,
- patch 3 intends to implement the previous API for the QMP command
(the API is here since I tried few other devices before, as you can see in [1])
  it is way broken and leaks lot of qobjects, but worked enough to verify the
  previous series (SDCard: improve SPI, introduce new Specs)
- patch 4 is the WIP qtest I started to backport from my previous python qtests

Since v1:
- dropped Python
- prefix QMP command with 'x-debug-' (Kevin Wolf)

Regards,

Phil.

some pain shared here:
[1]: http://lists.nongnu.org/archive/html/qemu-devel/2018-01/msg00080.html

Based-on: 20180103212436.15762-26-f4bug@amsat.org

Philippe Mathieu-Daudé (4):
  sdbus: add a QMP command to access a SDBus
  libqos: add a sdbus API
  libqos: implement sdbus QMP driver
  tests: add some sdcard qtest

 qapi-schema.json         |  41 +++++++++++++
 tests/libqos/sdbus.h     |  45 ++++++++++++++
 hw/sd/sdbus-qmp.c        |  65 ++++++++++++++++++++
 stubs/qmp_sdbus.c        |  12 ++++
 tests/libqos/sdbus-qmp.c | 130 ++++++++++++++++++++++++++++++++++++++++
 tests/libqos/sdbus.c     |  74 +++++++++++++++++++++++
 tests/sdbus-test.c       | 151 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/sd/Makefile.objs      |   2 +-
 stubs/Makefile.objs      |   1 +
 tests/Makefile.include   |   3 +
 10 files changed, 523 insertions(+), 1 deletion(-)
 create mode 100644 tests/libqos/sdbus.h
 create mode 100644 hw/sd/sdbus-qmp.c
 create mode 100644 stubs/qmp_sdbus.c
 create mode 100644 tests/libqos/sdbus-qmp.c
 create mode 100644 tests/libqos/sdbus.c
 create mode 100644 tests/sdbus-test.c

-- 
2.15.1


Re: [Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards
Posted by no-reply@patchew.org 7 years, 9 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180103214925.16677-1-f4bug@amsat.org
Subject: [Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]            patchew/20180102234108.32713-1-laurent@vivier.eu -> patchew/20180102234108.32713-1-laurent@vivier.eu
 t [tag update]            patchew/20180103162400.10396-1-f4bug@amsat.org -> patchew/20180103162400.10396-1-f4bug@amsat.org
 t [tag update]            patchew/20180103164117.11850-1-f4bug@amsat.org -> patchew/20180103164117.11850-1-f4bug@amsat.org
Switched to a new branch 'test'
2fea93749f tests: add some sdcard qtest
0b1bb02ca7 libqos: implement sdbus QMP driver
fab57dc594 libqos: add a sdbus API
5059e2a76e sdbus: add a QMP command to access a SDBus

=== OUTPUT BEGIN ===
Checking PATCH 1/4: sdbus: add a QMP command to access a SDBus...
Checking PATCH 2/4: libqos: add a sdbus API...
ERROR: do not use C99 // comments
#91: FILE: tests/libqos/sdbus.c:61:
+    // TODO check rv?

total: 1 errors, 0 warnings, 126 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 3/4: libqos: implement sdbus QMP driver...
WARNING: line over 80 characters
#97: FILE: tests/libqos/sdbus-qmp.c:66:
+static ssize_t qmp_mmc_do_cmd(SDBusAdapter *adapter, enum NCmd cmd, uint32_t arg,

ERROR: do not use C99 // comments
#111: FILE: tests/libqos/sdbus-qmp.c:80:
+    //QDECREF(response);

total: 1 errors, 1 warnings, 138 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 4/4: tests: add some sdcard qtest...
ERROR: do not use C99 // comments
#70: FILE: tests/sdbus-test.c:32:
+    //[PROTO_MMC] = "vexpress-a9",

ERROR: do not use C99 // comments
#71: FILE: tests/sdbus-test.c:33:
+    //[PROTO_SPI] = "lm3s6965evb"

ERROR: do not use C99 // comments
#75: FILE: tests/sdbus-test.c:37:
+    //512 * M_BYTE,

ERROR: do not use C99 // comments
#76: FILE: tests/sdbus-test.c:38:
+    //1 * G_BYTE,

ERROR: do not use C99 // comments
#78: FILE: tests/sdbus-test.c:40:
+    //64 * G_BYTE,

ERROR: do not use C99 // comments
#96: FILE: tests/sdbus-test.c:58:
+    //g_assert_cmpuint(sz, ==, 0);

ERROR: space prohibited between function name and open parenthesis '('
#104: FILE: tests/sdbus-test.c:66:
+    g_assert_cmpmem (&response[3], 5, "QEMU!", 5);

ERROR: do not use C99 // comments
#138: FILE: tests/sdbus-test.c:100:
+    // TODO 8x: sdcard_read_data len 512

ERROR: do not use C99 // comments
#140: FILE: tests/sdbus-test.c:102:
+    //sz = sdbus_do_acmd(mmc, SEND_STATUS, 0, rca, &response);

ERROR: do not use C99 // comments
#141: FILE: tests/sdbus-test.c:103:
+    //g_free(response);

WARNING: line over 80 characters
#180: FILE: tests/sdbus-test.c:142:
+                path = g_strdup_printf("sdcard/%s/%lu", proto_name[iproto], sizes[isize]);

ERROR: do not use C99 // comments
#183: FILE: tests/sdbus-test.c:145:
+                // g_free(test)?

total: 11 errors, 1 warnings, 165 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Re: [Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards
Posted by Stefan Hajnoczi 7 years, 9 months ago
On Wed, Jan 03, 2018 at 06:49:21PM -0300, Philippe Mathieu-Daudé wrote:
> This RFC series intends to add a sdcard test in C using the libqos.

Thanks for adding sdbus support to libqos!

Stefan