X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fdaemon.h;h=e8f29ad0e091693d5c77bf81a9c19a15314e2704;hb=7b45f7d04f8eecae7ab8e3db2193dcbbd3cd839f;hp=6e9788a32427cb7532a179b31929b0d981ad07e1;hpb=9ff99418361cd1b56b00e4ffef52444021e60c72;p=libguestfs.git diff --git a/daemon/daemon.h b/daemon/daemon.h index 6e9788a..e8f29ad 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,8 +81,8 @@ extern int prog_exists (const char *prog); extern void udev_settle (void); -/* This just stops gcc from giving a warning about our custom - * printf formatters %Q and %R. See HACKING file for more +/* This just stops gcc from giving a warning about our custom printf + * formatters %Q and %R. See guestfs(3)/EXTENDING LIBGUESTFS for more * info about these. */ static inline int @@ -103,6 +103,8 @@ extern const char *function_names[]; /*-- in proto.c --*/ extern int proc_nr; extern int serial; +extern uint64_t progress_hint; +extern uint64_t optargs_bitmask; /*-- in mount.c --*/ extern int root_mounted; @@ -124,6 +126,9 @@ extern struct optgroup optgroups[]; /* Use this as a replacement for sync(2). */ extern int sync_disks (void); +/*-- in ext2.c --*/ +extern int e2prog (char *name); /* Massive hack for RHEL 5. */ + /*-- in lvm.c --*/ extern int lv_canonical (const char *device, char **ret); @@ -148,10 +153,6 @@ extern int receive_file (receive_cb cb, void *opaque); /* daemon functions that receive files (FileIn) can call this * to cancel incoming transfers (eg. if there is a local error). - * - * If and only if this function does NOT return -2, they MUST then - * call reply_with_* - * (see https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5). */ extern int cancel_receive (void); @@ -177,8 +178,8 @@ extern void notify_progress (uint64_t position, uint64_t total); #define NEED_ROOT(cancel_stmt,fail_stmt) \ do { \ if (!root_mounted) { \ - if ((cancel_stmt) != -2) \ - reply_with_error ("%s: you must call 'mount' first to mount the root filesystem", __func__); \ + cancel_stmt; \ + reply_with_error ("%s: you must call 'mount' first to mount the root filesystem", __func__); \ fail_stmt; \ } \ } \ @@ -190,8 +191,8 @@ extern void notify_progress (uint64_t position, uint64_t total); #define ABS_PATH(path,cancel_stmt,fail_stmt) \ do { \ if ((path)[0] != '/') { \ - if ((cancel_stmt) != -2) \ - reply_with_error ("%s: path must start with a / character", __func__); \ + cancel_stmt; \ + reply_with_error ("%s: path must start with a / character", __func__); \ fail_stmt; \ } \ } while (0) @@ -206,18 +207,17 @@ extern void notify_progress (uint64_t position, uint64_t total); #define RESOLVE_DEVICE(path,cancel_stmt,fail_stmt) \ do { \ if (STRNEQLEN ((path), "/dev/", 5)) { \ - if ((cancel_stmt) != -2) \ - reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \ + cancel_stmt; \ + reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \ fail_stmt; \ } \ if (is_root_device (path)) \ reply_with_error ("%s: %s: device not found", __func__, path); \ if (device_name_translation ((path)) == -1) { \ int err = errno; \ - int r = cancel_stmt; \ + cancel_stmt; \ errno = err; \ - if (r != -2) \ - reply_with_perror ("%s: %s", __func__, path); \ + reply_with_perror ("%s: %s", __func__, path); \ fail_stmt; \ } \ } while (0)