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
(whereas previously you would have seen ..command: command:..)
r = command (&out, &err,
"/sbin/blkid", "-o", "value", "-s", "TYPE", device, NULL);
if (r == -1) {
- reply_with_error ("vfs_type: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (out);
free (err);
return NULL;
do_blockdev_setbsz (const char *device, int blocksize)
{
if (blocksize <= 0 /* || blocksize >= what? */) {
- reply_with_error ("blockdev_setbsz: blocksize must be > 0");
+ reply_with_error ("blocksize must be > 0");
return -1;
}
return (int) call_blockdev (device, "--setbsz", blocksize, 0);
free (file2buf);
if (r == -1 || r > 1) {
- reply_with_error ("cmp: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
* commandv. We just have to check the list is non-empty.
*/
if (argv[0] == NULL) {
- reply_with_error ("command: passed an empty list");
+ reply_with_error ("passed an empty list");
return NULL;
}
free (destbuf);
if (r == -1) {
- reply_with_error ("%s: %s", cmd, err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
/*-- in proto.c --*/
extern void main_loop (int sock) __attribute__((noreturn));
-/* ordinary daemon functions use these to indicate errors */
+/* ordinary daemon functions use these to indicate errors
+ * NB: you don't need to prefix the string with the current command,
+ * it is added automatically by the client-side RPC stubs.
+ */
extern void reply_with_error (const char *fs, ...)
__attribute__((format (printf,1,2)));
extern void reply_with_perror_errno (int err, const char *fs, ...)
free (of_arg);
if (r == -1) {
- reply_with_error ("dd: %s: %s: %s", src, dest, err);
+ reply_with_error ("%s: %s: %s", src, dest, err);
free (err);
return -1;
}
char *out;
if (argc < 1) {
- reply_with_error ("debug: sh: expecting a command to run");
+ reply_with_error ("sh: expecting a command to run");
return NULL;
}
r = command (&out, &err, "df", NULL);
if (r == -1) {
- reply_with_error ("df: %s", err);
+ reply_with_error ("%s", err);
free (out);
free (err);
return NULL;
r = command (&out, &err, "df", "-h", NULL);
if (r == -1) {
- reply_with_error ("df -h: %s", err);
+ reply_with_error ("%s", err);
free (out);
free (err);
return NULL;
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("rmdir: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
char *buf, *err;
if (STREQ (path, "/")) {
- reply_with_error ("rm -rf: cannot remove root directory");
+ reply_with_error ("cannot remove root directory");
return -1;
}
/* rm -rf is never supposed to fail. I/O errors perhaps? */
if (r == -1) {
- reply_with_error ("rm -rf: %s: %s", path, err);
+ reply_with_error ("%s: %s", path, err);
free (err);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("mkdir: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("mkdir_mode: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("mkdir -p: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
if (r == -2) {
- reply_with_error ("mkdir -p: %s: a path element was not a directory", path);
+ reply_with_error ("%s: a path element was not a directory", path);
return -1;
}
CHROOT_OUT;
if (r == NULL) {
- reply_with_perror ("mkdtemp: %s", template);
+ reply_with_perror ("%s", template);
free (writable);
}
r = command (&out, &err, "dmesg", NULL);
if (r == -1) {
- reply_with_error ("dmesg: %s", err);
+ reply_with_error ("%s", err);
free (out);
free (err);
return NULL;
r = command (&out, &err, "du", "-s", buf, NULL);
free (buf);
if (r == -1) {
- reply_with_error ("du: %s: %s", path, err);
+ reply_with_error ("%s: %s", path, err);
free (out);
free (err);
return -1;
free (err);
if (sscanf (out, "%"SCNi64, &rv) != 1) {
- reply_with_error ("du: %s: could not read output: %s", path, out);
+ reply_with_error ("%s: could not read output: %s", path, out);
free (out);
return -1;
}
r = command (&out, &err, "/sbin/tune2fs", "-l", device, NULL);
if (r == -1) {
- reply_with_error ("tune2fs: %s", err);
+ reply_with_error ("%s", err);
free (err);
free (out);
return NULL;
p = strchr (p, '\n');
if (p) p++;
else {
- reply_with_error ("tune2fs: truncated output");
+ reply_with_error ("truncated output");
free (out);
return NULL;
}
r = command (NULL, &err, "/sbin/e2label", device, label, NULL);
if (r == -1) {
- reply_with_error ("e2label: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
r = command (&out, &err, "/sbin/e2label", device, NULL);
if (r == -1) {
- reply_with_error ("e2label: %s", err);
+ reply_with_error ("%s", err);
free (out);
free (err);
return NULL;
r = command (NULL, &err, "/sbin/tune2fs", "-U", uuid, device, NULL);
if (r == -1) {
- reply_with_error ("tune2fs -U: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
r = command (&out, &err, "/sbin/tune2fs", "-l", device, NULL);
if (r == -1) {
- reply_with_error ("tune2fs -l: %s", err);
+ reply_with_error ("%s", err);
free (out);
free (err);
return NULL;
r = command (NULL, &err, "/sbin/resize2fs", device, NULL);
if (r == -1) {
- reply_with_error ("resize2fs: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
r = command (NULL, &err, "/sbin/e2fsck", "-p", "-f", device, NULL);
if (r == -1) {
- reply_with_error ("e2fsck: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
"/sbin/mke2fs", "-O", "journal_dev", "-b", blocksize_s,
device, NULL);
if (r == -1) {
- reply_with_error ("mke2journal: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
"-L", label,
device, NULL);
if (r == -1) {
- reply_with_error ("mke2journal_L: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
"-U", uuid,
device, NULL);
if (r == -1) {
- reply_with_error ("mke2journal_U: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
if (access (progs[i], F_OK) == 0)
return progs[i];
- reply_with_error ("mke2fs: no mke2fs binary found in appliance");
+ reply_with_error ("no mke2fs binary found in appliance");
return NULL;
}
prog, "-t", fstype, "-J", jdev, "-b", blocksize_s,
device, NULL);
if (r == -1) {
- reply_with_error ("mke2fs_J: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
prog, "-t", fstype, "-J", jdev, "-b", blocksize_s,
device, NULL);
if (r == -1) {
- reply_with_error ("mke2fs_JL: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
prog, "-t", fstype, "-J", jdev, "-b", blocksize_s,
device, NULL);
if (r == -1) {
- reply_with_error ("mke2fs_JU: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_NOCTTY, 0666);
CHROOT_OUT;
if (fd == -1) {
- reply_with_perror ("failed to open %s", path);
+ reply_with_perror ("open: %s", path);
return -1;
}
r = posix_fallocate (fd, 0, len);
if (r == -1) {
- reply_with_perror ("posix_fallocate: %s", path);
+ reply_with_perror ("%s", path);
close (fd);
return -1;
}
if (size >= alloc) {
alloc += 8192;
if (alloc > max) {
- reply_with_error ("cat: %s: file is too large for message buffer",
+ reply_with_error ("%s: file is too large for message buffer",
path);
free (buf);
close (fd);
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("unlink: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("chmod: %s: 0%o", path, mode);
+ reply_with_perror ("%s: 0%o", path, mode);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("chown: %s: %d.%d", path, owner, group);
+ reply_with_perror ("%s: %d.%d", path, owner, group);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("lchown: %s: %d.%d", path, owner, group);
+ reply_with_perror ("%s: %d.%d", path, owner, group);
return -1;
}
* be caught later when we try to serialize the message.
*/
if (*size_r >= GUESTFS_MESSAGE_MAX) {
- reply_with_error ("read_file: %s: file is too large for the protocol, use guestfs_download instead", path);
+ reply_with_error ("%s: file is too large for the protocol, use guestfs_download instead", path);
close (fd);
return NULL;
}
* will be caught later when we try to serialize the message.
*/
if (count >= GUESTFS_MESSAGE_MAX) {
- reply_with_error ("pread: %s: count is too large for the protocol, use smaller reads", path);
+ reply_with_error ("%s: count is too large for the protocol, use smaller reads", path);
return NULL;
}
if (r == -1) {
free (out);
- reply_with_error ("file: %s: %s", path, err);
+ reply_with_error ("%s: %s", path, err);
free (err);
return NULL;
}
else if (STREQ (method, "bzip2"))
zcat = "bzcat";
else {
- reply_with_error ("zfile: unknown method");
+ reply_with_error ("unknown method");
return NULL;
}
free (cmd);
if (fgets (line, sizeof line, fp) == NULL) {
- reply_with_perror ("zfile: fgets");
+ reply_with_perror ("fgets");
fclose (fp);
return NULL;
}
if (fclose (fp) == -1) {
- reply_with_perror ("zfile: fclose");
+ reply_with_perror ("fclose");
return NULL;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("filesize: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
char buf[BUFSIZ];
if (c < 0 || c > 255) {
- reply_with_error ("fill: %d: byte number must be in range 0..255", c);
+ reply_with_error ("%d: byte number must be in range 0..255", c);
return -1;
}
memset (buf, c, BUFSIZ);
if (len < 0) {
- reply_with_error ("fill: %d: length is < 0", len);
+ reply_with_error ("%d: length is < 0", len);
return -1;
}
len_sz = (size_t) len;
}
}
if (pclose (fp) != 0) {
- reply_with_perror ("pclose: find");
+ reply_with_perror ("pclose");
free_stringslen (res, size);
return NULL;
}
r = commandr (NULL, &err, "/sbin/fsck", "-a", "-t", fstype, device, NULL);
if (r == -1) {
- reply_with_error ("fsck: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (err);
return -1;
}
if (r != 0) {
if (errno != 0)
- reply_with_perror ("glob: %s", pattern);
+ reply_with_perror ("%s", pattern);
else
reply_with_error ("glob failed: %s", pattern);
return NULL;
free (buf);
if (r == -1) {
- reply_with_error ("grub-install: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
r = command (&out, &err, "hexdump", "-C", buf, NULL);
free (buf);
if (r == -1) {
- reply_with_error ("hexdump: %s: %s", path, err);
+ reply_with_error ("%s: %s", path, err);
free (err);
free (out);
return NULL;
* be caught later when we try to serialize the message.
*/
if (*size_r >= GUESTFS_MESSAGE_MAX) {
- reply_with_error ("initrd_cat: %s:%s: file is too large for the protocol",
+ reply_with_error ("%s:%s: file is too large for the protocol",
path, filename);
goto cleanup;
}
NEED_ROOT (return -1);
if (max_events < 0) {
- reply_with_error ("inotify_init: max_events < 0");
+ reply_with_error ("max_events < 0");
return -1;
}
#ifdef HAVE_INOTIFY_INIT1
inotify_fd = inotify_init1 (IN_NONBLOCK | IN_CLOEXEC);
if (inotify_fd == -1) {
- reply_with_perror ("inotify_init");
+ reply_with_perror ("inotify_init1");
return -1;
}
#else
NEED_INOTIFY (-1);
if (inotify_fd == -1) {
- reply_with_error ("inotify_close: handle is not open");
+ reply_with_error ("handle is not open");
return -1;
}
r = inotify_add_watch (inotify_fd, buf, mask);
free (buf);
if (r == -1) {
- reply_with_perror ("inotify_add_watch: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
NEED_INOTIFY (-1);
if (inotify_rm_watch (inotify_fd, wd) == -1) {
- reply_with_perror ("inotify_rm_watch: %d", wd);
+ reply_with_perror ("%d", wd);
return -1;
}
goto error;
}
if (r == 0) { /* End of file - we're not expecting it. */
- reply_with_error ("inotify_read: unexpected end of file");
+ reply_with_error ("unexpected end of file");
goto error;
}
CHROOT_OUT;
if (fd_cwd == -1) {
- reply_with_perror ("readlinklist: %s", path);
+ reply_with_perror ("open: %s", path);
return NULL;
}
"/sbin/lvm", "lvresize",
"-L", size, logvol, NULL);
if (r == -1) {
- reply_with_error ("lvresize: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
r = command (NULL, &err,
"/sbin/lvm", "pvresize", device, NULL);
if (r == -1) {
- reply_with_error ("pvresize: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (err);
return -1;
}
"/sbin/lvm", "lvrename",
logvol, newlogvol, NULL);
if (r == -1) {
- reply_with_error ("lvrename: %s -> %s: %s", logvol, newlogvol, err);
+ reply_with_error ("%s -> %s: %s", logvol, newlogvol, err);
free (err);
return -1;
}
"/sbin/lvm", "vgrename",
volgroup, newvolgroup, NULL);
if (r == -1) {
- reply_with_error ("vgrename: %s -> %s: %s", volgroup, newvolgroup, err);
+ reply_with_error ("%s -> %s: %s", volgroup, newvolgroup, err);
free (err);
return -1;
}
r = commandv (NULL, &err, argv);
if (r == -1) {
- reply_with_error ("mkfs: %s: %s: %s", fstype, device, err);
+ reply_with_error ("%s: %s: %s", fstype, device, err);
free (err);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("mknod: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
is_root = STREQ (mountpoint, "/");
if (!root_mounted && !is_root) {
- reply_with_error ("mount: you must mount something on / first");
+ reply_with_error ("you must mount something on / first");
return -1;
}
"mount", "-o", options, device, mp, NULL);
free (mp);
if (r == -1) {
- reply_with_error ("mount: %s on %s: %s", device, mountpoint, error);
+ reply_with_error ("%s on %s: %s", device, mountpoint, error);
free (error);
return -1;
}
free (buf);
if (r == -1) {
- reply_with_error ("umount: %s: %s", pathordevice, err);
+ reply_with_error ("%s: %s", pathordevice, err);
free (err);
return -1;
}
free (mp);
free (buf);
if (r == -1) {
- reply_with_error ("mount: %s on %s: %s", file, mountpoint, error);
+ reply_with_error ("%s on %s: %s", file, mountpoint, error);
free (error);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("mkmountpoint: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
CHROOT_OUT;
if (r == -1) {
- reply_with_perror ("rmmountpoint: %s", path);
+ reply_with_perror ("%s", path);
return -1;
}
r = commandr (NULL, &err, "ntfs-3g.probe", rw_flag, device, NULL);
if (r == -1) {
- reply_with_error ("ntfs-3g.probe: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (err);
return -1;
}
{
parttype = check_parttype (parttype);
if (!parttype) {
- reply_with_error ("part-init: unknown partition type: common choices are \"gpt\" and \"msdos\"");
+ reply_with_error ("unknown partition type: common choices are \"gpt\" and \"msdos\"");
return -1;
}
else if (STREQ (prlogex, "e"))
prlogex = "extended";
else {
- reply_with_error ("part-add: unknown partition type: %s: this should be \"primary\", \"logical\" or \"extended\"", prlogex);
+ reply_with_error ("unknown partition type: %s: this should be \"primary\", \"logical\" or \"extended\"", prlogex);
return -1;
}
if (startsect < 0) {
- reply_with_error ("part-add: startsect cannot be negative");
+ reply_with_error ("startsect cannot be negative");
return -1;
}
/* but endsect can be negative */
parttype = check_parttype (parttype);
if (!parttype) {
- reply_with_error ("part-disk: unknown partition type: common choices are \"gpt\" and \"msdos\"");
+ reply_with_error ("unknown partition type: common choices are \"gpt\" and \"msdos\"");
return -1;
}
return NULL;
if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
- reply_with_error ("parted print: unknown signature, expected \"BYT;\" as first line of the output: %s",
+ reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
lines[0] ? lines[0] : "(signature was null)");
free_strings (lines);
return NULL;
}
if (lines[1] == NULL) {
- reply_with_error ("parted print: parted didn't return a line describing the device");
+ reply_with_error ("parted didn't return a line describing the device");
free_strings (lines);
return NULL;
}
|| strtok (NULL, ":") == NULL /* physical sector size */
|| (r = strtok (NULL, ":")) == NULL /* return value */
) {
- reply_with_error ("part_get_parttype: too few fields in output from parted print command: %s", lines[1]);
+ reply_with_error ("too few fields in output from parted print command: %s", lines[1]);
free_strings (lines);
return NULL;
}
&r->guestfs_int_partition_list_val[i].part_start,
&r->guestfs_int_partition_list_val[i].part_end,
&r->guestfs_int_partition_list_val[i].part_size) != 4) {
- reply_with_error ("part_list: could not parse row from output of parted print command: %s", lines[row]);
+ reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
goto error3;
}
}
ret = realpath (path, NULL);
CHROOT_OUT;
if (ret == NULL) {
- reply_with_perror ("realpath");
+ reply_with_perror ("%s", path);
return NULL;
}
if ((i == 1 && path[0] == '.') ||
(i == 2 && path[0] == '.' && path[1] == '.')) {
- reply_with_error ("case_sensitive_path: path contained . or .. elements");
+ reply_with_error ("path contained . or .. elements");
goto error;
}
if (i > NAME_MAX) {
- reply_with_error ("case_sensitive_path: path element too long");
+ reply_with_error ("path element too long");
goto error;
}
r = command (NULL, &err, "scrub", device, NULL);
if (r == -1) {
- reply_with_error ("scrub_device: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (err);
return -1;
}
r = command (NULL, &err, "scrub", "-r", buf, NULL);
free (buf);
if (r == -1) {
- reply_with_error ("scrub_file: %s: %s", file, err);
+ reply_with_error ("%s: %s", file, err);
free (err);
return -1;
}
r = command (NULL, &err, "scrub", "-X", buf, NULL);
free (buf);
if (r == -1) {
- reply_with_error ("scrub_freespace: %s: %s", dir, err);
+ reply_with_error ("%s: %s", dir, err);
free (err);
return -1;
}
r = command (&out, &err, "/sbin/sfdisk", flag, device, NULL);
if (r == -1) {
- reply_with_error ("sfdisk: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (out);
free (err);
return NULL;
CHROOT_OUT;
if (path_fd == -1) {
- reply_with_perror ("lstatlist: %s", path);
+ reply_with_perror ("%s", path);
free (ret->guestfs_int_stat_list_val);
free (ret);
return NULL;
r = command (&out, &err, "strings", "-e", encoding, buf, NULL);
free (buf);
if (r == -1) {
- reply_with_error ("strings: %s: %s", path, err);
+ reply_with_error ("%s: %s", path, err);
free (err);
free (out);
return NULL;
r = command (NULL, &err, "/sbin/mkswap", "-f", flag, value, device, NULL);
if (r == -1) {
- reply_with_error ("mkswap: %s", err);
+ reply_with_error ("%s", err);
free (err);
return -1;
}
r = command (NULL, &err, cmd, flag, value, NULL);
if (r == -1) {
- reply_with_error ("%s: %s: %s", cmd, value, err);
+ reply_with_error ("%s: %s", value, err);
free (err);
return -1;
}
if (!root_mounted || dir[0] != '/') {
cancel_receive ();
- reply_with_error ("tar-in: root must be mounted and path must be absolute");
+ reply_with_error ("root must be mounted and path must be absolute");
return -1;
}
if (!root_mounted || dir[0] != '/') {
cancel_receive ();
- reply_with_error ("tar-in: root must be mounted and path must be absolute");
+ reply_with_error ("root must be mounted and path must be absolute");
return -1;
}
if (!is_dev) {
if (!root_mounted || filename[0] != '/') {
cancel_receive ();
- reply_with_error ("upload: root must be mounted and path must be absolute");
+ reply_with_error ("root must be mounted and path must be absolute");
return -1;
}
}
/* Parse the number. */
if (sscanf (out, "%d", &r) != 1) {
- reply_with_error ("wc: cannot parse number: %s", out);
+ reply_with_error ("cannot parse number: %s", out);
free (out);
return -1;
}
#if defined(HAVE_LISTXATTR) && defined(HAVE_GETXATTR)
return getxattrs (path, listxattr, getxattr);
#else
- reply_with_error ("getxattrs: no support for listxattr and getxattr");
+ reply_with_error ("no support for listxattr and getxattr");
return NULL;
#endif
}
#if defined(HAVE_LLISTXATTR) && defined(HAVE_LGETXATTR)
return getxattrs (path, llistxattr, lgetxattr);
#else
- reply_with_error ("lgetxattrs: no support for llistxattr and lgetxattr");
+ reply_with_error ("no support for llistxattr and lgetxattr");
return NULL;
#endif
}
#if defined(HAVE_SETXATTR)
return _setxattr (xattr, val, vallen, path, setxattr);
#else
- reply_with_error ("setxattr: no support for setxattr");
+ reply_with_error ("no support for setxattr");
return -1;
#endif
}
#if defined(HAVE_LSETXATTR)
return _setxattr (xattr, val, vallen, path, lsetxattr);
#else
- reply_with_error ("lsetxattr: no support for lsetxattr");
+ reply_with_error ("no support for lsetxattr");
return -1;
#endif
}
#if defined(HAVE_REMOVEXATTR)
return _removexattr (xattr, path, removexattr);
#else
- reply_with_error ("removexattr: no support for removexattr");
+ reply_with_error ("no support for removexattr");
return -1;
#endif
}
#if defined(HAVE_LREMOVEXATTR)
return _removexattr (xattr, path, lremovexattr);
#else
- reply_with_error ("lremovexattr: no support for lremovexattr");
+ reply_with_error ("no support for lremovexattr");
return -1;
#endif
}
len = listxattr (path, NULL, 0);
CHROOT_OUT;
if (len == -1) {
- reply_with_perror ("listxattr");
+ reply_with_perror ("listxattr: %s", path);
goto error;
}
len = listxattr (path, buf, len);
CHROOT_OUT;
if (len == -1) {
- reply_with_perror ("listxattr");
+ reply_with_perror ("listxattr: %s", path);
goto error;
}
char *buf = NULL;
if (path_len >= PATH_MAX) {
- reply_with_perror ("lxattrlist: path longer than PATH_MAX");
+ reply_with_perror ("path longer than PATH_MAX");
goto error;
}
* outgoing struct list.
*/
if (path_len + strlen (names[k]) + 2 > PATH_MAX) {
- reply_with_perror ("lxattrlist: path and name longer than PATH_MAX");
+ reply_with_perror ("path and name longer than PATH_MAX");
goto error;
}
pathname[path_len] = '/';
}
return NULL;
#else
- reply_with_error ("lxattrlist: no support for llistxattr and lgetxattr");
+ reply_with_error ("no support for llistxattr and lgetxattr");
return NULL;
#endif
}
r = command (NULL, &err, "/usr/sbin/zerofree", device, NULL);
if (r == -1) {
- reply_with_error ("zerofree: %s: %s", device, err);
+ reply_with_error ("%s: %s", device, err);
free (err);
return -1;
}
pr " memset (&args, 0, sizeof args);\n";
pr "\n";
pr " if (!xdr_guestfs_%s_args (xdr_in, &args)) {\n" name;
- pr " reply_with_error (\"%%s: daemon failed to decode procedure arguments\", \"%s\");\n" name;
+ pr " reply_with_error (\"daemon failed to decode procedure arguments\");\n";
pr " return;\n";
pr " }\n";
let pr_args n =