From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLaoN-0004C4-7J for qemu-devel@nongnu.org; Mon, 16 Sep 2013 11:34:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLaoH-0004Uj-4W for qemu-devel@nongnu.org; Mon, 16 Sep 2013 11:34:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLaoG-0004Ud-RA for qemu-devel@nongnu.org; Mon, 16 Sep 2013 11:33:57 -0400 Message-ID: <523724EC.4080105@redhat.com> Date: Mon, 16 Sep 2013 17:34:04 +0200 From: Paolo Bonzini MIME-Version: 1.0 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> <5236D957.80801@redhat.com> <20130916151400.GA4141@redhat.com> In-Reply-To: <20130916151400.GA4141@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: aliguori@us.ibm.com, gleb@redhat.com, Marcel Apfelbaum , sw@weilnetz.de, qemu-devel@nongnu.org, Markus Armbruster , afaerber@suse.de Il 16/09/2013 17:14, Michael S. Tsirkin ha scritto: > On Mon, Sep 16, 2013 at 12:11:35PM +0200, Paolo Bonzini wrote: >> Il 16/09/2013 11:54, Marcel Apfelbaum ha scritto: >>> 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. >>> 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 >>> 2. Change the architecture so boot order changing during hot-plug will be possible. >> >> This is done relatively easily in add_boot_device_path (check the >> qdev_hotplug variable and return an error if it is 1). > > This refers to 1) here? That's nice but it's not really all that helpful. True, but the error propagation changes are the base for both cases, and (1) is just 4 lines of code. So this seems like a plan to me: do the error propagation changes and (1), then we can revert those four lines when (2) is ready. Paolo