From nobody Mon Feb 9 06:01:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547148358206759.9160109199045; Thu, 10 Jan 2019 11:25:58 -0800 (PST) Received: from localhost ([127.0.0.1]:33244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghfxl-0001H5-1P for importer@patchew.org; Thu, 10 Jan 2019 14:25:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghfrH-00059O-HI for qemu-devel@nongnu.org; Thu, 10 Jan 2019 14:19:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghfrG-0008WK-N3 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 14:19:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46740) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghfrE-0008Sh-43; Thu, 10 Jan 2019 14:19:12 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5977B4FCD9; Thu, 10 Jan 2019 19:19:11 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-216.phx2.redhat.com [10.3.116.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99DFF4148; Thu, 10 Jan 2019 19:19:04 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 13:18:56 -0600 Message-Id: <20190110191901.5082-3-eblake@redhat.com> In-Reply-To: <20190110191901.5082-1-eblake@redhat.com> References: <20190110191901.5082-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 10 Jan 2019 19:19:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default integers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-block@nongnu.org, Stefan Weil , Jeff Cody , armbru@redhat.com, Max Reitz , lbloch@janustech.com, Stefan Hajnoczi , "Denis V. Lunev" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Instead of defining an integer to a default string value (where we have to be careful how we spelled the integer because of the use of stringify), populate a default integer value instead. Drop a useless stringify(0); a missing default is just as easy to interpret as 0 as an explicit string 0. Signed-off-by: Eric Blake --- block/parallels.c | 2 +- block/qcow2.c | 2 +- block/qed.c | 2 +- block/vdi.c | 2 +- block/vhdx.c | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index cc9445879d7..a7593310332 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -96,7 +96,7 @@ static QemuOptsList parallels_create_opts =3D { .name =3D BLOCK_OPT_CLUSTER_SIZE, .type =3D QEMU_OPT_SIZE, .help =3D "Parallels image cluster size", - .def_value_str =3D stringify(DEFAULT_CLUSTER_SIZE), + .def_value_int =3D DEFAULT_CLUSTER_SIZE, }, { /* end of list */ } } diff --git a/block/qcow2.c b/block/qcow2.c index 4897abae5e8..c9b76a9ea93 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -4892,7 +4892,7 @@ static QemuOptsList qcow2_create_opts =3D { .name =3D BLOCK_OPT_CLUSTER_SIZE, .type =3D QEMU_OPT_SIZE, .help =3D "qcow2 cluster size", - .def_value_str =3D stringify(DEFAULT_CLUSTER_SIZE) + .def_value_int =3D DEFAULT_CLUSTER_SIZE, }, { .name =3D BLOCK_OPT_PREALLOC, diff --git a/block/qed.c b/block/qed.c index 9377c0b7ad8..9db36c39066 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1651,7 +1651,7 @@ static QemuOptsList qed_create_opts =3D { .name =3D BLOCK_OPT_CLUSTER_SIZE, .type =3D QEMU_OPT_SIZE, .help =3D "Cluster size (in bytes)", - .def_value_str =3D stringify(QED_DEFAULT_CLUSTER_SIZE) + .def_value_int =3D QED_DEFAULT_CLUSTER_SIZE, }, { .name =3D BLOCK_OPT_TABLE_SIZE, diff --git a/block/vdi.c b/block/vdi.c index 2380daa583e..65659c9b179 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -985,7 +985,7 @@ static QemuOptsList vdi_create_opts =3D { .name =3D BLOCK_OPT_CLUSTER_SIZE, .type =3D QEMU_OPT_SIZE, .help =3D "VDI cluster (block) size", - .def_value_str =3D stringify(DEFAULT_CLUSTER_SIZE) + .def_value_int =3D DEFAULT_CLUSTER_SIZE, }, #endif #if defined(CONFIG_VDI_STATIC_IMAGE) diff --git a/block/vhdx.c b/block/vhdx.c index b785aef4b7b..54bf6805fc6 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -2085,13 +2085,12 @@ static QemuOptsList vhdx_create_opts =3D { { .name =3D VHDX_BLOCK_OPT_LOG_SIZE, .type =3D QEMU_OPT_SIZE, - .def_value_str =3D stringify(DEFAULT_LOG_SIZE), + .def_value_int =3D DEFAULT_LOG_SIZE, .help =3D "Log size; min 1MB." }, { .name =3D VHDX_BLOCK_OPT_BLOCK_SIZE, .type =3D QEMU_OPT_SIZE, - .def_value_str =3D stringify(0), .help =3D "Block Size; min 1MB, max 256MB. " \ "0 means auto-calculate based on image size." }, --=20 2.20.1