[PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation

Lin Ma posted 4 patches 3 years, 11 months ago
Test docker-mingw@fedora failed
Test checkpatch failed
Test asan failed
Test docker-quick@centos7 failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200602074201.10879-1-lma@suse.com
Maintainers: Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>
There is a newer version of this series
block/block-backend.c          | 38 ++++++++++++++
block/io.c                     | 43 ++++++++++++++++
hw/scsi/scsi-disk.c            | 92 ++++++++++++++++++++++++++++++++++
include/block/accounting.h     |  1 +
include/scsi/constants.h       |  1 +
include/sysemu/block-backend.h |  2 +
6 files changed, 177 insertions(+)
[PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation
Posted by Lin Ma 3 years, 11 months ago
In this current design, The GET LBA STATUS parameter data only contains
an eight-byte header + one LBA status descriptor.

How to test:
host:~ # qemu-system-x86_64 \
...
-drive file=/vm0/disk0.raw,format=raw,if=none,id=drive0,discard=unmap \
-device scsi-hd,id=scsi0,drive=drive0 \
...


guest:~ # dd if=/dev/zero of=/dev/sda bs=512 seek=1024 count=256

guest:~ # sg_unmap -l 1024 -n 32 /dev/sda

guest:~ # sg_get_lba_status /dev/sda -l 1024
No indication of the completion condition
RTP=0
descriptor LBA: 0x0000000000000400  blocks: 32  deallocated

Lin Ma (4):
  block: Add bdrv_co_get_lba_status
  block: Add GET LBA STATUS support
  block: Add block accounting code for GET LBA STATUS
  scsi-disk: Add support for the GET LBA STATUS 16 command

 block/block-backend.c          | 38 ++++++++++++++
 block/io.c                     | 43 ++++++++++++++++
 hw/scsi/scsi-disk.c            | 92 ++++++++++++++++++++++++++++++++++
 include/block/accounting.h     |  1 +
 include/scsi/constants.h       |  1 +
 include/sysemu/block-backend.h |  2 +
 6 files changed, 177 insertions(+)

-- 
2.24.0


Re: [PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation
Posted by no-reply@patchew.org 3 years, 11 months ago
Patchew URL: https://patchew.org/QEMU/20200602074201.10879-1-lma@suse.com/



Hi,

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

Message-id: 20200602074201.10879-1-lma@suse.com
Subject: [PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
f21fd54 scsi-disk: Add support for the GET LBA STATUS 16 command
1cf515c block: Add block accounting code for GET LBA STATUS
fb4af56 block: Add GET LBA STATUS support
3e12b00 block: Add bdrv_co_get_lba_status

=== OUTPUT BEGIN ===
1/4 Checking commit 3e12b00c0380 (block: Add bdrv_co_get_lba_status)
ERROR: superfluous trailing semicolon
#47: FILE: block/io.c:2215:
+                wanted_bit1 = BDRV_BLOCK_ZERO >> 1;;

total: 1 errors, 0 warnings, 49 lines checked

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

2/4 Checking commit fb4af5679e29 (block: Add GET LBA STATUS support)
3/4 Checking commit 1cf515c04a31 (block: Add block accounting code for GET LBA STATUS)
4/4 Checking commit f21fd540cc03 (scsi-disk: Add support for the GET LBA STATUS 16 command)
WARNING: Block comments use a leading /* on a separate line
#81: FILE: hw/scsi/scsi-disk.c:1932:
+    /* 8 + 16 is the length in bytes of response header and

total: 0 errors, 1 warnings, 111 lines checked

Patch 4/4 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


The full log is available at
http://patchew.org/logs/20200602074201.10879-1-lma@suse.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation
Posted by no-reply@patchew.org 3 years, 11 months ago
Patchew URL: https://patchew.org/QEMU/20200602074201.10879-1-lma@suse.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      block/nvme.o
  CC      block/throttle-groups.o
/tmp/qemu-test/src/block/block-backend.c: In function 'blk_do_get_lba_status':
/tmp/qemu-test/src/block/block-backend.c:1666:5: error: implicit declaration of function 'bdrv_co_get_lba_status' [-Werror=implicit-function-declaration]
     return bdrv_co_get_lba_status(blk->root, offset, bytes, num_blocks,
     ^
/tmp/qemu-test/src/block/block-backend.c:1666:5: error: nested extern declaration of 'bdrv_co_get_lba_status' [-Werror=nested-externs]
/tmp/qemu-test/src/block/block-backend.c: In function 'blk_aio_get_lba_status_entry':
/tmp/qemu-test/src/block/block-backend.c:1676:33: error: dereferencing 'void *' pointer [-Werror]
     uint32_t *num_blocks = &data[0];
                                 ^
/tmp/qemu-test/src/block/block-backend.c:1677:37: error: dereferencing 'void *' pointer [-Werror]
     uint32_t *is_deallocated = &data[sizeof(uint32_t)];
                                     ^
cc1: all warnings being treated as errors
make: *** [block/block-backend.o] Error 1
make: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/block/io.c:2190:1: error: no previous prototype for 'bdrv_co_get_lba_status' [-Werror=missing-prototypes]
 bdrv_co_get_lba_status(BdrvChild *child, int64_t offset, int64_t bytes,
 ^
cc1: all warnings being treated as errors
make: *** [block/io.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 665, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=e0beb28f32564939b51782a3a5fc4b8e', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-3acrwdcl/src/docker-src.2020-06-02-03.50.11.11734:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=e0beb28f32564939b51782a3a5fc4b8e
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-3acrwdcl/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m17.058s
user    0m8.502s


The full log is available at
http://patchew.org/logs/20200602074201.10879-1-lma@suse.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation
Posted by no-reply@patchew.org 3 years, 11 months ago
Patchew URL: https://patchew.org/QEMU/20200602074201.10879-1-lma@suse.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      block/nvme.o
  CC      block/nbd.o
  CC      block/sheepdog.o
/tmp/qemu-test/src/block/block-backend.c:1666:12: error: implicit declaration of function 'bdrv_co_get_lba_status' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return bdrv_co_get_lba_status(blk->root, offset, bytes, num_blocks,
           ^
/tmp/qemu-test/src/block/block-backend.c:1666:12: note: did you mean 'blk_do_get_lba_status'?
/tmp/qemu-test/src/block/block-backend.c:1654:1: note: 'blk_do_get_lba_status' declared here
blk_do_get_lba_status(BlockBackend *blk, int64_t offset, int bytes,
^
/tmp/qemu-test/src/block/block-backend.c:1666:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    return bdrv_co_get_lba_status(blk->root, offset, bytes, num_blocks,
           ^
2 errors generated.
make: *** [/tmp/qemu-test/src/rules.mak:69: block/block-backend.o] Error 1
make: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/block/io.c:2190:1: error: no previous prototype for function 'bdrv_co_get_lba_status' [-Werror,-Wmissing-prototypes]
bdrv_co_get_lba_status(BdrvChild *child, int64_t offset, int64_t bytes,
^
1 error generated.
make: *** [/tmp/qemu-test/src/rules.mak:69: block/io.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 665, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=aaeff486206e49e6b5c30d0f96e9933a', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-sk0g3zzx/src/docker-src.2020-06-02-03.50.12.11895:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=aaeff486206e49e6b5c30d0f96e9933a
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-sk0g3zzx/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    4m28.592s
user    0m8.333s


The full log is available at
http://patchew.org/logs/20200602074201.10879-1-lma@suse.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH 0/4] Add Support for GET LBA STATUS 16 command in scsi emulation
Posted by no-reply@patchew.org 3 years, 11 months ago
Patchew URL: https://patchew.org/QEMU/20200602074201.10879-1-lma@suse.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      block/replication.o
  CC      block/throttle.o
/tmp/qemu-test/src/block/block-backend.c: In function 'blk_do_get_lba_status':
/tmp/qemu-test/src/block/block-backend.c:1666:12: error: implicit declaration of function 'bdrv_co_get_lba_status'; did you mean 'blk_do_get_lba_status'? [-Werror=implicit-function-declaration]
     return bdrv_co_get_lba_status(blk->root, offset, bytes, num_blocks,
            ^~~~~~~~~~~~~~~~~~~~~~
            blk_do_get_lba_status
/tmp/qemu-test/src/block/block-backend.c:1666:12: error: nested extern declaration of 'bdrv_co_get_lba_status' [-Werror=nested-externs]
/tmp/qemu-test/src/block/block-backend.c: In function 'blk_aio_get_lba_status_entry':
/tmp/qemu-test/src/block/block-backend.c:1676:33: error: dereferencing 'void *' pointer [-Werror]
     uint32_t *num_blocks = &data[0];
                                 ^
/tmp/qemu-test/src/block/block-backend.c:1677:37: error: dereferencing 'void *' pointer [-Werror]
     uint32_t *is_deallocated = &data[sizeof(uint32_t)];
                                     ^
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: block/block-backend.o] Error 1
make: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/block/io.c:2190:1: error: no previous prototype for 'bdrv_co_get_lba_status' [-Werror=missing-prototypes]
 bdrv_co_get_lba_status(BdrvChild *child, int64_t offset, int64_t bytes,
 ^~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/block/io.c: In function 'bdrv_co_get_lba_status':
/tmp/qemu-test/src/block/io.c:2194:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int ret;
         ^~~
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: block/io.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 665, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=130ab752886a4d91808d25eef0fb2b19', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-g7c0p0bd/src/docker-src.2020-06-02-03.54.28.23905:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=130ab752886a4d91808d25eef0fb2b19
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-g7c0p0bd/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    2m5.434s
user    0m8.029s


The full log is available at
http://patchew.org/logs/20200602074201.10879-1-lma@suse.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com