From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5YMv-0003Fa-B8 for qemu-devel@nongnu.org; Mon, 19 Sep 2011 03:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5YMu-0005q5-0y for qemu-devel@nongnu.org; Mon, 19 Sep 2011 03:34:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5YMt-0005py-Q5 for qemu-devel@nongnu.org; Mon, 19 Sep 2011 03:34:19 -0400 Message-ID: <4E76F074.4030801@redhat.com> Date: Mon, 19 Sep 2011 09:34:12 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1316188834-13675-1-git-send-email-aliguori@us.ibm.com> <1316188834-13675-5-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1316188834-13675-5-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/14] qdev: take ownership of id pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Peter Maydell , Paolo Bonzini , qemu-devel@nongnu.org, Markus Armbruster , Jan Kiszka On 09/16/11 18:00, Anthony Liguori wrote: > qdev has this quirk that it owns a seemingly arbitrary QemuOpts pointer. That's > because qdev expects a static string for the id (which really makes no sense > since ids are supposed to be provided by the user). Instead of managing just > the id pointer, we currently take ownership of the entire QemuOpts structure > that was used to create the device just to keep the name around. FYI: Keeping the pointer to the QemuOpts has one more reason: It will free the QemuOpts on hot-unplug, which is needed to free the id from QemuOpts point of view, which in turn allows to re-use the id when hot-plugging the same (or another) device later on. cheers, Gerd