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

Re: [Libguestfs] [PATCH 2/2] daemon: Don't need to prefix error messages with the command name.



On 12/02/10 14:43, Richard W.M. Jones wrote:
> From: Richard Jones <rjones redhat com>
> Date: Fri, 12 Feb 2010 14:06:25 +0000
> Subject: [PATCH 2/2] daemon: Don't need to prefix error messages with the command name.
> 
> The RPC stubs already prefix the command name to error messages.
> The daemon doesn't have to do this.  As a (small) benefit this also
> makes the daemon slightly smaller.
> 
> Code in the daemon such as:
> 
>   if (argv[0] == NULL) {
>     reply_with_error ("passed an empty list");
>     return NULL;
>   }
> 
> now results in error messages like this:
> 
>   ><fs> command ""
>   libguestfs: error: command: passed an empty list

Can you please check:

All prefix __func__:
NEED_AUG in augeas.c
NEED_ROOT
ABS_PATH
RESOLVE_DEVICE
XXX_NOT_IMPL
NOT_AVAILABLE in daemon.h
NEED_INOTIFY in inotify.c
RUN_PARTED in parted.c

What on earth is this (linkc:146):
    reply_with_error ("ln%s%s: %s: %s: %s",
                      flag ? " " : "",
                      flag ? : "",
                      target, linkname, err);

lvm.c:300:
      reply_with_error ("lvremove: %s: %s", xs[i], err);
lvm.c:317:
      reply_with_error ("vgremove: %s: %s", xs[i], err);
lvm.c:334:
      reply_with_error ("pvremove: %s: %s", xs[i], err);
lvm.c:453:
    reply_with_error ("vgchange: %s", err);
mount.c:155:
    reply_with_error ("mount: %s", err);
mount.c:254:
    reply_with_error ("mount: %s", err);
mount.c:296:
      reply_with_error ("umount: %s: %s", mounts[i], err);
parted.c:236:
    reply_with_error ("parted print: %s: %s", device,
wc.c:47:
    reply_with_error ("wc %s: %s", flag, err);

I think that's the lot. If we missed some we'll pick them up over time.
Incidentally, I used cscope to look for callers of reply_with_error in
deaemon/.

ACK.

Matt
-- 
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

M:       +44 (0)7977 267231
GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490


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