From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUIzI-0002Wb-Sx for qemu-devel@nongnu.org; Tue, 25 Aug 2015 14:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUIzE-0004Fj-UB for qemu-devel@nongnu.org; Tue, 25 Aug 2015 14:30:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUIzE-0004EX-OC for qemu-devel@nongnu.org; Tue, 25 Aug 2015 14:30:20 -0400 From: Markus Armbruster References: <29C62C49-06A5-4F99-8062-7269A28C29A3@gmail.com> <55DB98E1.600@redhat.com> <87twrnmtet.fsf@blackfin.pond.sub.org> <317E9D35-17C6-4218-B58C-CEE71F8A400F@gmail.com> Date: Tue, 25 Aug 2015 20:30:17 +0200 In-Reply-To: (Programmingkid's message of "Tue, 25 Aug 2015 11:50:18 -0400") Message-ID: <87wpwjgr0m.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] qdev-monitor.c: Add device id generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid Cc: Peter Maydell , qemu-devel qemu-devel Programmingkid writes: > On Aug 25, 2015, at 11:33 AM, Peter Maydell wrote: > >> On 25 August 2015 at 16:25, Programmingkid wrote: >>> On Aug 25, 2015, at 8:42 AM, Markus Armbruster wrote: >>>> Eric Blake writes: >>>> >>>>> On 08/24/2015 12:53 PM, Programmingkid wrote: >>>>>> +/* USB's max number of devices is 127. This number is 3 digits long. */ >>>>>> +#define MAX_NUM_DIGITS_FOR_USB_ID 3 >>>> >>>> This limit makes no sense to me. >>> >>> The limit is used to decide how many characters the device_id >>> string is going to have. >>> Three digits would be 0 to 999 device ID's would be supported. I >>> can't imagine >>> anyone spending the time to add that many devices. >> >> Arbitrary limits are often a bad idea, especially when >> they're easy to avoid, as here. > > Knowing QEMU's limits can save the user from crashes and other > problems. There is > only a finite amount of memory available to QEMU. Repeat N times: device_add FOO,id=hot device_del hot Memory usage independent of N (unless we leak, but that would be a bug). [...]