qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 00/14]: Initial QObject conversion


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v1 00/14]: Initial QObject conversion
Date: Fri, 02 Oct 2009 16:17:35 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-2.7.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

On 10/02/09 15:47, Luiz Capitulino wrote:
On Fri, 02 Oct 2009 14:47:02 +0200
Gerd Hoffmann<address@hidden>  wrote:

    Hi,

   Some people have suggested that we should have a better error handling
in the Monitor, in the meaning that error information should be correctly
propagated and handled in order to be used by the Monitor Protocol and
the existing user protocol.

A bunch of code paths can be called from both monitor and non-monitor
contexts (network configuration, device hotplug).  Right now there are
the qemu_error*() functions to make sure the error messages appear on
the correct place (monitor or stderr) without having to pass through a
Monitor pointer all the way down.

How do you plan to handle this in the new world of monitor error reporting?

  Good question.

  The first thing to bear in mind is that MonitorError is not just about
error reporting, but more importantly, it makes errors have a common
structure so that they can be emitted by the Monitor Protocol.

So maybe they shouldn't be named MonitorError in the first place?
And make sure the design works for non-monitor contexts too?
Having the user_error callback in struct mon_cmd_t doesn't make sense from that point of view for example.

Why user_error is needed in the first place btw? To maintain backward-compatible error message formating?

  One way to solve the problem could be to move the MonitorError pointer
to the Monitor struct.

I think that is a good idea nevertheless.

This way, when there's a ERR_SINK_MONITOR
qemu_error() would fill MonitorError instead of calling monitor_vprintf().

  The bad news though, is that we would have to change all qemu_error()
calls to have "structured" errors instead of pretty printing, that is,
create macros, define its errors data and write functions to do
pretty printing....

Or add a qemu_error_structed() variant for smooth switchover and have qemu_error() use a generic error code, so you don't have to switch over all at once. There are not *that* many qemu_error users though, so just converting them all in one go might not be too hard.

cheers,
  Gerd





reply via email to

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