From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIxdh-00016K-L2 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:01:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIxdd-0000TS-VO for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:01:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIxdd-0000TO-Q2 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:01:25 -0500 Date: Tue, 12 Jan 2016 12:01:21 +0000 From: "Daniel P. Berrange" Message-ID: <20160112120121.GC17626@redhat.com> References: <1452599056-27357-1-git-send-email-berrange@redhat.com> <1452599056-27357-2-git-send-email-berrange@redhat.com> <20160112125810.2d6cb9d2.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160112125810.2d6cb9d2.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH v1 01/22] s390: use FILE instead of QEMUFile for creating text file Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: Amit Shah , Juan Quintela , qemu-devel@nongnu.org, "Jason J. Herne" , "Dr. David Alan Gilbert" On Tue, Jan 12, 2016 at 12:58:10PM +0100, Cornelia Huck wrote: > On Tue, 12 Jan 2016 11:43:55 +0000 > "Daniel P. Berrange" wrote: > > > The s390 skeys monitor command needs to write out a plain text > > file. Currently it is using the QEMUFile class for this. There > > is no real benefit to this, and the downside is that it needs to > > snprintf via an intermediate buffer. Switching to regular FILE > > objects simplifies the code. > > > > Signed-off-by: Daniel P. Berrange > > --- > > hw/s390x/s390-skeys.c | 19 +++++++------------ > > 1 file changed, 7 insertions(+), 12 deletions(-) > > > @@ -124,7 +119,7 @@ void qmp_dump_skeys(const char *filename, Error **errp) > > return; > > } > > > > - f = qemu_fopen(filename, "wb"); > > + f = fopen(filename, "wb"); > > if (!f) { > > error_setg_file_open(errp, errno, filename); > > return; > > Hmm... > > https://marc.info/?l=qemu-devel&m=143740278908660&w=2 > > We'd lose the benefits from qemu_fopen() here again, or am I missing > something? Oh, that message shouldn't really have recommended qemu_fopen() - it only needs qemu_open() to get the fd passing support. I'll change this to use qemu_open() + fdopen() instead, so we still support FD passing while using normal stdio. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|