From patchwork Sat Jun 30 06:09:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 937290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qnh8SVSY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Hjs61kPhz9s1B for ; Sat, 30 Jun 2018 16:14:18 +1000 (AEST) Received: from localhost ([::1]:45678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ99D-0006R1-OR for incoming@patchwork.ozlabs.org; Sat, 30 Jun 2018 02:14:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ95t-0003yI-KF for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:10:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ95r-0001ek-Q0 for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:10:49 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ95r-0001e7-J0 for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:10:47 -0400 Received: by mail-wm0-x244.google.com with SMTP id z6-v6so3516657wma.0 for ; Fri, 29 Jun 2018 23:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G8ufWk35s1tRLTTAXkQJ4Zg57uMlmDzF8ei6TX2yzC0=; b=qnh8SVSYdYrAq8zHztMjBqU5XXt73y4rLkrGLt++S6E/6hGcqlHawleqGDhSQGRp0S 61MJEBnWXLyC9xt1MQR2L6DVfPOkatJQep/geEBLooOxZ4goALqGB3H79StMge7AEVSL Teop+1/mWWpySPPQZV+CxiSIKEBi/+N0sTjCoaKgfaA55Kji1JcGDHfHPszZ1qqAkak5 rcDUrgMyZztfpWvYESSZpIW8GhF4O4KoABRK5bxWhuKaJM007YsE+HFohRGTiBhFdrFc 3yE/duORqQUgSDX/AmWVdvd/DUpqGQEbDt7x6dzKgm4qXeSuEIFdatfEgYExHeUXulOx RZoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=G8ufWk35s1tRLTTAXkQJ4Zg57uMlmDzF8ei6TX2yzC0=; b=YRa6QyeDlEZErSYxaevTGousUf+Vf46awc++kTXbxUDHQsfwgdPQig2aSQb/aLMAfh mQM3cN9e3NGvW0a6wDABT1OH8D3ngkCT0sr/M+FlpbIcOPkxliCJk1Ta9O+G329cZknf JhPXnNtOBUyJwQalJxV9JK6UbjjbLkUkhQC6s0wcnLifKHV0KTFQD26KRc20eAbCGre7 0YU5CHa8MB/UIgYYC63t3aHuA+xjkKt4nfR81s+/XI+87z1FrHAv4WPv8edtRwVugBkc B1ZqGhgGFfl6321JQS+92lUf+j6DryahIXWzb4CE9m7qVCRB/CIG+8zAImYAbhJc/mKu q7dA== X-Gm-Message-State: APt69E3YXIvPUlsnwaEJyMxTiVTOziwMhDbByvDINfbjPcKiwNaFbKJg /z05ASQqGFNE+Ojj+X2bU0/UFF+g X-Google-Smtp-Source: AAOMgpcF2cmXTfO5nAEVHSi5EnUMVf0xIbm3wmi4uy1kwxlKBGeICg/svfue2JwvPpQFqvTnSaiyRA== X-Received: by 2002:a1c:d92:: with SMTP id 140-v6mr3360890wmn.32.1530339046389; Fri, 29 Jun 2018 23:10:46 -0700 (PDT) Received: from donizetti.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 24-v6sm563454wrz.94.2018.06.29.23.10.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 23:10:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 30 Jun 2018 08:09:57 +0200 Message-Id: <20180630061040.6018-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630061040.6018-1-pbonzini@redhat.com> References: <20180630061040.6018-1-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 04/47] vdi: Use definitions from "qemu/units.h" 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Weil Message-Id: <20180625124238.25339-3-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- block/vdi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 1d8ed67..6555cff 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -50,6 +50,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-visit-block-core.h" @@ -83,9 +84,6 @@ /* Command line option for static images. */ #define BLOCK_OPT_STATIC "static" -#define KiB 1024 -#define MiB (KiB * KiB) - #define SECTOR_SIZE 512 #define DEFAULT_CLUSTER_SIZE (1 * MiB) @@ -434,7 +432,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } else if (header.block_size != DEFAULT_CLUSTER_SIZE) { error_setg(errp, "unsupported VDI image (block size %" PRIu32 - " is not %u)", header.block_size, DEFAULT_CLUSTER_SIZE); + " is not %" PRIu64 ")", + header.block_size, DEFAULT_CLUSTER_SIZE); ret = -ENOTSUP; goto fail; } else if (header.disk_size >