From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLWb2-0002IU-PP for qemu-devel@nongnu.org; Mon, 16 Sep 2013 07:04:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLWaw-0002rf-Ps for qemu-devel@nongnu.org; Mon, 16 Sep 2013 07:04:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLWaw-0002rY-Hz for qemu-devel@nongnu.org; Mon, 16 Sep 2013 07:03:54 -0400 Date: Mon, 16 Sep 2013 14:03:51 +0300 From: Gleb Natapov Message-ID: <20130916110351.GO17294@redhat.com> References: <1378924006-14057-1-git-send-email-marcel.a@redhat.com> <5231721D.4000109@redhat.com> <87sixagysq.fsf@blackfin.pond.sub.org> <1378982018.2186.23.camel@localhost.localdomain> <874n9qe1xi.fsf@blackfin.pond.sub.org> <1379325279.17705.54.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1379325279.17705.54.camel@localhost.localdomain> Subject: Re: [Qemu-devel] [PATCH] qdev-monitor: Avoid exiting when hot-plugging two devices with the same bootindex value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: aliguori@us.ibm.com, mst@redhat.com, sw@weilnetz.de, qemu-devel@nongnu.org, Markus Armbruster , Paolo Bonzini , afaerber@suse.de On Mon, Sep 16, 2013 at 12:54:39PM +0300, Marcel Apfelbaum wrote: > On Thu, 2013-09-12 at 13:04 +0200, Markus Armbruster wrote: > > Marcel Apfelbaum writes: > > > > > On Thu, 2013-09-12 at 11:43 +0200, Markus Armbruster wrote: > > >> Paolo Bonzini writes: > > >> > > >> > Il 11/09/2013 20:26, Marcel Apfelbaum ha scritto: > > >> >> Qemu is expected to quit if the same boot index value is used by > > >> >> two devices. > > >> >> However, hot-plugging a device with a bootindex value already used should > > >> >> fail with a friendly message rather than quitting a running VM. > > >> > > > >> > I think the problem is right where QEMU exits, i.e. in > > >> > add_boot_device_path. This function should return an error instead, via > > >> > an Error ** argument. > > >> > > >> Agree. > > I understood that the boot order is passed in fw cfg and updated only once at > "machine done". There is no update of this list after this point. The reason it is done at his point is because when add_boot_device_path() is called dev is not fully instantiated so qdev_get_fw_dev_path() cannot be called on it yet. For hotplug we need to re-create boot device list when device is fully ready. > Modifying the boot order from monitor does not work at all. > > So in order to solve this issue we can: > 1. Don't allow use of bootindex at hot-plug I'd rather have a proper fix then workaround. BTW this will change qmp interface so a command that worked before (for some definition of "worked") will start to fail. Markus proposed to ignore bootindex clash, also simple solution and has no downside described above, but has others that we discussed. > 2. Change the architecture so boot order changing during hot-plug will be possible. > This is an easy part of the problem though. The hard part how not to exit when bootindex clash happens ans this is easy since nobody knows how well device creation errors are handled by qdev. -- Gleb.