From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9Q6M-0007i2-PY for qemu-devel@nongnu.org; Tue, 04 May 2010 17:56:26 -0400 Received: from [140.186.70.92] (port=53835 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9Q6J-0007eh-NR for qemu-devel@nongnu.org; Tue, 04 May 2010 17:56:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9Q6I-0000ac-6b for qemu-devel@nongnu.org; Tue, 04 May 2010 17:56:23 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:48741) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9Q6I-0000aX-2A for qemu-devel@nongnu.org; Tue, 04 May 2010 17:56:22 -0400 Received: by vws6 with SMTP id 6so112167vws.4 for ; Tue, 04 May 2010 14:56:21 -0700 (PDT) Message-ID: <4BE09803.5040703@codemonkey.ws> Date: Tue, 04 May 2010 16:56:19 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-error: Introduce get_errno_name() References: <1272486729-14771-1-git-send-email-lcapitulino@redhat.com> <1272486729-14771-2-git-send-email-lcapitulino@redhat.com> <4BDECCB3.9000601@codemonkey.ws> <20100504105645.12e34117@redhat.com> <4BE02943.2010304@codemonkey.ws> <20100504173014.30f71418@redhat.com> In-Reply-To: <20100504173014.30f71418@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Markus Armbruster , qemu-devel@nongnu.org On 05/04/2010 03:30 PM, Luiz Capitulino wrote: > > StateVmSaveFailed is not like CommandFailed, there are five errors > in do_savevm() and StateVmSaveFailed happens to be one of them. > > But I understand what you mean and I have considered doing something > like it, one of the problems though is that I'm not sure 'source' is > enough to determine where the error has happened. > > Consider do_savevm() again. We have three 'operations' that might > fail: delete an existing snapshot, save the VM state and create the > snapshot. All those operations can return -EIO as an error. > Maybe those three operations should return distinct errnos? That way, we can make more useful QErrors. > So, the first question is: would you map EIO to an QError? Just like > you did for SocketIOError? If so, how would you know which operation > has failed? Would you put its name in source? Or have an additional > 'operation' key? > > A related problem is not to degrade the current set of error messages > we offer to the users. For do_savevm()'s 'save state' operation, current > message is: > > "Error -7 while writing VM" > > With StateVmSaveFailed it becomes: > > "Failed to save VM state ("EIO")" > I don't think this is that useful to preserve because as you said, it could be one of three things. Regards, Anthony Liguori > Given the current implementation of QError, I'm not sure how we can have > such a good error message if our QErrors are not 'operation based'. >