[libvirt] [PATCH] qemu:lxc:xml:libxl:xen: improve the error in openconsole/channel
lhuang
lhuang at redhat.com
Wed Jun 24 08:47:19 UTC 2015
On 06/24/2015 04:12 PM, Martin Kletzander wrote:
> On Mon, Jun 15, 2015 at 09:58:36PM +0800, Luyao Huang wrote:
>> We allow do not pass the dev_name to openconsole() and openchannel()
>> function, but the error message is not good when we do not specified
>> the console/channel name.
>>
>> the error message after this patch:
>> error: internal error: character device serial0 is not using a PTY
>>
>> Signed-off-by: Luyao Huang <lhuang at redhat.com>
>> ---
>> src/libxl/libxl_driver.c | 4 ++--
>> src/lxc/lxc_driver.c | 3 ++-
>> src/qemu/qemu_driver.c | 8 ++++----
>> src/uml/uml_driver.c | 3 ++-
>> src/xen/xen_driver.c | 3 ++-
>> 5 files changed, 12 insertions(+), 9 deletions(-)
>>
>> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
>> index a7be745..c64d9be 100644
>> --- a/src/libxl/libxl_driver.c
>> +++ b/src/libxl/libxl_driver.c
>> @@ -4292,14 +4292,14 @@ libxlDomainOpenConsole(virDomainPtr dom,
>> if (!chr) {
>> virReportError(VIR_ERR_INTERNAL_ERROR,
>> _("cannot find character device %s"),
>> - NULLSTR(dev_name));
>> + dev_name ? dev_name : "to open");
>> goto cleanup;
>> }
>>
>
> NACK to this hunk as that would be untranslatable. And not just
> because "to open" would stay as-is.
>
Got it, thanks for pointing out that.
>> if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
>> virReportError(VIR_ERR_INTERNAL_ERROR,
>> _("character device %s is not using a PTY"),
>> - NULLSTR(dev_name));
>> + dev_name ? dev_name : NULLSTR(chr->info.alias));
>> goto cleanup;
>> }
>>
>
> The rest look pretty fine, though, so I'll push that part in a while.
>
> With fixed-up commit message...
>
Thanks a lot for your review and help !
> Martin
Luyao
More information about the libvir-list
mailing list