From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Lalancette Subject: Re: [Qemu-devel] [PATCH 1/10] Refactor QEMUFile for live migration Date: Wed, 10 Sep 2008 15:25:51 +0200 Message-ID: <48C7CADF.1030300@redhat.com> References: <1220989802-13706-1-git-send-email-aliguori@us.ibm.com> <1220989802-13706-2-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Chris Wright , Uri Lublin , Anthony Liguori , kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:42499 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745AbYIJNbJ (ORCPT ); Wed, 10 Sep 2008 09:31:09 -0400 In-Reply-To: <1220989802-13706-2-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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