Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-26 Thread Jes Sorensen
On 04/25/11 14:27, Ian Molton wrote: On Fri, 2011-04-22 at 13:51 +0200, Jes Sorensen wrote: Hiding things you miss when reading the code, it's a classic for people to do if(foo) bleh(); on the same line, and whoever reads the code will expect the action on the next line, especially if foo is

Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-25 Thread Ian Molton
On Fri, 2011-04-22 at 13:51 +0200, Jes Sorensen wrote: What kind of coding error does splitting this out aim to prevent? missing break; / return; statements? Because I dont see how it achieves that... Hiding things you miss when reading the code, it's a classic for people to do if(foo)

Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-22 Thread Michael Roth
On 04/21/2011 03:50 AM, Jes Sorensen wrote: On 04/18/11 17:02, Michael Roth wrote: +static const char *ga_log_level_str(GLogLevelFlags level) +{ +switch (level G_LOG_LEVEL_MASK) { +case G_LOG_LEVEL_ERROR: return error; +case G_LOG_LEVEL_CRITICAL: return critical; +

Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-22 Thread Ian Molton
On Thu, 2011-04-21 at 08:21 -0500, Michael Roth wrote: +switch (level G_LOG_LEVEL_MASK) { +case G_LOG_LEVEL_ERROR: return error; +case G_LOG_LEVEL_CRITICAL: return critical; +case G_LOG_LEVEL_WARNING: return warning; +case G_LOG_LEVEL_MESSAGE:

Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-22 Thread Jes Sorensen
On 04/22/11 11:23, Ian Molton wrote: On Thu, 2011-04-21 at 08:21 -0500, Michael Roth wrote: +switch (level G_LOG_LEVEL_MASK) { +case G_LOG_LEVEL_ERROR: return error; +case G_LOG_LEVEL_CRITICAL: return critical; +case G_LOG_LEVEL_WARNING: return warning; +

Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-21 Thread Jes Sorensen
On 04/18/11 17:02, Michael Roth wrote: +static const char *ga_log_level_str(GLogLevelFlags level) +{ +switch (level G_LOG_LEVEL_MASK) { +case G_LOG_LEVEL_ERROR: return error; +case G_LOG_LEVEL_CRITICAL: return critical; +case G_LOG_LEVEL_WARNING: return

[Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon

2011-04-18 Thread Michael Roth
This is the actual guest daemon, it listens for requests over a virtio-serial/isa-serial/unix socket channel and routes them through to dispatch routines, and writes the results back to the channel in a manner similar to QMP. A shorthand invocation: qemu-ga -d Is equivalent to: qemu-ga -c