Skip to content

block: Eliminate the S_1KiB, S_2KiB, ... macros

Markus Armbruster qemu-devel 1 version Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1block: Eliminate the S_1KiB, S_2KiB, ... macrosblock/qcow2.h block/vdi.c include/qemu/units.h+7 -795 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchEric BlakePhilippe Mathieu-DaudéAlberto Garcia
1/1R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/1] block: Eliminate the S_1KiB, S_2KiB, ... macros

Back in September, Leonid Block added a whole bunch of macros (commit 540b8492618) to improve readability of qcow2.h a bit (commit b6a95c6d100). He later used them to fix the "vdi" driver's parameter cluster_size's default value (commit 3dd5b8f4718). He has now proposed a further patch[1] to auto-generate these macros. That patch feels overengineered to me.

On closer examination, I found I dislike the macros before his new patch. So did Eric Blake.

The macros exist because the common KiB, MiB, ... macros aren't usable when you need a literal rather than a constant expression. stringify() does, and we use it to define the QemuOpts default value.

Eric proposed to improve QemuOpts to accept integer default values, too[2]. Before I review that patch series, I want to establish a "stupidest solution that can possibly work" baseline. And that's what this patch is.

[1] [PATCH v2 0/1] include: Auto-generate the sizes lookup table
Message-ID: <[email protected]>

[2] [PATCH v3 0/6] include: Auto-generate the sizes lookup table
Message-Id: <[email protected]>

Markus Armbruster (1):
block: Eliminate the S_1KiB, S_2KiB, ... macros

 block/qcow2.h        | 10 +++---
 block/vdi.c          |  3 +-
 include/qemu/units.h | 73 --------------------------------------------
 3 files changed, 7 insertions(+), 79 deletions(-)
Signature · 1 line
2.17.2