qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 0e1a58: iotests: 153: Fix dead code


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 0e1a58: iotests: 153: Fix dead code
Date: Thu, 12 Jul 2018 10:24:28 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0e1a582750269d3dde0481ca034b08a5784e430c
      
https://github.com/qemu/qemu/commit/0e1a582750269d3dde0481ca034b08a5784e430c
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M tests/qemu-iotests/153
    M tests/qemu-iotests/153.out

  Log Message:
  -----------
  iotests: 153: Fix dead code

This step was left behind my mistake. As suggested by the echoed text,
the intention was to test two devices with the same image, with
different options. The behavior should be the same as two QEMU
processes. Complete it.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 2f9d4083f7fdafe82138e983a24ef30b81b029d7
      
https://github.com/qemu/qemu/commit/2f9d4083f7fdafe82138e983a24ef30b81b029d7
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M tests/qemu-iotests/common.rc

  Log Message:
  -----------
  iotests: nbd: Stop qemu-nbd before remaking image

197 is one example where _make_test_img is used twice without stopping
the NBD server in between. An error will occur like this:

    @@ -26,9 +26,13 @@

     === Partial final cluster ===

    +qemu-img: TEST_DIR/t.IMGFMT: Failed to get "resize" lock
    +Is another process using the image?
     Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1024
    +Failed to find an available port: Address already in use
     read 1024/1024 bytes at offset 0

Patch _make_test_img to stop the old qemu-nbd before starting a new one,
which fixes this problem, and similarly 215.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: eb461485f4558e362fab905735b50987505bca44
      
https://github.com/qemu/qemu/commit/eb461485f4558e362fab905735b50987505bca44
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M qemu-img.texi

  Log Message:
  -----------
  qemu-img: Document copy offloading implications with -S and -c

Explicitly enabling zero detection or compression suppresses copy
offloading during convert. Document it.

Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 230ff73904e72dde2d7718c2da407786a1c72e57
      
https://github.com/qemu/qemu/commit/230ff73904e72dde2d7718c2da407786a1c72e57
  Author: John Snow <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M block/file-posix.c
    M qemu-doc.texi

  Log Message:
  -----------
  file-posix: specify expected filetypes

Adjust each caller of raw_open_common to specify if they are expecting
host and character devices or not. Tighten expectations of file types upon
open in the common code and refuse types that are not expected.

This has two effects:

(1) Character and block devices are now considered deprecated for the
    'file' driver, which expects only S_IFREG, and
(2) no file-posix driver (file, host_cdrom, or host_device) can open
    directories now.

I don't think there's a legitimate reason to open directories as if
they were files. This prevents QEMU from opening and attempting to probe
a directory inode, which can break in exciting ways. One of those ways
is lseek on ext4/xfs, which will return 0x7fffffffffffffff as the file
size instead of EISDIR. This can coax QEMU into responding with a
confusing "file too big" instead of "Hey, that's not a file".

See: https://bugs.launchpad.net/qemu/+bug/1739304/
Signed-off-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 2d4cb49ddaa219ed3f5a985ecf8b188aeb2b3d6b
      
https://github.com/qemu/qemu/commit/2d4cb49ddaa219ed3f5a985ecf8b188aeb2b3d6b
  Author: John Snow <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    A tests/qemu-iotests/226
    A tests/qemu-iotests/226.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests: add test 226 for file driver types

Test that we're rejecting what we ought to for file,
host_driver and host_cdrom drivers. Test that we're
seeing the deprecated message for block and chardevs
on the file driver.

Signed-off-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 740842c9656cd5dbc9ccf2ea0c3a74f0ba35144a
      
https://github.com/qemu/qemu/commit/740842c9656cd5dbc9ccf2ea0c3a74f0ba35144a
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M hw/scsi/scsi-disk.c

  Log Message:
  -----------
  scsi-disk: Block Device Characteristics emulation fix

The current BDC VPD page (page 0xb1) is too short. This can be
seen running sg_utils:

$ sg_vpd --page=bdc /dev/sda
Block device characteristics VPD page (SBC):
Block device characteristics VPD page length too short=8

By the SCSI spec, the expected size of the SBC page is 0x40.
There is no telling how the guest will behave with a shorter
message - it can ignore it, or worse, make (wrong)
assumptions.

This patch fixes the emulation by setting the size to 0x40.
This is the output of the previous sg_vpd command after
applying it:

$ sg_vpd --page=bdc /dev/sda -v
    inquiry cdb: 12 01 b1 00 fc 00
Block device characteristics VPD page (SBC):
   [PQual=0  Peripheral device type: disk]
  Medium rotation rate is not reported
  Product type: Not specified
  WABEREQ=0
  WACEREQ=0
  Nominal form factor not reported
  FUAB=0
  VBULS=0

To improve readability, this patch also adds the VBULS value
explictly and add comments on the existing fields we're
setting.

Signed-off-by: Daniel Henrique Barboza <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 8dcd3c9b91a300c86e315d7e5427dce1383f7387
      
https://github.com/qemu/qemu/commit/8dcd3c9b91a300c86e315d7e5427dce1383f7387
  Author: Peter Lieven <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M qemu-img.c
    M tests/qemu-iotests/122.out

  Log Message:
  -----------
  qemu-img: align result of is_allocated_sectors

We currently don't enforce that the sparse segments we detect during convert are
aligned. This leads to unnecessary and costly read-modify-write cycles either
internally in Qemu or in the background on the storage device as nearly all
modern filesystems or hardware have a 4k alignment internally.

This patch modifies is_allocated_sectors so that its *pnum result will always
end at an alignment boundary. This way all requests will end at an alignment
boundary. The start of all requests will also be aligned as long as the results
of get_block_status do not lead to an unaligned offset.

The number of RMW cycles when converting an example image [1] to a raw device 
that
has 4k sector size is about 4600 4k read requests to perform a total of about 
15000
write requests. With this path the additional 4600 read requests are eliminated 
while
the number of total write requests stays constant.

[1] 
https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.vmdk

Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 68f1b569dccdf1bf2935d4175fffe84dae6997fc
      
https://github.com/qemu/qemu/commit/68f1b569dccdf1bf2935d4175fffe84dae6997fc
  Author: Peter Maydell <address@hidden>
  Date:   2018-07-12 (Thu, 12 Jul 2018)

  Changed paths:
    M block/file-posix.c
    M hw/scsi/scsi-disk.c
    M qemu-doc.texi
    M qemu-img.c
    M qemu-img.texi
    M tests/qemu-iotests/122.out
    M tests/qemu-iotests/153
    M tests/qemu-iotests/153.out
    A tests/qemu-iotests/226
    A tests/qemu-iotests/226.out
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/group

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- file-posix: Check correct file type (regular file for 'file',
  character or block device for 'host_device'/'host_cdrom')
- scsi-disk: Block Device Characteristics emulation fix
- qemu-img: Consider required alignment for sparse area detection
- Documentation and test improvements

# gpg: Signature made Thu 12 Jul 2018 17:29:17 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  qemu-img: align result of is_allocated_sectors
  scsi-disk: Block Device Characteristics emulation fix
  iotests: add test 226 for file driver types
  file-posix: specify expected filetypes
  qemu-img: Document copy offloading implications with -S and -c
  iotests: nbd: Stop qemu-nbd before remaking image
  iotests: 153: Fix dead code

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


Compare: https://github.com/qemu/qemu/compare/dc3c89d61225...68f1b569dccd
      **NOTE:** This service been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

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