Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwvmJ-0001QD-Mo for qemu-devel@nongnu.org; Wed, 31 Mar 2010 07:08:07 -0400 Received: from [140.186.70.92] (port=54995 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwvmF-0001Nb-6c for qemu-devel@nongnu.org; Wed, 31 Mar 2010 07:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nwvm5-00027X-Tz for qemu-devel@nongnu.org; Wed, 31 Mar 2010 07:07:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31399) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwvm5-00026l-8A for qemu-devel@nongnu.org; Wed, 31 Mar 2010 07:07:53 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2VB7jbJ022921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Mar 2010 07:07:46 -0400 From: Juan Quintela In-Reply-To: <1270020848-15526-17-git-send-email-amit.shah@redhat.com> (Amit Shah's message of "Wed, 31 Mar 2010 13:04:07 +0530") References: <1270020848-15526-1-git-send-email-amit.shah@redhat.com> <1270020848-15526-2-git-send-email-amit.shah@redhat.com> <1270020848-15526-3-git-send-email-amit.shah@redhat.com> <1270020848-15526-4-git-send-email-amit.shah@redhat.com> <1270020848-15526-5-git-send-email-amit.shah@redhat.com> <1270020848-15526-6-git-send-email-amit.shah@redhat.com> <1270020848-15526-7-git-send-email-amit.shah@redhat.com> <1270020848-15526-8-git-send-email-amit.shah@redhat.com> <1270020848-15526-9-git-send-email-amit.shah@redhat.com> <1270020848-15526-10-git-send-email-amit.shah@redhat.com> <1270020848-15526-11-git-send-email-amit.shah@redhat.com> <1270020848-15526-12-git-send-email-amit.shah@redhat.com> <1270020848-15526-13-git-send-email-amit.shah@redhat.com> <1270020848-15526-14-git-send-email-amit.shah@redhat.com> <1270020848-15526-15-git-send-email-amit.shah@redhat.com> <1270020848-15526-16-git-send-email-amit.shah@redhat.com> <1270020848-15526-17-git-send-email-amit.shah@redhat.com> Date: Wed, 31 Mar 2010 13:07:41 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 16/17] virtio-serial: Discard data that guest sends us when ports aren't connected List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Gerd Hoffmann , qemu list , "Michael S. Tsirkin" Amit Shah wrote: Hi > + buf_size = iov_size(elem.out_sg, elem.out_num); > + buf = qemu_malloc(buf_size); > + ret = iov_to_buf(elem.out_sg, elem.out_num, buf, 0, buf_size); This is independent of the this series, but I think this idiom is going to be very common, perhaps having a helper that does it makes sense? Later, Juan.