From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdPm3-0003tx-QG for qemu-devel@nongnu.org; Wed, 10 Sep 2008 09:30:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdPm1-0003sA-Ow for qemu-devel@nongnu.org; Wed, 10 Sep 2008 09:30:23 -0400 Received: from [199.232.76.173] (port=55316 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdPm1-0003rr-II for qemu-devel@nongnu.org; Wed, 10 Sep 2008 09:30:21 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53637) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KdPm1-0004kn-4f for qemu-devel@nongnu.org; Wed, 10 Sep 2008 09:30:21 -0400 Message-ID: <48C7CADF.1030300@redhat.com> Date: Wed, 10 Sep 2008 15:25:51 +0200 From: Chris Lalancette MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/10] Refactor QEMUFile for live migration References: <1220989802-13706-1-git-send-email-aliguori@us.ibm.com> <1220989802-13706-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1220989802-13706-2-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Chris Wright , Uri Lublin , Anthony Liguori , kvm@vger.kernel.org Anthony Liguori wrote: > void qemu_fflush(QEMUFile *f) > { > - if (!f->is_writable) > + if (!f->put_buffer) > return; > + > if (f->buf_index > 0) { > - if (f->is_file) { > - fseek(f->outfile, f->buf_offset, SEEK_SET); > - fwrite(f->buf, 1, f->buf_index, f->outfile); > - } else { > - bdrv_pwrite(f->bs, f->base_offset + f->buf_offset, > - f->buf, f->buf_index); > - } > + f->put_buffer(f->opaque, f->buf, f->buf_offset, f->buf_index); Nit...whitespace damage. ... Overall, seems to be a good refactoring, and seems to keep the original semantics of qemu_fopen_bdrv() and qemu_fopen(). Chris Lalancette