From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36108 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P88xA-0000e7-BL for qemu-devel@nongnu.org; Tue, 19 Oct 2010 05:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P88wz-0006Vd-8x for qemu-devel@nongnu.org; Tue, 19 Oct 2010 05:57:56 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:56546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P88wz-0006VQ-6O for qemu-devel@nongnu.org; Tue, 19 Oct 2010 05:57:45 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o9J9ewT0003170 for ; Tue, 19 Oct 2010 05:40:58 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9J9vhuM294662 for ; Tue, 19 Oct 2010 05:57:43 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9J9vgAZ025430 for ; Tue, 19 Oct 2010 07:57:43 -0200 Date: Tue, 19 Oct 2010 15:27:37 +0530 From: pradeep Message-ID: <20101019152737.234e2e51@skywalker> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] qemu aborts if i add a already registered device from qemu monitor .. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm-devel , qemu-devel@nongnu.org, Avi Kivity Hi I tried to add a device to guest from upstream qemu monitor using "device_add". Unknowingly i try to add already registered devices from qemu monitor, my qemu monitor is aborted. I don't see a reason to kill monitor. I think abort() is a bit rough. we need a better way to handle it. If a user try to add a already registered device, qemu should convey this to user saying that, this device already registered and an error message should be fine than aborting qemu. QLIST_FOREACH(block, &ram_list.blocks, next) { if (!strcmp(block->idstr, new_block->idstr)) { fprintf(stderr, "RAMBlock \"%s\" already registered, abort!\n", new_block->idstr); abort(); } If i return some other value in above code, instead of abort(), I would need change the code for every device, which i dont want to. Is there a way to check, if device is already enrolled or not in the very beginning of "device_add" call. Thanks Pradeep