From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbiG4-0004L9-Rk for qemu-devel@nongnu.org; Tue, 07 Oct 2014 23:49:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbiG0-0000Vt-FC for qemu-devel@nongnu.org; Tue, 07 Oct 2014 23:49:48 -0400 Received: from [59.151.112.132] (port=44254 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbiG0-0000VK-1R for qemu-devel@nongnu.org; Tue, 07 Oct 2014 23:49:44 -0400 Message-ID: <1412740148.9352.7.camel@G08FNSTD140041> From: Zhu Guihua Date: Wed, 8 Oct 2014 11:49:08 +0800 In-Reply-To: <20141007155321.36f9a3a7@nial.usersys.redhat.com> References: <1411723721-20484-1-git-send-email-imammedo@redhat.com> <1412244525-7153-1-git-send-email-imammedo@redhat.com> <1412683191.18043.7.camel@G08FNSTD140041> <20141007141018.546296f2@nial.usersys.redhat.com> <5433E961.6010207@suse.de> <20141007155321.36f9a3a7@nial.usersys.redhat.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 37/36] qdev: device_del: search for to be unplugged device in 'peripheral' container List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: pbonzini@redhat.com, Peter Crosthwaite , Bharata B Rao , Andreas =?ISO-8859-1?Q?F=E4rber?= , qemu-devel@nongnu.org On Tue, 2014-10-07 at 15:53 +0200, Igor Mammedov wrote: > On Tue, 07 Oct 2014 15:23:45 +0200 > Andreas F=C3=A4rber wrote: >=20 > > Am 07.10.2014 um 14:10 schrieb Igor Mammedov: > > > On Tue, 7 Oct 2014 19:59:51 +0800 > > > Zhu Guihua wrote: > > >=20 > > >> On Thu, 2014-10-02 at 10:08 +0000, Igor Mammedov wrote: > > >>> device_add puts every device with 'id' inside of 'peripheral' > > >>> container using id's value as the last component name. > > >>> Use it by replacing recursive search on sysbus with path > > >>> lookup in 'peripheral' container, which could handle both > > >>> BUS and BUS-less device cases. > > >>> > > >> > > >> If I want to delete device without id inside of 'peripheral-anon' > > >> container, the command 'device_del' does not work.=20 > > >> My suggestion is deleting device by the last component name, is this > > >> feasiable? > > > So far device_del was designed to work only with id-ed devices. > > >=20 > > > What's a use-case for unplugging unnamed device from peripheral-anon? > >=20 > > I can think of use cases where you may want to balloon memory or CPUs. > yep currently initial CPUs are created without dev->id and even without > device_add help. > However if/when it's switched to device_add we can make them use > auto-generated IDs so they would go into peripheral section. > That would let us keep peripheral-anon for devices that shouldn't > be unplugged. when device_add pc-dimm, only 'memdev' property is necessary, but the 'id' property is optional.=20 So I execute the command as followings: object_add memory-backend-ram,id=3Dram0,size=3D128M device_add pc-dimm,memdev=3Dram0 Now it is impossible to delete the pc-dimm, because it has no id, and it is inside of 'peripheral-anon' container.=20 Regards, Zhu >=20 > >=20 > > But that seems orthogonal to this series. > >=20 > > Regards, > > Andreas > >=20 >=20