From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQIZV-00047L-Fs for qemu-devel@nongnu.org; Fri, 14 Aug 2015 13:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQIZP-0000tf-PS for qemu-devel@nongnu.org; Fri, 14 Aug 2015 13:15:13 -0400 Received: from relay.parallels.com ([195.214.232.42]:54732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQIZP-0000ZE-IR for qemu-devel@nongnu.org; Fri, 14 Aug 2015 13:15:07 -0400 Message-ID: <55CE2206.9010301@virtuozzo.com> Date: Fri, 14 Aug 2015 20:14:46 +0300 From: Vladimir Sementsov-Ogievskiy MIME-Version: 1.0 References: <1433776886-27239-1-git-send-email-vsementsov@virtuozzo.com> <1433776886-27239-3-git-send-email-vsementsov@virtuozzo.com> <20150610143041.GE2430@stefanha-thinkpad.home> In-Reply-To: <20150610143041.GE2430@stefanha-thinkpad.home> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/8] qcow2: add dirty-bitmaps feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, Vladimir Sementsov-Ogievskiy , pbonzini@redhat.com, den@openvz.org, jsnow@redhat.com On 10.06.2015 17:30, Stefan Hajnoczi wrote: > On Mon, Jun 08, 2015 at 06:21:20PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > > >> + ret = bdrv_pread(bs->file, bm->l1_table_offset, l1_table, >> + bm->l1_size * sizeof(uint64_t)); >> + if (ret < 0) { >> + goto fail; >> + } >> + >> + buf = g_malloc0(bm->l1_size * s->cluster_size); > What is the maximum l1_size value? cluster_size and l1_size are 32-bit > so with 64 KB cluster_size this overflows if l1_size > 65535. Do you > want to cast to size_t? Hmm. What the maximum RAM space we'd like to spend on dirty bitmap? I think 4Gb is too much.. So here should be limited not the l1_size but number of bytes needed to store the bitmap. What is maximum disk size we are dealing with? -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience.