Received: from eggs.gnu.org ([2001:4830:134:3::10]:56278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMvDH-0003KU-Iz for qemu-devel@nongnu.org; Mon, 19 Jun 2017 07:51:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMvDE-000562-Hr for qemu-devel@nongnu.org; Mon, 19 Jun 2017 07:51:23 -0400 From: Alberto Garcia In-Reply-To: <20170616153142.GB4366@noname.fritz.box> References: <1f133befcfa4b89978d7fee980bb61ae1298e224.1496844254.git.berto@igalia.com> <20170616153142.GB4366@noname.fritz.box> Date: Mon, 19 Jun 2017 13:50:39 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 7/7] qcow2: Merge the writing of the COW regions with the guest data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz , Eric Blake , "Denis V . Lunev" , Stefan Hajnoczi On Fri 16 Jun 2017 05:31:42 PM CEST, Kevin Wolf wrote: >> + /* Make sure that adding both COW regions to the QEMUIOVector >> + * does not exceed IOV_MAX */ >> + if (hd_qiov->niov > IOV_MAX - 2) { >> + continue; >> + } >> + >> + m->data_qiov = hd_qiov; > > I don't think having this side effect is good for a function that is > called can_xyz(). I'd either call it merge_cow() or move the > assignment to the caller. You're right, I think I prefer to move the assignment to the caller for now. Berto