From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmMqz-0001Fi-Ur for qemu-devel@nongnu.org; Wed, 04 Jul 2012 06:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmMqs-0002lc-8J for qemu-devel@nongnu.org; Wed, 04 Jul 2012 06:30:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmMqs-0002l5-0T for qemu-devel@nongnu.org; Wed, 04 Jul 2012 06:30:30 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q64AUSHh032762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 Jul 2012 06:30:28 -0400 Message-ID: <4FF41B41.6030809@redhat.com> Date: Wed, 04 Jul 2012 12:30:25 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1339685702-10176-1-git-send-email-pbonzini@redhat.com> <1339685702-10176-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1339685702-10176-3-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] block: introduce bdrv_swap, implement bdrv_append on top of it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jcody@redhat.com, qemu-devel@nongnu.org Am 14.06.2012 16:55, schrieb Paolo Bonzini: > +/* > + * Add new bs contents at the top of an image chain while the chain is > + * live, while keeping required fields on the top layer. > + * > + * This will modify the BlockDriverState fields, and swap contents > + * between bs_new and bs_top. Both bs_new and bs_top are modified. > + * > + * bs_new is required to be anonymous. > + * > + * This function does not create any image files. > + */ > +void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top) > +{ > + bdrv_swap(bs_new, bs_top); > + > + /* The contents of 'tmp' will become bs_top, as we are > + * swapping bs_new and bs_top contents. */ This comment looks outdated, there's not tmp in this function. Kevin