Received: from eggs.gnu.org ([2001:4830:134:3::10]:55381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0b0p-0000Qo-Us for qemu-devel@nongnu.org; Fri, 27 Jun 2014 14:36:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0b0j-0003fp-U8 for qemu-devel@nongnu.org; Fri, 27 Jun 2014 14:36:39 -0400 Message-ID: <1403894192.31091.201.camel@ul30vt.home> From: Alex Williamson Date: Fri, 27 Jun 2014 12:36:32 -0600 In-Reply-To: <1081899261.33608246.1403891502613.JavaMail.zimbra@redhat.com> References: <1403879569-24256-1-git-send-email-pbonzini@redhat.com> <1403886899.31091.187.camel@ul30vt.home> <1081899261.33608246.1403891502613.JavaMail.zimbra@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for 2.1] vfio: use correct runstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org On Fri, 2014-06-27 at 13:51 -0400, Paolo Bonzini wrote: > ----- Messaggio originale ----- > > Da: "Alex Williamson" > > A: "Paolo Bonzini" > > Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org > > Inviato: Venerd=C3=AC, 27 giugno 2014 18:34:59 > > Oggetto: Re: [PATCH for 2.1] vfio: use correct runstate > >=20 > > On Fri, 2014-06-27 at 16:32 +0200, Paolo Bonzini wrote: > > > io-error is for block device errors; it should always be preceded > > > by a BLOCK_IO_ERROR event. > >=20 > > Where does this requirement come from? I only see a loose associatio= n > > of IO_ERROR to disk in libvirt and none in QEMU. >=20 > See the RunState enum in qapi-schema.json: >=20 > ## > # @RunState > # > # An enumeration of VM run states. > # > # ... > # > # @internal-error: An internal error that prevents further guest execut= ion > # has occurred > # > # @io-error: the last IOP has failed and the device is configured to pa= use > # on I/O errors > # > # @paused: guest has been paused via the 'stop' command >=20 > The point of io-error is that management can look at block devices, see= if > any have an error reported, and then resume execution (see documentatio= n of > rerror=3Dstop and werror=3Dstop/enospc). This is counter to the intent= ions you > have in vfio. >=20 > > > I think vfio wants to use > > > RUN_STATE_INTERNAL_ERROR instead. > >=20 > > But that seems to put us into an "unknown" paused state in libvirt. >=20 > I think paused is incorrect, because (unlike RUN_STATE_IO_ERROR), you c= annot > resume from RUN_STATE_INTERNAL_ERROR except with a reset. QEMU enforce= s that, > and this matches the error you are reporting: >=20 > error_report("%s(%04x:%02x:%02x.%x) Unrecoverable error detected. = " > "Please collect any data possible and then kill the gu= est", > __func__, vdev->host.domain, vdev->host.bus, > vdev->host.slot, vdev->host.function); >=20 > libvirt has a crashed state, I think that's what libvirt should call th= e > internal-error runstate. IIRC on Xen you get to crashed when the proce= ssor > raises an error on vmentry, for example. >=20 > Libvirt only knows about crashed/unknown, but one could add crashed/int= ernal-error > too. Ok, I'll go with it. I'll include this in the pull request I intend to do on Monday. Thanks, Alex