Message ID | 20160815093922.8924-1-pbutsykin@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC44360467 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 15 Aug 2016 11:13:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC46228BEE for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 15 Aug 2016 11:13:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0BD328C0F; Mon, 15 Aug 2016 11:13:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 957D228BEE for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 15 Aug 2016 11:13:20 +0000 (UTC) Received: from localhost ([::1]:36101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1bZFpW-0007cM-Oa for patchwork-qemu-devel@patchwork.kernel.org; Mon, 15 Aug 2016 07:13:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pbutsykin@virtuozzo.com>) id 1bZFpF-0007ZP-MI for qemu-devel@nongnu.org; Mon, 15 Aug 2016 07:13:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <pbutsykin@virtuozzo.com>) id 1bZFpD-0002TK-Pd for qemu-devel@nongnu.org; Mon, 15 Aug 2016 07:13:00 -0400 Received: from mail-db5eur01on0100.outbound.protection.outlook.com ([104.47.2.100]:42112 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pbutsykin@virtuozzo.com>) id 1bZFp7-0002Rq-Ud; Mon, 15 Aug 2016 07:12:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HmZdyiPkwB9oRyluaYXJMaQpuVfidPtnmDenaKPLOGA=; b=JeoO5MnQ6odCIm/T9gvD3oGRk/bZYgTRwqu0iayk17DwFhfgvUhU2ib9eQVETjFvCFeoLWs8zhjsE9WJSFSGK+mqxm1i0WpDObd0l58kWra9ukwrB2g4n6D7vL/NUbGwXM6zqjI/yQ+wKR+kiCk+4mGa0K2u35EJzaccsQuLJk8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.10) by AM5PR0802MB2547.eurprd08.prod.outlook.com (10.175.45.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Mon, 15 Aug 2016 09:39:37 +0000 From: Pavel Butsykin <pbutsykin@virtuozzo.com> To: <kwolf@redhat.com> Date: Mon, 15 Aug 2016 12:39:22 +0300 Message-ID: <20160815093922.8924-1-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160808134400.GC25992@noname.str.redhat.com> References: <20160808134400.GC25992@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: HE1PR01CA0083.eurprd01.prod.exchangelabs.com (10.165.170.179) To AM5PR0802MB2547.eurprd08.prod.outlook.com (10.175.45.23) X-MS-Office365-Filtering-Correlation-Id: fc674e66-1641-49aa-3bf8-08d3c4f013d4 X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 2:4DkKq2D3weAKJtmeUCPIatmGX4Woth3x/Vex+xk0epGD3eiGKPkMUYIbArgMDSVJSeB2MEf4XLB2u9GrZeJbXpHLmnRcINin//tzFVdjL8krKdaTK1J/b9InnUuKgbASYEDn04S8HGi1fYDefudNP2v3GcrXDHirwze6T4a3BadgTNmYU8B7Ce54s45A8yvK; 3:g/RbNW9RdLo1BhNpApHH2tonRqzM2fXblgA9DvEd3Xp/jZM2d3p3TIYnEOhN/ZalKwfkC3MyijWyhADGXT73rjubFLuSfdJpRVlxrvGxmO7tZt0IVYs2os+Cw0onE9kS X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0802MB2547; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 25:NqBKZgxLHF0ns2aDnQZ1hgZSutSAO7Tk4bYGs8cZ4fX9MWz7ZZi2u8fM0ZpK+G6DlTirXSvFy8EK8HqbofHt/C/NaBudrux0kPY94Bt3M/iE+4/ChR7Og21QA/W5IPGGG6O+ViMjL8kwEvsloeEhCs1kT3IRquh/SmijZrRtNRFELj8q2JPCK1toTbaXdPLfsqx72+e4xvqmPiRYzWOULD/dL0QKYl/G2HZwlIJIYBccbG0pYwzXf4a0GuQ3GamDoYRT5o6KikinUo4jPIlJzsnnqSeB6qgYTRMDjqoyTbdjLSgeSNCJvysvJ4ljGTyVTP9V0eLotLCsNMlLa4U0fLca0stXobLzgIeSHwvG7wk01+uEtallBc6YZNmYCbRwVAMnhOIZvPhi2rXvVdrC3oecS1qaFQMOiF/iNnOrFlG2kxopvvTurcloZmcSIHk7xEiAe5Ij5ndgk0jz2nNw5v4glnal/HvOZGPOKmc3YT+FQ61MCsi+B3qAGxjNUNoFe06oHhXQP2mCe6BzbAVO7LrApg/YgQeq1DAfRBn7yXPizT/cg2WHM33V4ztKu13MQ8BDXf93CNtToSybyiGfzOGXOR0KTO03xIv5cuTqNtR/+/nRCuiFRd4Nt7wwQ/cKSgOL0cuPpAK2NpM3unJufXp+NfKOL//DudWJvfxy4bY6Sr/1VXmoSNHeojPPyc04; 31:sTs7i4rolUFyAU8NmwNUwoJ9HN62TvVA42Q+dv5NdnyKj6ksJDxden/MPijSiihKaSDKLQP184xR8hGDm3exZnpw6dAmNzPIsQwDr/LKO0aXcxgpl6Wc5NOgDmxihzyd2gsrWJNJuCpUSJWx1/01jwHeSuvH01i20H3W1cWQhptRZirpHaarCrR29F+jF2UuSO+I0LH1uKxLfMbCk/13GR0H9F15ED4QrrCKNS1/8T4= X-Microsoft-Antispam-PRVS: <AM5PR0802MB254730D3123F5EE03A0AF15DAC120@AM5PR0802MB2547.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6042046)(6043046); SRVR:AM5PR0802MB2547; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2547; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 4:sUb9KeubI0+Q/+RxmEOXRQWp2IIVT2I9zkzAQnsoTZBtJxLPnSJjuWOTgNJt60h/BSN3wOkdjjh1qHSKAeOkBZUUQ+juHu7e1E2N8PFA6k5jUFYshLFsH7xz8oOzx16n4OnTL0D9Ec3s+vvjwQgHRCypRGQnWBXRxgDOV9XpiBqlpqwFl50zytuDr2MQqR/RgEG8R1HEOEAcduReLpuvJVIt/9KitzDo4RYiQeMFeppPNWqordcy4V9V7JnQMDaVgosop9zCthhc4R+GeL8W5GkqQyxZ6YaqzoJtrQXw0UYEdg6uVGwO4UmeakYXf6lJMPWvHBm969zMVe4xKUkD/ErT2mNs/6x8YMCQueV/+mVYYbQ7M9OoSZ3ukzW1AsOfYza4gpUrae/ra/ImNmpUlo60h4dOX/G4JIq3Bk9GtbY= X-Forefront-PRVS: 0035B15214 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(42186005)(86362001)(2351001)(105586002)(33646002)(8676002)(229853001)(66066001)(106356001)(76176999)(305945005)(110136002)(19580395003)(7736002)(7846002)(101416001)(53416004)(47776003)(97736004)(92566002)(107886002)(189998001)(1076002)(50466002)(36756003)(19580405001)(50986999)(48376002)(4001430100002)(69596002)(586003)(6116002)(3846002)(77096005)(50226002)(68736007)(2950100001)(4326007)(2906002)(5003940100001)(81166006)(81156014)(15760500001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0802MB2547; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2547; 23:HI/m/kJ0PuXvHiGOoYqTQ7APWPUAo0vWBTkZPWP?= =?us-ascii?Q?52Lm5AOyvcgSdGCut/S7Fb/7Zh7Fyl5Fu7ZRqAl1SmhNPilRKbdh6vi4n9bB?= =?us-ascii?Q?MiRyqpAx3jghn093ROiPqBiHXKQAsv6eNKimWxq37Sf7LpG8G3NaTDUIyqZ4?= =?us-ascii?Q?dj5fCEWFe+9qqsa4aGeg1iAMNQGphC6JaO7OePvvmgxrHqBIjeV3rc3K+Xcz?= =?us-ascii?Q?ECQeNMBrSnmuQneCvjjKI1kBB0HkRtE7pCUOAVelDlq4OVp005u+IWuq2DtE?= =?us-ascii?Q?VVjzbeVQo54szccQb3xkEI46EdVV5b85nqJg61kJt/rcwHH920cyPJRHMNrs?= =?us-ascii?Q?Zjl5Y78wKFWld6kYTuRJ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0802MB2547; 6:5EhjcpSSVoLlCnLK8widRP8pF/m2ZoWafCClgaVXWzSzQ5ENRYdPHOemQxcEVtxm0LPpHXQuNZLj2wInNBedGZUMZn5bScEucYy7BTjZoxYOPPTDkIbb+fi4sNEqkXGBnxj4DXBni0n0Omuo48p/tUazBml4J6/bFgpavlQrSSLRbJVoq9QPDRakkc+/K7t0oCyUVyzv2puTrZrHFEZSfEVYKjWm7M1Y7gFOs4Em28bby+y0+eZFI6MZ+K3HzU5Umq+ko2NemUfnbqXec0g6TOWXSc2UPX8D0Y7dj3tJhhWsZZZxLAGD5I7Ez86MNkq9; 5:pahP1nSvUu56ibu4RLsL/BY/osapiOCXvxLlaQAN7eKQmGr3RI2KzqwyaFPdZe+iWL2/2PLolaBjEabSk9gpyunaHhp1TEly6b7jWch5tia8b6PhxjLb2nTx3cyQ/YOg21gbTRreaj8Ztbsbefb0og==; 24:p9dqvCh0m2+qV6LMWdR5P9t7KVpMk+yL0UBuO0R2l4u2zqVHmGSaUovp3+wuPzJ9jat1/ioEUZI93iGkvDEMpMbRkQKwAKsKcWboXT3z01c=; 7:YiYOPD2TsODlXNrXcU2+0vkDoE4vyCxPhAmYfImEK5BD6xdDRwILdRVbG9mErf+Flf8UiZ6/fOwGjRvegqErRzIOAnNGv9j7KkrFj/5lOwJ3El2sSlBusolKF1gw3iOlEAMS0jGMlKZQQWMgYbDiXmlLA+C6vnikbVIax786UcSDnagwA4BmjUfWzryZeDTy1HClVPeu0EEU8KvVhB8dSBzGYHQG7mwkHhjX0Virbu8ySJW5qMHvofNlNRH1cN/s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 20:QGxmQ+m2rodQCKgykEy7xl3Vt8E/rrSiXgIeL/r8ZsjWCd86F1rUYILqptPeJgodDe/kHE7uXQVyztg7yunNW8ji8IFCkB85RAzYj/XGPXdFyEOTYZbO8QVY7mITtgiulNc+32r10pFYs2lsGkIo3uy56Qc9Mfmu1e+pOLlszEA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2016 09:39:37.8991 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2547 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.100 Subject: [Qemu-devel] [PATCH] qcow2: fix iovec size at qcow2_co_pwritev_compressed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: qemu-block@nongnu.org, pbutsykin@virtuozzo.com, jsnow@redhat.com, jcody@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/block/qcow2.c b/block/qcow2.c index adf4514..c079aa8 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2565,7 +2565,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, /* Zero-pad last write if image size is not cluster aligned */ memset(buf + bytes, 0, s->cluster_size - bytes); } - qemu_iovec_to_buf(qiov, 0, buf, s->cluster_size); + qemu_iovec_to_buf(qiov, 0, buf, bytes); out_buf = g_malloc(s->cluster_size);
Use bytes as the size would be more exact than s->cluster_size. Although qemu_iovec_to_buf() will not allow to go beyond the qiov. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)