qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7af5ee: qcow2: Fix Coverity warning when calc


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7af5ee: qcow2: Fix Coverity warning when calculating the r...
Date: Thu, 31 May 2018 02:38:47 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7af5eea9b34ffb7a9a9fc25ba71998a02b76e159
      
https://github.com/qemu/qemu/commit/7af5eea9b34ffb7a9a9fc25ba71998a02b76e159
  Author: Alberto Garcia <address@hidden>
  Date:   2018-05-29 (Tue, 29 May 2018)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: Fix Coverity warning when calculating the refcount cache size

MIN_REFCOUNT_CACHE_SIZE is 4 and the cluster size is guaranteed to be
at most 2MB, so the minimum refcount cache size (in bytes) is always
going to fit in a 32-bit integer.

Coverity doesn't know that, and since we're storing the result in a
uint64_t (*refcount_cache_size) it thinks that we need the 64 bits and
that we probably want to do a 64-bit multiplication to prevent the
result from being truncated.

This is a false positive in this case, but it's a fair warning.
We could do a 64-bit multiplication to get rid of it, but since we
know that a 32-bit variable is enough to store this value let's simply
reuse min_refcount_cache, make it a normal int and stop doing casts.

Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 53618dd83885cc551a3833e228cf714494602142
      
https://github.com/qemu/qemu/commit/53618dd83885cc551a3833e228cf714494602142
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-29 (Tue, 29 May 2018)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  vdi: Fix vdi_co_do_create() return value

.bdrv_co_create() is supposed to return 0 on success, but vdi could
return a positive value instead. Fix this.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: 4a5f2779bad769184550869931937acd0707ec3b
      
https://github.com/qemu/qemu/commit/4a5f2779bad769184550869931937acd0707ec3b
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-29 (Tue, 29 May 2018)

  Changed paths:
    M block/vhdx.c

  Log Message:
  -----------
  vhdx: Fix vhdx_co_create() return value

.bdrv_co_create() is supposed to return 0 on success, but vhdx could
return a positive value instead. Fix this.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: 1266c9b9f5fa05877b979eece5963a2bd99c3bfd
      
https://github.com/qemu/qemu/commit/1266c9b9f5fa05877b979eece5963a2bd99c3bfd
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M block/backup.c
    M block/commit.c
    M block/mirror.c
    M block/stream.c
    M include/qemu/job.h
    M job-qmp.c
    M job.c
    M tests/test-bdrv-drain.c
    M tests/test-blockjob-txn.c
    M tests/test-blockjob.c

  Log Message:
  -----------
  job: Add error message for failing jobs

So far we relied on job->ret and strerror() to produce an error message
for failed jobs. Not surprisingly, this tends to result in completely
useless messages.

This adds a Job.error field that can contain an error string for a
failing job, and a parameter to job_completed() that sets the field. As
a default, if NULL is passed, we continue to use strerror(job->ret).

All existing callers are changed to pass NULL. They can be improved in
separate patches.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: e5ab4347f9f53495e31fcef5e232c7c6be4a0567
      
https://github.com/qemu/qemu/commit/e5ab4347f9f53495e31fcef5e232c7c6be4a0567
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M block/create.c
    M qapi/block-core.json
    M qapi/job.json
    M tests/qemu-iotests/group

  Log Message:
  -----------
  block/create: Make x-blockdev-create a job

This changes the x-blockdev-create QMP command so that it doesn't block
the monitor and the main loop any more, but starts a background job that
performs the image creation.

The basic job as implemented here is all that is necessary to make image
creation asynchronous and to provide a QMP interface that can be marked
stable, but it still lacks a few features that jobs usually provide: The
job will ignore pause commands and it doesn't publish more than very
basic progress yet (total-progress is 1 and current-progress advances
from 0 to 1 when the driver callbacks returns). These features can be
added later without breaking compatibility.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: 5ad1dbf76a97b6f07d685585175832e990fe9a92
      
https://github.com/qemu/qemu/commit/5ad1dbf76a97b6f07d685585175832e990fe9a92
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Add VM.get_qmp_events_filtered()

This adds a helper function that returns a list of QMP events that are
already filtered through filter_qmp_event().

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: e234398a8e142fd0cfe571f7efb0e6a2f34fe73d
      
https://github.com/qemu/qemu/commit/e234398a8e142fd0cfe571f7efb0e6a2f34fe73d
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Add VM.qmp_log()

This adds a helper function that logs both the QMP request and the
received response before returning it.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 6b605adec4d7491488d9cfb50bc256e667d8caf1
      
https://github.com/qemu/qemu/commit/6b605adec4d7491488d9cfb50bc256e667d8caf1
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Add iotests.img_info_log()

This adds a filter function to postprocess 'qemu-img info' input
(similar to what _img_info does), and an img_info_log() function that
calls 'qemu-img info' and logs the filtered output.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: fc47d8513b45b1968b0ae32d4bb2f96d3aca066a
      
https://github.com/qemu/qemu/commit/fc47d8513b45b1968b0ae32d4bb2f96d3aca066a
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Add VM.run_job()

Add an iotests.py function that runs a job and only returns when it is
destroyed. An error is logged when the job failed and job-finalize and
job-dismiss commands are issued if necessary.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: 5a259e868b308564de9f2bfaef0606074a4f9028
      
https://github.com/qemu/qemu/commit/5a259e868b308564de9f2bfaef0606074a4f9028
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: iotests.py helper for non-file protocols

This adds two helper functions that are useful for test cases that make
use of a non-file protocol (specifically ssh).

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: 4de110f8fd2811171013254fd7ed2384f1de87b4
      
https://github.com/qemu/qemu/commit/4de110f8fd2811171013254fd7ed2384f1de87b4
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

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

  Log Message:
  -----------
  qemu-iotests: Rewrite 206 for blockdev-create job

This rewrites the test case 206 to work with the new x-blockdev-create
job rather than the old synchronous version of the command.

All of the test cases stay the same as before, but in order to be able
to implement proper job handling, the test case is rewritten in Python.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 00af19359e8d77e53a09de9a5d3ed6f6e149e0d2
      
https://github.com/qemu/qemu/commit/00af19359e8d77e53a09de9a5d3ed6f6e149e0d2
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

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

  Log Message:
  -----------
  qemu-iotests: Rewrite 207 for blockdev-create job

This rewrites the test case 207 to work with the new x-blockdev-create
job rather than the old synchronous version of the command.

Most of the test cases stay the same as before (the exception being some
improved 'size' options that allow distinguishing which command created
the image), but in order to be able to implement proper job handling,
the test case is rewritten in Python.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 5ba141dc6f17ca0f250f107aace2df19558c8bc4
      
https://github.com/qemu/qemu/commit/5ba141dc6f17ca0f250f107aace2df19558c8bc4
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M tests/qemu-iotests/210
    M tests/qemu-iotests/210.out
    M tests/qemu-iotests/group
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Rewrite 210 for blockdev-create job

This rewrites the test case 210 to work with the new x-blockdev-create
job rather than the old synchronous version of the command.

All of the test cases stay the same as before, but in order to be able
to implement proper job handling, the test case is rewritten in Python.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: abbab72cad2eafcaf3b0f4e970add813b4264e5f
      
https://github.com/qemu/qemu/commit/abbab72cad2eafcaf3b0f4e970add813b4264e5f
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

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

  Log Message:
  -----------
  qemu-iotests: Rewrite 211 for blockdev-create job

This rewrites the test case 211 to work with the new x-blockdev-create
job rather than the old synchronous version of the command.

All of the test cases stay the same as before, but in order to be able
to implement proper job handling, the test case is rewritten in Python.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 2d7abfbeb75fbe624a8b3a2ff253dbf5674ccb65
      
https://github.com/qemu/qemu/commit/2d7abfbeb75fbe624a8b3a2ff253dbf5674ccb65
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

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

  Log Message:
  -----------
  qemu-iotests: Rewrite 212 for blockdev-create job

This rewrites the test case 212 to work with the new x-blockdev-create
job rather than the old synchronous version of the command.

All of the test cases stay the same as before, but in order to be able
to implement proper job handling, the test case is rewritten in Python.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 0c46a69a5eb8a061134719a0a85898854eb8e533
      
https://github.com/qemu/qemu/commit/0c46a69a5eb8a061134719a0a85898854eb8e533
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

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

  Log Message:
  -----------
  qemu-iotests: Rewrite 213 for blockdev-create job

This rewrites the test case 213 to work with the new x-blockdev-create
job rather than the old synchronous version of the command.

All of the test cases stay the same as before, but in order to be able
to implement proper job handling, the test case is rewritten in Python.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>


  Commit: 3fb588a0f2c006122c34e1960a15c87ae2b927eb
      
https://github.com/qemu/qemu/commit/3fb588a0f2c006122c34e1960a15c87ae2b927eb
  Author: Kevin Wolf <address@hidden>
  Date:   2018-05-30 (Wed, 30 May 2018)

  Changed paths:
    M block/create.c
    M qapi/block-core.json
    M qapi/job.json
    M tests/qemu-iotests/206
    M tests/qemu-iotests/206.out
    M tests/qemu-iotests/207
    M tests/qemu-iotests/207.out
    M tests/qemu-iotests/210
    M tests/qemu-iotests/210.out
    M tests/qemu-iotests/211
    M tests/qemu-iotests/211.out
    M tests/qemu-iotests/212
    M tests/qemu-iotests/212.out
    M tests/qemu-iotests/213
    M tests/qemu-iotests/213.out

  Log Message:
  -----------
  block/create: Mark blockdev-create stable

We're ready to declare the blockdev-create job stable. This renames the
corresponding QMP command from x-blockdev-create to blockdev-create.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>


  Commit: fe817a8a0d4a2face895f692a7e061f0c98412b9
      
https://github.com/qemu/qemu/commit/fe817a8a0d4a2face895f692a7e061f0c98412b9
  Author: Peter Maydell <address@hidden>
  Date:   2018-05-31 (Thu, 31 May 2018)

  Changed paths:
    M block/backup.c
    M block/commit.c
    M block/create.c
    M block/mirror.c
    M block/qcow2.c
    M block/stream.c
    M block/vdi.c
    M block/vhdx.c
    M include/qemu/job.h
    M job-qmp.c
    M job.c
    M qapi/block-core.json
    M qapi/job.json
    M tests/qemu-iotests/206
    M tests/qemu-iotests/206.out
    M tests/qemu-iotests/207
    M tests/qemu-iotests/207.out
    M tests/qemu-iotests/210
    M tests/qemu-iotests/210.out
    M tests/qemu-iotests/211
    M tests/qemu-iotests/211.out
    M tests/qemu-iotests/212
    M tests/qemu-iotests/212.out
    M tests/qemu-iotests/213
    M tests/qemu-iotests/213.out
    M tests/qemu-iotests/iotests.py
    M tests/test-bdrv-drain.c
    M tests/test-blockjob-txn.c
    M tests/test-blockjob.c

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

Block layer patches:

- Add blockdev-create job
- qcow2: Silence Coverity false positive

# gpg: Signature made Wed 30 May 2018 16:55:31 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:
  block/create: Mark blockdev-create stable
  qemu-iotests: Rewrite 213 for blockdev-create job
  qemu-iotests: Rewrite 212 for blockdev-create job
  qemu-iotests: Rewrite 211 for blockdev-create job
  qemu-iotests: Rewrite 210 for blockdev-create job
  qemu-iotests: Rewrite 207 for blockdev-create job
  qemu-iotests: Rewrite 206 for blockdev-create job
  qemu-iotests: iotests.py helper for non-file protocols
  qemu-iotests: Add VM.run_job()
  qemu-iotests: Add iotests.img_info_log()
  qemu-iotests: Add VM.qmp_log()
  qemu-iotests: Add VM.get_qmp_events_filtered()
  block/create: Make x-blockdev-create a job
  job: Add error message for failing jobs
  vhdx: Fix vhdx_co_create() return value
  vdi: Fix vdi_co_do_create() return value
  qcow2: Fix Coverity warning when calculating the refcount cache size

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


Compare: https://github.com/qemu/qemu/compare/b5725385d17c...fe817a8a0d4a
      **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]