qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 53fb78: block: Add a 'flags' param to bdrv_{p


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 53fb78: block: Add a 'flags' param to bdrv_{pread, pwrite, p...
Date: Tue, 12 Jul 2022 12:32:16 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 53fb7844f03241a0e6de2c342c9e1b89df12da4d
      
https://github.com/qemu/qemu/commit/53fb7844f03241a0e6de2c342c9e1b89df12da4d
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/blklogwrites.c
    M block/bochs.c
    M block/cloop.c
    M block/crypto.c
    M block/dmg.c
    M block/io.c
    M block/parallels-ext.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2-bitmap.c
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qed.c
    M block/vdi.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M include/block/block-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Add a 'flags' param to bdrv_{pread,pwrite,pwrite_sync}()

For consistency with other I/O functions, and in preparation to
implement them using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pread(child, offset, buf, bytes)
    + bdrv_pread(child, offset, buf, bytes, 0)

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pwrite(child, offset, buf, bytes)
    + bdrv_pwrite(child, offset, buf, bytes, 0)

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pwrite_sync(child, offset, buf, bytes)
    + bdrv_pwrite_sync(child, offset, buf, bytes, 0)

Resulting overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20220609152744.3891847-2-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 32cc71def9e3885f9527af713e6d8dc7521ddc08
      
https://github.com/qemu/qemu/commit/32cc71def9e3885f9527af713e6d8dc7521ddc08
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/blklogwrites.c
    M block/bochs.c
    M block/cloop.c
    M block/crypto.c
    M block/dmg.c
    M block/io.c
    M block/parallels-ext.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2-bitmap.c
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qed.c
    M block/vdi.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M include/block/block-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Change bdrv_{pread,pwrite,pwrite_sync}() param order

Swap 'buf' and 'bytes' around for consistency with
bdrv_co_{pread,pwrite}(), and in preparation to implement these
functions using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pread(child, offset, buf, bytes, flags)
    + bdrv_pread(child, offset, bytes, buf, flags)

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pwrite(child, offset, buf, bytes, flags)
    + bdrv_pwrite(child, offset, bytes, buf, flags)

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pwrite_sync(child, offset, buf, bytes, flags)
    + bdrv_pwrite_sync(child, offset, bytes, buf, flags)

Resulting overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20220609152744.3891847-3-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 353a5d84b25c335b259f37c4f43dad96e6d60ba8
      
https://github.com/qemu/qemu/commit/353a5d84b25c335b259f37c4f43dad96e6d60ba8
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/cloop.c
    M block/crypto.c
    M block/dmg.c
    M block/io.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/vdi.c
    M block/vmdk.c
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Make bdrv_{pread,pwrite}() return 0 on success

They currently return the value of their 'bytes' parameter on success.

Make them return 0 instead, for consistency with other I/O functions and
in preparation to implement them using generated_co_wrapper. This also
makes it clear that short reads/writes are not possible.

The few callers that rely on the previous behavior are adjusted
accordingly by hand.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-4-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 757dda54b43867936012970a1b457f3d16e7398d
      
https://github.com/qemu/qemu/commit/757dda54b43867936012970a1b457f3d16e7398d
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/crypto.c
    M block/qcow2.c
    M crypto/block-luks.c
    M crypto/block.c
    M include/crypto/block.h
    M tests/unit/test-crypto-block.c

  Log Message:
  -----------
  crypto: Make block callbacks return 0 on success

They currently return the value of their headerlen/buflen parameter on
success. Returning 0 instead makes it clear that short reads/writes are
not possible.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-5-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: ca71a64ee52eb0954541137026288970cc8213f7
      
https://github.com/qemu/qemu/commit/ca71a64ee52eb0954541137026288970cc8213f7
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M include/block/block_int-io.h

  Log Message:
  -----------
  block: Make bdrv_co_pwrite() take a const buffer

It does not mutate the buffer.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-6-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: c1458c66b2a56a86d4e453b52dfd2c06040fe006
      
https://github.com/qemu/qemu/commit/c1458c66b2a56a86d4e453b52dfd2c06040fe006
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/coroutines.h
    M include/block/block_int-io.h

  Log Message:
  -----------
  block: Make 'bytes' param of bdrv_co_{pread,pwrite,preadv,pwritev}() an 
int64_t

For consistency with other I/O functions, and in preparation to
implement bdrv_{pread,pwrite}() using generated_co_wrapper.

unsigned int fits in int64_t, so all callers remain correct.

bdrv_check_request32() is called further down the stack and causes -EIO
to be returned if 'bytes' is negative or greater than
BDRV_REQUEST_MAX_BYTES, which in turns never exceeds SIZE_MAX.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Message-Id: <20220609152744.3891847-7-afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 1d39c7098bbfa6862cb96066c4f8f6735ea397c5
      
https://github.com/qemu/qemu/commit/1d39c7098bbfa6862cb96066c4f8f6735ea397c5
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/io.c
    M include/block/block-io.h

  Log Message:
  -----------
  block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using 
generated_co_wrapper

bdrv_{pread,pwrite}() now return -EIO instead of -EINVAL when 'bytes' is
negative, making them consistent with bdrv_{preadv,pwritev}() and
bdrv_co_{pread,pwrite,preadv,pwritev}().

bdrv_pwrite_zeroes() now also calls trace_bdrv_co_pwrite_zeroes() and
clears the BDRV_REQ_MAY_UNMAP flag when appropriate, which it didn't
previously.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Message-Id: <20220609152744.3891847-8-afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: e97190a4057d42dce0322a23e6347101225ee39e
      
https://github.com/qemu/qemu/commit/e97190a4057d42dce0322a23e6347101225ee39e
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/io.c
    M include/block/block-io.h

  Log Message:
  -----------
  block: Add bdrv_co_pwrite_sync()

Also convert bdrv_pwrite_sync() to being implemented using
generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-9-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: a8f0e83cefa245dbaff8001c076e194ff54e8d1f
      
https://github.com/qemu/qemu/commit/a8f0e83cefa245dbaff8001c076e194ff54e8d1f
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/parallels.c
    M block/qcow2-snapshot.c
    M block/qcow2.c

  Log Message:
  -----------
  block: Use bdrv_co_pwrite_sync() when caller is coroutine_fn

Convert uses of bdrv_pwrite_sync() into bdrv_co_pwrite_sync() when the
callers are already coroutine_fn.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-10-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 86da43220c610321f31fad4be7f1b52554f4e7a4
      
https://github.com/qemu/qemu/commit/86da43220c610321f31fad4be7f1b52554f4e7a4
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  block/qcow2: Use bdrv_pwrite_sync() in qcow2_mark_dirty()

Use bdrv_pwrite_sync() instead of calling bdrv_pwrite() and bdrv_flush()
separately.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-11-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 3698f162323ef6908a658514fbca5cfd8c97f73c
      
https://github.com/qemu/qemu/commit/3698f162323ef6908a658514fbca5cfd8c97f73c
  Author: John Snow <jsnow@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M tests/qemu-iotests/223.out
    M tests/qemu-iotests/307.out

  Log Message:
  -----------
  tests/qemu-iotests: hotfix for 307, 223 output

Fixes: 58a6fdcc
Signed-off-by: John Snow <jsnow@redhat.com>
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220616142659.3184115-2-jsnow@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 92529251d2333ea07176cdbd7273483064ba5a7b
      
https://github.com/qemu/qemu/commit/92529251d2333ea07176cdbd7273483064ba5a7b
  Author: John Snow <jsnow@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M tests/qemu-iotests/108

  Log Message:
  -----------
  tests/qemu-iotests: skip 108 when FUSE is not loaded

In certain container environments we may not have FUSE at all, so skip
the test in this circumstance too.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20220616142659.3184115-3-jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: bf5b16fa401633475d21d69c66532f5b29e8433d
      
https://github.com/qemu/qemu/commit/bf5b16fa401633475d21d69c66532f5b29e8433d
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/qcow.c
    M hw/block/m25p80.c
    M hw/misc/mac_via.c
    M hw/misc/sifive_u_otp.c
    M hw/nvram/eeprom_at24c.c
    M hw/nvram/spapr_nvram.c
    M hw/ppc/pnv_pnor.c
    M qemu-img.c
    M qemu-io-cmds.c
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Make blk_{pread,pwrite}() return 0 on success

They currently return the value of their 'bytes' parameter on success.

Make them return 0 instead, for consistency with other I/O functions and
in preparation to implement them using generated_co_wrapper. This also
makes it clear that short reads/writes are not possible.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Message-Id: <20220705161527.1054072-2-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 3b35d4542c8537a9269f6372df531ced6c960084
      
https://github.com/qemu/qemu/commit/3b35d4542c8537a9269f6372df531ced6c960084
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/commit.c
    M block/export/fuse.c
    M hw/arm/allwinner-h3.c
    M hw/arm/aspeed.c
    M hw/block/block.c
    M hw/block/fdc.c
    M hw/block/hd-geometry.c
    M hw/block/m25p80.c
    M hw/block/nand.c
    M hw/block/onenand.c
    M hw/ide/atapi.c
    M hw/misc/mac_via.c
    M hw/misc/sifive_u_otp.c
    M hw/nvram/eeprom_at24c.c
    M hw/nvram/spapr_nvram.c
    M hw/nvram/xlnx-bbram.c
    M hw/nvram/xlnx-efuse.c
    M hw/ppc/pnv_pnor.c
    M hw/sd/sd.c
    M include/sysemu/block-backend-io.h
    M migration/block.c
    M nbd/server.c
    M qemu-img.c
    M qemu-io-cmds.c
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Add a 'flags' param to blk_pread()

For consistency with other I/O functions, and in preparation to
implement it using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression blk, offset, buf, bytes; @@
    - blk_pread(blk, offset, buf, bytes)
    + blk_pread(blk, offset, buf, bytes, 0)

It had no effect on hw/block/nand.c, presumably due to the #if, so that
file was updated manually.

Overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-3-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: a9262f551eba44d4d0f9e396d7124c059a93e204
      
https://github.com/qemu/qemu/commit/a9262f551eba44d4d0f9e396d7124c059a93e204
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/commit.c
    M block/crypto.c
    M block/export/fuse.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M hw/arm/allwinner-h3.c
    M hw/arm/aspeed.c
    M hw/block/block.c
    M hw/block/fdc.c
    M hw/block/hd-geometry.c
    M hw/block/m25p80.c
    M hw/block/nand.c
    M hw/block/onenand.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/ide/atapi.c
    M hw/misc/mac_via.c
    M hw/misc/sifive_u_otp.c
    M hw/nvram/eeprom_at24c.c
    M hw/nvram/spapr_nvram.c
    M hw/nvram/xlnx-bbram.c
    M hw/nvram/xlnx-efuse.c
    M hw/ppc/pnv_pnor.c
    M hw/sd/sd.c
    M include/sysemu/block-backend-io.h
    M migration/block.c
    M nbd/server.c
    M qemu-img.c
    M qemu-io-cmds.c
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Change blk_{pread,pwrite}() param order

Swap 'buf' and 'bytes' around for consistency with
blk_co_{pread,pwrite}(), and in preparation to implement these functions
using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression blk, offset, buf, bytes, flags; @@
    - blk_pread(blk, offset, buf, bytes, flags)
    + blk_pread(blk, offset, bytes, buf, flags)

    @@ expression blk, offset, buf, bytes, flags; @@
    - blk_pwrite(blk, offset, buf, bytes, flags)
    + blk_pwrite(blk, offset, bytes, buf, flags)

It had no effect on hw/block/nand.c, presumably due to the #if, so that
file was updated manually.

Overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-4-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 40fb4861b2d23c78a95a1d6f92591bc5f962c023
      
https://github.com/qemu/qemu/commit/40fb4861b2d23c78a95a1d6f92591bc5f962c023
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Make 'bytes' param of blk_{pread,pwrite}() an int64_t

For consistency with other I/O functions, and in preparation to
implement them using generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-5-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 7d252ba5caf094f03b032cad8bbef718a86712ae
      
https://github.com/qemu/qemu/commit/7d252ba5caf094f03b032cad8bbef718a86712ae
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Make blk_co_pwrite() take a const buffer

It does not mutate the buffer.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-6-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: facbaad946db92900654a3df8678b1dc7d581524
      
https://github.com/qemu/qemu/commit/facbaad946db92900654a3df8678b1dc7d581524
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h
    M block/meson.build
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Implement blk_{pread,pwrite}() using generated_co_wrapper

We need to add include/sysemu/block-backend-io.h to the inputs of the
block-gen.c target defined in block/meson.build.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-7-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 7c8cd723c7e3c108a62938bd7741c2db95fcfb8a
      
https://github.com/qemu/qemu/commit/7c8cd723c7e3c108a62938bd7741c2db95fcfb8a
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Add blk_{preadv,pwritev}()

Implement them using generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-8-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: d1d3fc3d1d3bf4749400df18462f8fef4c4ca1fb
      
https://github.com/qemu/qemu/commit/d1d3fc3d1d3bf4749400df18462f8fef4c4ca1fb
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Add blk_[co_]preadv_part()

Implement blk_preadv_part() using generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-9-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 09cca043bf68719f93f0ce1f1efafbec4ca72229
      
https://github.com/qemu/qemu/commit/09cca043bf68719f93f0ce1f1efafbec4ca72229
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Export blk_pwritev_part() in block-backend-io.h

Also convert it into a generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-10-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 0cadf2c8a37e15d3f3e1191024005e53dabb81f0
      
https://github.com/qemu/qemu/commit/0cadf2c8a37e15d3f3e1191024005e53dabb81f0
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend-io.h
    M qemu-img.c
    M qemu-io-cmds.c

  Log Message:
  -----------
  block: Change blk_pwrite_compressed() param order

Swap 'buf' and 'bytes' around for consistency with other I/O functions.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-11-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 2c9715fa28042ce84215dfd6b3bf35af90624e14
      
https://github.com/qemu/qemu/commit/2c9715fa28042ce84215dfd6b3bf35af90624e14
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Add blk_co_pwrite_compressed()

Also convert blk_pwrite_compressed() into a generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-12-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 1c95dc914a0218e58dc8d857b736b966a721d96d
      
https://github.com/qemu/qemu/commit/1c95dc914a0218e58dc8d857b736b966a721d96d
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Implement blk_pwrite_zeroes() using generated_co_wrapper

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-13-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 50db162df068e1951aebf5c28d254ded883e9468
      
https://github.com/qemu/qemu/commit/50db162df068e1951aebf5c28d254ded883e9468
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Implement blk_pdiscard() using generated_co_wrapper

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-14-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 25873f57c6c927999b5a613204acaa2e221d8e14
      
https://github.com/qemu/qemu/commit/25873f57c6c927999b5a613204acaa2e221d8e14
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Implement blk_flush() using generated_co_wrapper

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-15-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: df02da003daabe2666c13db3d539a7bce6f8b24b
      
https://github.com/qemu/qemu/commit/df02da003daabe2666c13db3d539a7bce6f8b24b
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Add blk_co_ioctl()

Also convert blk_ioctl() into a generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-16-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 015ed2529a1a1876f2a78de90b768361c6e79345
      
https://github.com/qemu/qemu/commit/015ed2529a1a1876f2a78de90b768361c6e79345
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Add blk_co_truncate()

Also convert blk_truncate() into a generated_co_wrapper.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-17-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 6f675c9306b732af8afafda91a0a3cd4e4ef97eb
      
https://github.com/qemu/qemu/commit/6f675c9306b732af8afafda91a0a3cd4e4ef97eb
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Reorganize some declarations in block-backend-io.h

Keep generated_co_wrapper and coroutine_fn pairs together. This should
make it clear that each I/O function has these two versions.

Also move blk_co_{pread,pwrite}()'s implementations out of the header
file for consistency.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220705161527.1054072-18-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 07a64aa47d0db696c9af48e88364558eb1430843
      
https://github.com/qemu/qemu/commit/07a64aa47d0db696c9af48e88364558eb1430843
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block/block-backend.c
    M block/coroutines.h

  Log Message:
  -----------
  block: Remove remaining unused symbols in coroutines.h

Some can be made static, others are unused generated_co_wrappers.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220705161527.1054072-19-afaria@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 1a8fd0e3e73806a5eca3384d49503e6bc50ca20d
      
https://github.com/qemu/qemu/commit/1a8fd0e3e73806a5eca3384d49503e6bc50ca20d
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M storage-daemon/qemu-storage-daemon.c

  Log Message:
  -----------
  qsd: Do not use error_report() before monitor_init

error_report() only works once monitor_init_globals_core() has been
called, which is not the case when parsing the --daemonize option.  Use
fprintf(stderr, ...) instead.

Fixes: 2525edd85fec53e23fda98974a15e3b3c8957596 ("qsd: Add --daemonize")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220609122852.21140-1-hreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


  Commit: 9907dba91dbcde20a8f966c8f22ae1635c5f7e78
      
https://github.com/qemu/qemu/commit/9907dba91dbcde20a8f966c8f22ae1635c5f7e78
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M tests/qemu-iotests/mypy.ini

  Log Message:
  -----------
  iotests/297: Have mypy ignore unused ignores

e7874a50ff3f5b20fb46f36958ad ("python: update for mypy 0.950") has added
`warn_unused_ignores = False` to python/setup.cfg, to be able to keep
compatibility with both pre- and post-0.950 mypy versions.

The iotests' mypy.ini needs the same, or 297 will fail (on both pre- and
post-0.950 mypy, as far as I can tell; just for different `ignore`
lines).

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220621092536.19837-1-hreitz@redhat.com>
Acked-by: John Snow <jsnow@redhat.com>


  Commit: 9d8f8233b9fa525a7e37350fbc18877051128c5d
      
https://github.com/qemu/qemu/commit/9d8f8233b9fa525a7e37350fbc18877051128c5d
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M storage-daemon/qemu-storage-daemon.c

  Log Message:
  -----------
  qsd: Unlink absolute PID file path

After writing the PID file, we register an atexit() handler to unlink it
when the process terminates.  However, if the process has changed its
working directory in the meantime (e.g. in os_setup_post() when
daemonizing), this will not work when the PID file path was relative.
Therefore, pass the absolute path (created with realpath()) to the
unlink() call in the atexit() handler.

(realpath() needs a path pointing to an existing file, so we cannot use
it before qemu_write_pidfile().)

Reproducer:
$ cd /tmp
$ qemu-storage-daemon --daemonize --pidfile qsd.pid
$ file qsd.pid
qsd.pid: ASCII text
$ kill $(cat qsd.pid)
$ file qsd.pid
qsd.pid: ASCII text

(qsd.pid should be gone after the process has terminated.)

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2092322
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220609122701.17172-2-hreitz@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: eed29d49ecc5d0db82b72538745223d09a54ee97
      
https://github.com/qemu/qemu/commit/eed29d49ecc5d0db82b72538745223d09a54ee97
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl: Conditionally register PID file unlink notifier

Currently, the exit notifier for unlinking the PID file is registered
unconditionally.  Limit it to only when we actually do create a PID
file.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220609122701.17172-3-hreitz@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 85c4bf8aa6c93c24876e8870ae7cf8ab2e5a96cf
      
https://github.com/qemu/qemu/commit/85c4bf8aa6c93c24876e8870ae7cf8ab2e5a96cf
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl: Unlink absolute PID file path

After writing the PID file, we register an exit notifier to unlink it
when the process terminates.  However, if the process has changed its
working directory in the meantime (e.g. in os_setup_post() when
daemonizing), this will not work when the PID file path was relative.
Therefore, pass the absolute path (created with realpath()) to the
unlink() call in the exit notifier.

(realpath() needs a path pointing to an existing file, so we cannot use
it before qemu_write_pidfile().)

Reproducer:
$ cd /tmp
$ qemu-system-x86_64 --daemonize --pidfile qemu.pid
$ file qemu.pid
qemu.pid: ASCII text
$ kill $(cat qemu.pid)
$ file qemu.pid
qemu.pid: ASCII text

(qemu.pid should be gone after the process has terminated.)

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220609122701.17172-4-hreitz@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 824824d12217f7d80b372eb051aad2c082cffb98
      
https://github.com/qemu/qemu/commit/824824d12217f7d80b372eb051aad2c082cffb98
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M block.c
    M block/blklogwrites.c
    M block/block-backend.c
    M block/bochs.c
    M block/cloop.c
    M block/commit.c
    M block/coroutines.h
    M block/crypto.c
    M block/dmg.c
    M block/export/fuse.c
    M block/io.c
    M block/meson.build
    M block/parallels-ext.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2-bitmap.c
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qed.c
    M block/vdi.c
    M block/vhdx-log.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M crypto/block-luks.c
    M crypto/block.c
    M hw/arm/allwinner-h3.c
    M hw/arm/aspeed.c
    M hw/block/block.c
    M hw/block/fdc.c
    M hw/block/hd-geometry.c
    M hw/block/m25p80.c
    M hw/block/nand.c
    M hw/block/onenand.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/ide/atapi.c
    M hw/misc/mac_via.c
    M hw/misc/sifive_u_otp.c
    M hw/nvram/eeprom_at24c.c
    M hw/nvram/spapr_nvram.c
    M hw/nvram/xlnx-bbram.c
    M hw/nvram/xlnx-efuse.c
    M hw/ppc/pnv_pnor.c
    M hw/sd/sd.c
    M include/block/block-io.h
    M include/block/block_int-io.h
    M include/crypto/block.h
    M include/sysemu/block-backend-io.h
    M migration/block.c
    M nbd/server.c
    M qemu-img.c
    M qemu-io-cmds.c
    M softmmu/vl.c
    M storage-daemon/qemu-storage-daemon.c
    M tests/qemu-iotests/108
    M tests/qemu-iotests/223.out
    M tests/qemu-iotests/307.out
    M tests/qemu-iotests/mypy.ini
    M tests/unit/test-block-iothread.c
    M tests/unit/test-crypto-block.c

  Log Message:
  -----------
  Merge tag 'pull-block-2022-07-12' of https://gitlab.com/hreitz/qemu into 
staging

Block patches:
- Refactoring for non-coroutine variants of bdrv/blk_co_* functions:
  Auto-generate more of them with the block coroutine wrapper generator
  script
- iotest fixes
- Both for the storage daemon and the system emulator: Fix PID file
  handling when daemonizing (store the absolute path and delete that on
  exit, which is necessary because daemonizing will change the working
  directory to /)

# gpg: Signature made Tue 12 Jul 2022 19:04:14 BST
# gpg:                using RSA key CB62D7A0EE3829E45F004D34A1FA40D098019CDF
# gpg:                issuer "hreitz@redhat.com"
# gpg: Good signature from "Hanna Reitz <hreitz@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: CB62 D7A0 EE38 29E4 5F00  4D34 A1FA 40D0 9801 9CDF

* tag 'pull-block-2022-07-12' of https://gitlab.com/hreitz/qemu: (35 commits)
  vl: Unlink absolute PID file path
  vl: Conditionally register PID file unlink notifier
  qsd: Unlink absolute PID file path
  iotests/297: Have mypy ignore unused ignores
  qsd: Do not use error_report() before monitor_init
  block: Remove remaining unused symbols in coroutines.h
  block: Reorganize some declarations in block-backend-io.h
  block: Add blk_co_truncate()
  block: Add blk_co_ioctl()
  block: Implement blk_flush() using generated_co_wrapper
  block: Implement blk_pdiscard() using generated_co_wrapper
  block: Implement blk_pwrite_zeroes() using generated_co_wrapper
  block: Add blk_co_pwrite_compressed()
  block: Change blk_pwrite_compressed() param order
  block: Export blk_pwritev_part() in block-backend-io.h
  block: Add blk_[co_]preadv_part()
  block: Add blk_{preadv,pwritev}()
  block: Implement blk_{pread,pwrite}() using generated_co_wrapper
  block: Make blk_co_pwrite() take a const buffer
  block: Make 'bytes' param of blk_{pread,pwrite}() an int64_t
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/8e3d85d36b77...824824d12217



reply via email to

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