qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/9] qdev: Use QError for not found error


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 7/9] qdev: Use QError for not found error
Date: Mon, 19 Oct 2009 09:00:33 -0500
User-agent: Thunderbird 2.0.0.23 (X11/20090825)

Daniel P. Berrange wrote:
hink just returning error codes to the client is far too little
information. I don't think we need the fully normalized structure
that Luiz originally proposed with bus/dev addresses split out, but
we certainly need to include a string description giving as much
detail as possible.  If attaching a host USB device failed, I don't
want a single error code QERR_OPEN_FAILED, nor a generic message like 'could not open device', i want the exact details, eg

'could not open device: permission denied' 'could not open device: no such file or directory' 'could not open device: device or resource busy'
The localization issue is somewhat of a red herring though. This string
description is not something that clients would ultimately expose to the
user. The client apps would likely present a more generic error message
to the user, based off the error code. The error description received
from QEMU will instead be written out to the logs as a record for later
troubleshooting. eg if the user files a bug report, it will include the
full error details, so libvirt/qemu maintainers have a better chance of
figuring out what went wrong.

But then advanced users end up doing silly things like analyzing libvirt logs. Why do that when your own example is obviously "could not open device: %s", strerror(errno). We should pass {"error" : {"type": "OpenFailedException", "errno": errno}}

--
Regards,

Anthony Liguori





reply via email to

[Prev in Thread] Current Thread [Next in Thread]