From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTPy7-0006j9-0E for qemu-devel@nongnu.org; Mon, 15 Sep 2014 02:41:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTPy0-0007uw-Sx for qemu-devel@nongnu.org; Mon, 15 Sep 2014 02:40:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTPy0-0007ui-L7 for qemu-devel@nongnu.org; Mon, 15 Sep 2014 02:40:52 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8F6eqaF029393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 15 Sep 2014 02:40:52 -0400 Message-ID: <1410763249.23112.11.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Mon, 15 Sep 2014 08:40:49 +0200 In-Reply-To: <1410549874-15980-1-git-send-email-armbru@redhat.com> References: <1410549874-15980-1-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] usb-storage: Fix how legacy init handles option ID clash List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, qemu-devel@nongnu.org On Fr, 2014-09-12 at 21:24 +0200, Markus Armbruster wrote: > usb_msd_init() calls qemu_opts_create() with a made-up ID and false > fail_if_exists. If the ID already exists, it happily messes up those > options, then fails drive_new(), because the BlockDriverState with > that ID already exists, too. > > Reproducer: -drive if=none,id=usb0,format=raw -usbdevice disk:tmp.qcow2 > > Pass true fail_if_exists to qemu_opts_create(), and if it fails, try > the next made-up ID. > > The reproducer now succeeds, and creates an usb-storage device with ID > usb1. > > Signed-off-by: Markus Armbruster Added to usb patch queue. thanks, Gerd