Blame SOURCES/0145-lib-Change-program_name-macro-to-avoid-conflict-with.patch

ffd6ed
From e8b0be5d7dfbb8805c3c63e58f76e8e89b7c04b8 Mon Sep 17 00:00:00 2001
ffd6ed
From: "Richard W.M. Jones" <rjones@redhat.com>
ffd6ed
Date: Sat, 7 Feb 2015 16:27:03 +0000
ffd6ed
Subject: [PATCH] lib: Change 'program_name' macro to avoid conflict with
ffd6ed
 gnulib.
ffd6ed
ffd6ed
The gnulib 'error' module uses 'program_name'.  On some platforms --
ffd6ed
but not Linux / glibc -- it references it as:
ffd6ed
ffd6ed
  extern char *program_name;
ffd6ed
ffd6ed
This means when you compile libguestfs on non-glibc (eg. Mac OS X)
ffd6ed
gnulib requires 'program_name' as an external string reference, which
ffd6ed
we don't provide.
ffd6ed
ffd6ed
This change doesn't define this string reference for gnulib, but it
ffd6ed
does change the name of the macro we use to avoid conflicts if we
ffd6ed
eventually need to export 'program_name' as a string.
ffd6ed
ffd6ed
Thanks: Margaret Lewicka
ffd6ed
(cherry picked from commit 5cafedaa45d5993c54bf1827426171d9e23d77ae)
ffd6ed
---
ffd6ed
 align/scan.c                                  | 14 +++----
ffd6ed
 builder/index-validate.c                      | 18 ++++-----
ffd6ed
 cat/cat.c                                     |  8 ++--
ffd6ed
 cat/filesystems.c                             | 10 ++---
ffd6ed
 cat/log.c                                     | 18 ++++-----
ffd6ed
 cat/ls.c                                      | 12 +++---
ffd6ed
 cat/visit.c                                   |  4 +-
ffd6ed
 df/domains.c                                  | 10 ++---
ffd6ed
 df/main.c                                     | 14 +++----
ffd6ed
 df/parallel.c                                 |  2 +-
ffd6ed
 diff/diff.c                                   | 16 ++++----
ffd6ed
 edit/edit.c                                   | 12 +++---
ffd6ed
 fish/config.c                                 |  6 +--
ffd6ed
 fish/fish.c                                   | 54 +++++++++++++--------------
ffd6ed
 fish/inspect.c                                |  8 ++--
ffd6ed
 fish/options.c                                | 10 ++---
ffd6ed
 fish/options.h                                |  6 +--
ffd6ed
 fish/uri.c                                    |  8 ++--
ffd6ed
 fish/windows.c                                |  4 +-
ffd6ed
 format/format.c                               | 14 +++----
ffd6ed
 fuse/guestmount.c                             | 22 +++++------
ffd6ed
 fuse/guestunmount.c                           | 16 ++++----
ffd6ed
 fuse/test-guestmount-fd.c                     | 10 ++---
ffd6ed
 fuse/test-guestunmount-fd.c                   |  4 +-
ffd6ed
 generator/fish.ml                             |  4 +-
ffd6ed
 inspector/inspector.c                         | 32 ++++++++--------
ffd6ed
 make-fs/make-fs.c                             | 28 +++++++-------
ffd6ed
 p2v/conversion.c                              |  4 +-
ffd6ed
 p2v/gui.c                                     | 10 ++---
ffd6ed
 p2v/kernel.c                                  | 18 ++++-----
ffd6ed
 p2v/main.c                                    | 12 +++---
ffd6ed
 p2v/ssh.c                                     |  4 +-
ffd6ed
 rescue/rescue.c                               | 20 +++++-----
ffd6ed
 src/guestfs-internal-frontend.h               |  6 +--
ffd6ed
 tests/charsets/test-charset-fidelity.c        |  2 +-
ffd6ed
 tests/mount-local/test-parallel-mount-local.c |  4 +-
ffd6ed
 tests/parallel/test-parallel.c                |  2 +-
ffd6ed
 tests/qemu/qemu-boot.c                        | 20 +++++-----
ffd6ed
 tests/qemu/qemu-speed-test.c                  | 18 ++++-----
ffd6ed
 tests/regressions/rhbz790721.c                |  2 +-
ffd6ed
 tests/regressions/rhbz914931.c                |  2 +-
ffd6ed
 41 files changed, 244 insertions(+), 244 deletions(-)
ffd6ed
ffd6ed
diff --git a/align/scan.c b/align/scan.c
ffd6ed
index e803d8e..4740581 100644
ffd6ed
--- a/align/scan.c
ffd6ed
+++ b/align/scan.c
ffd6ed
@@ -71,7 +71,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: check alignment of virtual machine partitions\n"
ffd6ed
@@ -91,8 +91,8 @@ usage (int status)
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -149,7 +149,7 @@ main (int argc, char *argv[])
ffd6ed
         uuid = 1;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -168,7 +168,7 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
     case 'P':
ffd6ed
       if (sscanf (optarg, "%zu", &max_threads) != 1) {
ffd6ed
-        fprintf (stderr, _("%s: -P option is not numeric\n"), program_name);
ffd6ed
+        fprintf (stderr, _("%s: -P option is not numeric\n"), guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -226,13 +226,13 @@ main (int argc, char *argv[])
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
 #else
ffd6ed
     fprintf (stderr, _("%s: compiled without support for libvirt.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
 #endif
ffd6ed
   } else {                      /* Single guest. */
ffd6ed
     if (uuid) {
ffd6ed
       fprintf (stderr, _("%s: --uuid option cannot be used with -a or -d\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
diff --git a/builder/index-validate.c b/builder/index-validate.c
ffd6ed
index 782718d..0628a6f 100644
ffd6ed
--- a/builder/index-validate.c
ffd6ed
+++ b/builder/index-validate.c
ffd6ed
@@ -39,7 +39,7 @@ extern int do_parse (struct parse_context *context, FILE *in);
ffd6ed
 static void
ffd6ed
 usage (int exit_status)
ffd6ed
 {
ffd6ed
-  printf ("%s index\n", program_name);
ffd6ed
+  printf ("%s index\n", guestfs___program_name);
ffd6ed
   exit (exit_status);
ffd6ed
 }
ffd6ed
 
ffd6ed
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
ffd6ed
         compat_1_24_1 = 1;
ffd6ed
       else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -115,20 +115,20 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
   if (fclose (in) == EOF) {
ffd6ed
     fprintf (stderr, _("%s: %s: error closing input file: %m (ignored)\n"),
ffd6ed
-             program_name, input);
ffd6ed
+             guestfs___program_name, input);
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (ret != 0) {
ffd6ed
     parse_context_free (&context);
ffd6ed
     fprintf (stderr, _("%s: '%s' could not be validated, see errors above\n"),
ffd6ed
-             program_name, input);
ffd6ed
+             guestfs___program_name, input);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (compat_1_24_1 && context.seen_comments) {
ffd6ed
     parse_context_free (&context);
ffd6ed
     fprintf (stderr, _("%s: %s contains comments which will not work with virt-builder 1.24.1\n"),
ffd6ed
-             program_name, input);
ffd6ed
+             guestfs___program_name, input);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -141,7 +141,7 @@ main (int argc, char *argv[])
ffd6ed
       if (strchr (sections->name, '_')) {
ffd6ed
         parse_context_free (&context);
ffd6ed
         fprintf (stderr, _("%s: %s: section [%s] has invalid characters which will not work with virt-builder 1.24.0\n"),
ffd6ed
-                 program_name, input, sections->name);
ffd6ed
+                 guestfs___program_name, input, sections->name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
     }
ffd6ed
@@ -152,7 +152,7 @@ main (int argc, char *argv[])
ffd6ed
             strchr (fields->key, ']')) {
ffd6ed
           parse_context_free (&context);
ffd6ed
           fprintf (stderr, _("%s: %s: section [%s], field '%s' has invalid characters which will not work with virt-builder 1.24.0\n"),
ffd6ed
-                   program_name, input, sections->name, fields->key);
ffd6ed
+                   guestfs___program_name, input, sections->name, fields->key);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
       }
ffd6ed
@@ -161,7 +161,7 @@ main (int argc, char *argv[])
ffd6ed
             strchr (fields->key, ',')) {
ffd6ed
           parse_context_free (&context);
ffd6ed
           fprintf (stderr, _("%s: %s: section [%s], field '%s' has invalid characters which will not work with virt-builder 1.24.1\n"),
ffd6ed
-                   program_name, input, sections->name, fields->key);
ffd6ed
+                   guestfs___program_name, input, sections->name, fields->key);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
       }
ffd6ed
@@ -172,7 +172,7 @@ main (int argc, char *argv[])
ffd6ed
     if (compat_1_24_0 && !seen_sig) {
ffd6ed
       parse_context_free (&context);
ffd6ed
       fprintf (stderr, _("%s: %s: section [%s] is missing a 'sig' field which will not work with virt-builder 1.24.0\n"),
ffd6ed
-               program_name, input, sections->name);
ffd6ed
+               guestfs___program_name, input, sections->name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
diff --git a/cat/cat.c b/cat/cat.c
ffd6ed
index ec9c81f..a9de790 100644
ffd6ed
--- a/cat/cat.c
ffd6ed
+++ b/cat/cat.c
ffd6ed
@@ -51,7 +51,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: display files in a virtual machine\n"
ffd6ed
@@ -73,8 +73,8 @@ usage (int status)
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -136,7 +136,7 @@ main (int argc, char *argv[])
ffd6ed
         OPTION_format;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
diff --git a/cat/filesystems.c b/cat/filesystems.c
ffd6ed
index f9f887a..19b494e 100644
ffd6ed
--- a/cat/filesystems.c
ffd6ed
+++ b/cat/filesystems.c
ffd6ed
@@ -85,7 +85,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: list filesystems, partitions, block devices, LVM in a VM\n"
ffd6ed
@@ -122,8 +122,8 @@ usage (int status)
ffd6ed
              "                       Display LVM volume groups\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -237,7 +237,7 @@ main (int argc, char *argv[])
ffd6ed
         output |= OUTPUT_VGS;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -301,7 +301,7 @@ main (int argc, char *argv[])
ffd6ed
    */
ffd6ed
   if (human && csv) {
ffd6ed
     fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/cat/log.c b/cat/log.c
ffd6ed
index 0d8dab0..7c2595b 100644
ffd6ed
--- a/cat/log.c
ffd6ed
+++ b/cat/log.c
ffd6ed
@@ -60,7 +60,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: display log files in a virtual machine\n"
ffd6ed
@@ -80,8 +80,8 @@ usage (int status)
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -138,7 +138,7 @@ main (int argc, char *argv[])
ffd6ed
         OPTION_format;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -241,7 +241,7 @@ do_log (void)
ffd6ed
 
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: Windows Event Log for pre-Vista guests is not supported.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -349,7 +349,7 @@ do_log_journal (void)
ffd6ed
       if (strftime (buf, sizeof buf, "%b %d %H:%M:%S",
ffd6ed
                     localtime_r (&t, &tm)) <= 0) {
ffd6ed
         fprintf (stderr, _("%s: could not format journal entry timestamp\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         errors++;
ffd6ed
         continue;
ffd6ed
       }
ffd6ed
@@ -418,7 +418,7 @@ do_log_windows_evtx (void)
ffd6ed
                        "in order to parse Windows Event Logs.  If you cannot install this, then\n"
ffd6ed
                        "use virt-copy-out(1) to copy the contents of /Windows/System32/winevt/Logs\n"
ffd6ed
                        "from this guest, and examine in a binary file viewer.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -434,7 +434,7 @@ do_log_windows_evtx (void)
ffd6ed
                             GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1,
ffd6ed
                             -1) <= 0) {
ffd6ed
     fprintf (stderr, _("%s: Windows Event Log file (%s) not found\n"),
ffd6ed
-             program_name, filename);
ffd6ed
+             guestfs___program_name, filename);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -466,7 +466,7 @@ do_log_windows_evtx (void)
ffd6ed
   if (status) {
ffd6ed
     char buf[256];
ffd6ed
     fprintf (stderr, "%s: %s\n",
ffd6ed
-             program_name,
ffd6ed
+             guestfs___program_name,
ffd6ed
              guestfs___exit_status_to_string (status, "evtxdump.py",
ffd6ed
                                               buf, sizeof buf));
ffd6ed
     return -1;
ffd6ed
diff --git a/cat/ls.c b/cat/ls.c
ffd6ed
index 2cb4e74..8d7dfc9 100644
ffd6ed
--- a/cat/ls.c
ffd6ed
+++ b/cat/ls.c
ffd6ed
@@ -81,7 +81,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: list files in a virtual machine\n"
ffd6ed
@@ -114,8 +114,8 @@ usage (int status)
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -226,7 +226,7 @@ main (int argc, char *argv[])
ffd6ed
         enable_uids = 1;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -332,7 +332,7 @@ main (int argc, char *argv[])
ffd6ed
       (csv || human || enable_uids || enable_times || enable_extra_stats ||
ffd6ed
        checksum)) {
ffd6ed
     fprintf (stderr, _("%s: used a flag which can only be combined with -lR mode\nFor more information, read the virt-ls(1) man page.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -341,7 +341,7 @@ main (int argc, char *argv[])
ffd6ed
    */
ffd6ed
   if (human && csv) {
ffd6ed
     fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/cat/visit.c b/cat/visit.c
ffd6ed
index 49b779e..8588f31 100644
ffd6ed
--- a/cat/visit.c
ffd6ed
+++ b/cat/visit.c
ffd6ed
@@ -100,7 +100,7 @@ _visit (guestfs_h *g, int depth, const char *dir,
ffd6ed
 
ffd6ed
     if (xattrs->val[xattrp].attrval_len == 0) {
ffd6ed
       fprintf (stderr, _("%s: error getting extended attrs for %s %s\n"),
ffd6ed
-               program_name, dir, names[i]);
ffd6ed
+               guestfs___program_name, dir, names[i]);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
     /* attrval is not \0-terminated. */
ffd6ed
@@ -110,7 +110,7 @@ _visit (guestfs_h *g, int depth, const char *dir,
ffd6ed
     attrval[xattrs->val[xattrp].attrval_len] = '\0';
ffd6ed
     if (sscanf (attrval, "%zu", &nr_xattrs) != 1) {
ffd6ed
       fprintf (stderr, _("%s: error: cannot parse xattr count for %s %s\n"),
ffd6ed
-               program_name, dir, names[i]);
ffd6ed
+               guestfs___program_name, dir, names[i]);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
 
ffd6ed
diff --git a/df/domains.c b/df/domains.c
ffd6ed
index b2d9537..8943ebc 100644
ffd6ed
--- a/df/domains.c
ffd6ed
+++ b/df/domains.c
ffd6ed
@@ -82,7 +82,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
ffd6ed
     err = virGetLastError ();
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: could not connect to libvirt (code %d, domain %d): %s\n"),
ffd6ed
-             program_name, err->code, err->domain, err->message);
ffd6ed
+             guestfs___program_name, err->code, err->domain, err->message);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -91,7 +91,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
ffd6ed
     err = virGetLastError ();
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: could not get number of running domains (code %d, domain %d): %s\n"),
ffd6ed
-             program_name, err->code, err->domain, err->message);
ffd6ed
+             guestfs___program_name, err->code, err->domain, err->message);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -101,7 +101,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
ffd6ed
     err = virGetLastError ();
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: could not list running domains (code %d, domain %d): %s\n"),
ffd6ed
-             program_name, err->code, err->domain, err->message);
ffd6ed
+             guestfs___program_name, err->code, err->domain, err->message);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -112,7 +112,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
ffd6ed
     err = virGetLastError ();
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: could not get number of inactive domains (code %d, domain %d): %s\n"),
ffd6ed
-             program_name, err->code, err->domain, err->message);
ffd6ed
+             guestfs___program_name, err->code, err->domain, err->message);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -122,7 +122,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
ffd6ed
     err = virGetLastError ();
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: could not list inactive domains (code %d, domain %d): %s\n"),
ffd6ed
-             program_name, err->code, err->domain, err->message);
ffd6ed
+             guestfs___program_name, err->code, err->domain, err->message);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/df/main.c b/df/main.c
ffd6ed
index bddf2a9..fef1006 100644
ffd6ed
--- a/df/main.c
ffd6ed
+++ b/df/main.c
ffd6ed
@@ -64,7 +64,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: display free space on virtual filesystems\n"
ffd6ed
@@ -88,8 +88,8 @@ usage (int status)
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -153,7 +153,7 @@ main (int argc, char *argv[])
ffd6ed
         uuid = 1;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -180,7 +180,7 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
     case 'P':
ffd6ed
       if (sscanf (optarg, "%zu", &max_threads) != 1) {
ffd6ed
-        fprintf (stderr, _("%s: -P option is not numeric\n"), program_name);
ffd6ed
+        fprintf (stderr, _("%s: -P option is not numeric\n"), guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -260,7 +260,7 @@ main (int argc, char *argv[])
ffd6ed
    */
ffd6ed
   if (human && csv) {
ffd6ed
     fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -277,7 +277,7 @@ main (int argc, char *argv[])
ffd6ed
     free_domains ();
ffd6ed
 #else
ffd6ed
     fprintf (stderr, _("%s: compiled without support for libvirt.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
 #endif
ffd6ed
   }
ffd6ed
diff --git a/df/parallel.c b/df/parallel.c
ffd6ed
index 6d2e1cf..f7a628b 100644
ffd6ed
--- a/df/parallel.c
ffd6ed
+++ b/df/parallel.c
ffd6ed
@@ -259,7 +259,7 @@ worker_thread (void *thread_data_vp)
ffd6ed
 static void
ffd6ed
 thread_failure (const char *fn, int err)
ffd6ed
 {
ffd6ed
-  fprintf (stderr, "%s: %s: %s\n", program_name, fn, strerror (err));
ffd6ed
+  fprintf (stderr, "%s: %s: %s\n", guestfs___program_name, fn, strerror (err));
ffd6ed
 }
ffd6ed
 
ffd6ed
 #endif /* HAVE_LIBVIRT */
ffd6ed
diff --git a/diff/diff.c b/diff/diff.c
ffd6ed
index ad371b0..304ce84 100644
ffd6ed
--- a/diff/diff.c
ffd6ed
+++ b/diff/diff.c
ffd6ed
@@ -89,7 +89,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: list differences between virtual machines\n"
ffd6ed
@@ -125,8 +125,8 @@ usage (int status)
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "  --xattrs             Display extended attributes\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -258,7 +258,7 @@ main (int argc, char *argv[])
ffd6ed
         enable_xattrs = 1;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -315,7 +315,7 @@ main (int argc, char *argv[])
ffd6ed
   if (drvs == NULL || drvs2 == NULL) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: you must specify some -a|-A|-d|-D options, see %s(1)\n"),
ffd6ed
-             program_name, program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name);
ffd6ed
     usage (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -324,13 +324,13 @@ main (int argc, char *argv[])
ffd6ed
    */
ffd6ed
   if (human && csv) {
ffd6ed
     fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (optind != argc) {
ffd6ed
     fprintf (stderr, _("%s: extra arguments on the command line\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     usage (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -737,7 +737,7 @@ diff (struct file *file1, guestfs_h *g1, struct file *file2, guestfs_h *g2)
ffd6ed
     fprintf (stderr, "%s\n", cmd);
ffd6ed
   r = system (cmd);
ffd6ed
   if (!WIFEXITED (r) || WEXITSTATUS (r) != 0) {
ffd6ed
-    fprintf (stderr, _("%s: external diff command failed\n"), program_name);
ffd6ed
+    fprintf (stderr, _("%s: external diff command failed\n"), guestfs___program_name);
ffd6ed
     goto out;
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/edit/edit.c b/edit/edit.c
ffd6ed
index 20b2963..cc88eb1 100644
ffd6ed
--- a/edit/edit.c
ffd6ed
+++ b/edit/edit.c
ffd6ed
@@ -61,7 +61,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: Edit a file in a virtual machine\n"
ffd6ed
@@ -85,8 +85,8 @@ usage (int status)
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -153,7 +153,7 @@ main (int argc, char *argv[])
ffd6ed
         OPTION_format;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -165,7 +165,7 @@ main (int argc, char *argv[])
ffd6ed
     case 'b':
ffd6ed
       if (backup_extension) {
ffd6ed
         fprintf (stderr, _("%s: -b option given multiple times\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       backup_extension = optarg;
ffd6ed
@@ -182,7 +182,7 @@ main (int argc, char *argv[])
ffd6ed
     case 'e':
ffd6ed
       if (perl_expr) {
ffd6ed
         fprintf (stderr, _("%s: -e option given multiple times\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       perl_expr = optarg;
ffd6ed
diff --git a/fish/config.c b/fish/config.c
ffd6ed
index 7d319ad..cec0ae3 100644
ffd6ed
--- a/fish/config.c
ffd6ed
+++ b/fish/config.c
ffd6ed
@@ -57,13 +57,13 @@ read_config_from_file (const char *filename)
ffd6ed
     /*
ffd6ed
     if (verbose)
ffd6ed
       fprintf (stderr, "%s: reading configuration from %s\n",
ffd6ed
-               program_name, filename);
ffd6ed
+               guestfs___program_name, filename);
ffd6ed
     */
ffd6ed
 
ffd6ed
     if (config_read (&conf, fp) == CONFIG_FALSE) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: %s: line %d: error parsing configuration file: %s\n"),
ffd6ed
-               program_name, filename, config_error_line (&conf),
ffd6ed
+               guestfs___program_name, filename, config_error_line (&conf),
ffd6ed
                config_error_text (&conf));
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
@@ -165,7 +165,7 @@ parse_config (void)
ffd6ed
   if (verbose)
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: compiled without libconfig, guestfish configuration file ignored\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   */
ffd6ed
 }
ffd6ed
 
ffd6ed
diff --git a/fish/fish.c b/fish/fish.c
ffd6ed
index 6d07f36..db68804 100644
ffd6ed
--- a/fish/fish.c
ffd6ed
+++ b/fish/fish.c
ffd6ed
@@ -103,7 +103,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: guest filesystem shell\n"
ffd6ed
@@ -152,9 +152,9 @@ usage (int status)
ffd6ed
              "run again without -i and use 'run' + 'list-filesystems' + 'mount' cmds.\n"
ffd6ed
              "\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -251,7 +251,7 @@ main (int argc, char *argv[])
ffd6ed
         if (optarg) {
ffd6ed
           if (sscanf (optarg, "%d", &remote_control) != 1) {
ffd6ed
             fprintf (stderr, _("%s: --listen=PID: PID was not a number: %s\n"),
ffd6ed
-                     program_name, optarg);
ffd6ed
+                     guestfs___program_name, optarg);
ffd6ed
             exit (EXIT_FAILURE);
ffd6ed
           }
ffd6ed
         } else {
ffd6ed
@@ -259,7 +259,7 @@ main (int argc, char *argv[])
ffd6ed
           if (!p || sscanf (p, "%d", &remote_control) != 1) {
ffd6ed
             fprintf (stderr, _("%s: remote: $GUESTFISH_PID must be set"
ffd6ed
                                " to the PID of the remote process\n"),
ffd6ed
-                     program_name);
ffd6ed
+                     guestfs___program_name);
ffd6ed
             exit (EXIT_FAILURE);
ffd6ed
           }
ffd6ed
         }
ffd6ed
@@ -289,7 +289,7 @@ main (int argc, char *argv[])
ffd6ed
         complete_dest_paths = 0;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -308,14 +308,14 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
     case 'D':
ffd6ed
       fprintf (stderr, _("%s: warning: -D option is deprecated, use --no-dest-paths instead\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       complete_dest_paths = 0;
ffd6ed
       break;
ffd6ed
 
ffd6ed
     case 'f':
ffd6ed
       if (file) {
ffd6ed
         fprintf (stderr, _("%s: only one -f parameter can be given\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       file = optarg;
ffd6ed
@@ -512,7 +512,7 @@ main (int argc, char *argv[])
ffd6ed
   if (remote_control_listen && remote_control) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: cannot use --listen and --remote options at the same time\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -520,13 +520,13 @@ main (int argc, char *argv[])
ffd6ed
     if (optind < argc) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: extra parameters on the command line with --listen flag\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
     if (file) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: cannot use --listen and --file options at the same time\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
     rc_listen ();
ffd6ed
@@ -859,7 +859,7 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
ffd6ed
       if (p[len+1] && (p[len+1] != ' ' && p[len+1] != '\t')) {
ffd6ed
         fprintf (stderr,
ffd6ed
                  _("%s: command arguments not separated by whitespace\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         pcmd.status = -1;
ffd6ed
         return pcmd;
ffd6ed
       }
ffd6ed
@@ -868,14 +868,14 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
ffd6ed
       p++;
ffd6ed
       len = strcspn (p, "'");
ffd6ed
       if (p[len] == '\0') {
ffd6ed
-        fprintf (stderr, _("%s: unterminated single quote\n"), program_name);
ffd6ed
+        fprintf (stderr, _("%s: unterminated single quote\n"), guestfs___program_name);
ffd6ed
         pcmd.status = -1;
ffd6ed
         return pcmd;
ffd6ed
       }
ffd6ed
       if (p[len+1] && (p[len+1] != ' ' && p[len+1] != '\t')) {
ffd6ed
         fprintf (stderr,
ffd6ed
                  _("%s: command arguments not separated by whitespace\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         pcmd.status = -1;
ffd6ed
         return pcmd;
ffd6ed
       }
ffd6ed
@@ -899,7 +899,7 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
ffd6ed
         pend = &p[len];
ffd6ed
     } else {
ffd6ed
       fprintf (stderr, _("%s: internal error parsing string at '%s'\n"),
ffd6ed
-               program_name, p);
ffd6ed
+               guestfs___program_name, p);
ffd6ed
       abort ();
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -915,7 +915,7 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (i == argv_len) {
ffd6ed
-    fprintf (stderr, _("%s: too many arguments\n"), program_name);
ffd6ed
+    fprintf (stderr, _("%s: too many arguments\n"), guestfs___program_name);
ffd6ed
     pcmd.status = -1;
ffd6ed
     return pcmd;
ffd6ed
   }
ffd6ed
@@ -991,7 +991,7 @@ parse_quoted_string (char *p)
ffd6ed
       default:
ffd6ed
       error:
ffd6ed
         fprintf (stderr, _("%s: invalid escape sequence in string (starting at offset %d)\n"),
ffd6ed
-                 program_name, (int) (p - start));
ffd6ed
+                 guestfs___program_name, (int) (p - start));
ffd6ed
         return -1;
ffd6ed
       }
ffd6ed
       memmove (p+1, p+1+m, strlen (p+1+m) + 1);
ffd6ed
@@ -999,7 +999,7 @@ parse_quoted_string (char *p)
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (!*p) {
ffd6ed
-    fprintf (stderr, _("%s: unterminated double quote\n"), program_name);
ffd6ed
+    fprintf (stderr, _("%s: unterminated double quote\n"), guestfs___program_name);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -1062,7 +1062,7 @@ cmdline (char *argv[], size_t optind, size_t argc)
ffd6ed
 
ffd6ed
   cmd = argv[optind++];
ffd6ed
   if (STREQ (cmd, ":")) {
ffd6ed
-    fprintf (stderr, _("%s: empty command on command line\n"), program_name);
ffd6ed
+    fprintf (stderr, _("%s: empty command on command line\n"), guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -1191,7 +1191,7 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd,
ffd6ed
   }
ffd6ed
   if (ferror (stdout)) {
ffd6ed
     if (!pipecmd || pipe_error) {
ffd6ed
-      fprintf (stderr, "%s: write error%s\n", program_name,
ffd6ed
+      fprintf (stderr, "%s: write error%s\n", guestfs___program_name,
ffd6ed
                pipecmd ? " on pipe" : "");
ffd6ed
       r = -1;
ffd6ed
     }
ffd6ed
@@ -1734,13 +1734,13 @@ win_prefix_drive_letter (char drive_letter, const char *path)
ffd6ed
     return NULL;
ffd6ed
   if (roots[0] == NULL) {
ffd6ed
     fprintf (stderr, _("%s: to use Windows drive letters, you must inspect the guest (\"-i\" option or run \"inspect-os\" command)\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     return NULL;
ffd6ed
   }
ffd6ed
   drives = guestfs_inspect_get_drive_mappings (g, roots[0]);
ffd6ed
   if (drives == NULL || drives[0] == NULL) {
ffd6ed
     fprintf (stderr, _("%s: to use Windows drive letters, this must be a Windows guest\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     return NULL;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -1754,7 +1754,7 @@ win_prefix_drive_letter (char drive_letter, const char *path)
ffd6ed
 
ffd6ed
   if (device == NULL) {
ffd6ed
     fprintf (stderr, _("%s: drive '%c:' not found.  To list available drives do:\n  inspect-get-drive-mappings %s\n"),
ffd6ed
-             program_name, drive_letter, roots[0]);
ffd6ed
+             guestfs___program_name, drive_letter, roots[0]);
ffd6ed
     return NULL;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -1773,7 +1773,7 @@ win_prefix_drive_letter (char drive_letter, const char *path)
ffd6ed
 
ffd6ed
   if (mountpoint == NULL) {
ffd6ed
     fprintf (stderr, _("%s: to access '%c:', mount %s first.  One way to do this is:\n  umount-all\n  mount %s /\n"),
ffd6ed
-             program_name, drive_letter, device, device);
ffd6ed
+             guestfs___program_name, drive_letter, device, device);
ffd6ed
     return NULL;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -1810,7 +1810,7 @@ file_in (const char *arg)
ffd6ed
     const char *endmarker = &arg[3];
ffd6ed
     if (*endmarker == '\0') {
ffd6ed
       fprintf (stderr, "%s: missing end marker in -<< expression\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       return NULL;
ffd6ed
     }
ffd6ed
     ret = file_in_heredoc (endmarker);
ffd6ed
@@ -1875,7 +1875,7 @@ file_in_heredoc (const char *endmarker)
ffd6ed
    * is likely to be an error.
ffd6ed
    */
ffd6ed
   fprintf (stderr, "%s: end of input reached without finding '%s'\n",
ffd6ed
-           program_name, endmarker);
ffd6ed
+           guestfs___program_name, endmarker);
ffd6ed
   goto error2;
ffd6ed
 
ffd6ed
  found_end:
ffd6ed
diff --git a/fish/inspect.c b/fish/inspect.c
ffd6ed
index 841f1da..bd12b91 100644
ffd6ed
--- a/fish/inspect.c
ffd6ed
+++ b/fish/inspect.c
ffd6ed
@@ -60,7 +60,7 @@ inspect_mount_handle (guestfs_h *g)
ffd6ed
 {
ffd6ed
   if (live) {
ffd6ed
     fprintf (stderr, _("%s: don't use --live and -i options together\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -86,7 +86,7 @@ inspect_mount_handle (guestfs_h *g)
ffd6ed
         "If using other virt tools, this disk image won't work\n"
ffd6ed
         "with these tools.  Use the guestfish equivalent commands\n"
ffd6ed
         "(see the virt tool manual page).\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     guestfs___free_string_list (roots);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
@@ -107,7 +107,7 @@ inspect_mount_handle (guestfs_h *g)
ffd6ed
         "If using other virt tools, multi-boot operating systems won't work\n"
ffd6ed
         "with these tools.  Use the guestfish equivalent commands\n"
ffd6ed
         "(see the virt tool manual page).\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     guestfs___free_string_list (roots);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
@@ -156,7 +156,7 @@ inspect_mount_root (guestfs_h *g, const char *root)
ffd6ed
 
ffd6ed
   if (mount_errors)
ffd6ed
     fprintf (stderr, _("%s: some filesystems could not be mounted (ignored)\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
 }
ffd6ed
 
ffd6ed
 /* This function is called only if the above function was called,
ffd6ed
diff --git a/fish/options.c b/fish/options.c
ffd6ed
index f7870a4..8b12fd6 100644
ffd6ed
--- a/fish/options.c
ffd6ed
+++ b/fish/options.c
ffd6ed
@@ -105,7 +105,7 @@ add_drives_handle (guestfs_h *g, struct drv *drv, char next_drive)
ffd6ed
   if (next_drive > 'z') {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: too many drives added on the command line\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -269,19 +269,19 @@ display_mountpoints_on_failure (const char *mp_device,
ffd6ed
     return;
ffd6ed
 
ffd6ed
   fprintf (stderr, _("%s: '%s' could not be mounted.\n"),
ffd6ed
-           program_name, mp_device);
ffd6ed
+           guestfs___program_name, mp_device);
ffd6ed
 
ffd6ed
   if (user_supplied_options)
ffd6ed
     fprintf (stderr, _("%s: Check mount(8) man page to ensure options '%s'\n"
ffd6ed
                        "%s: are supported by the filesystem that is being mounted.\n"),
ffd6ed
-             program_name, user_supplied_options, program_name);
ffd6ed
+             guestfs___program_name, user_supplied_options, guestfs___program_name);
ffd6ed
 
ffd6ed
   fprintf (stderr, _("%s: Did you mean to mount one of these filesystems?\n"),
ffd6ed
-           program_name);
ffd6ed
+           guestfs___program_name);
ffd6ed
 
ffd6ed
   for (i = 0; fses[i] != NULL; i += 2) {
ffd6ed
     CLEANUP_FREE char *p = guestfs_canonical_device_name (g, fses[i]);
ffd6ed
-    fprintf (stderr, "%s: \t%s (%s)\n", program_name,
ffd6ed
+    fprintf (stderr, "%s: \t%s (%s)\n", guestfs___program_name,
ffd6ed
              p ? p : fses[i], fses[i+1]);
ffd6ed
   }
ffd6ed
 }
ffd6ed
diff --git a/fish/options.h b/fish/options.h
ffd6ed
index 2c568e6..93fb560 100644
ffd6ed
--- a/fish/options.h
ffd6ed
+++ b/fish/options.h
ffd6ed
@@ -218,7 +218,7 @@ extern void display_long_options (const struct option *) __attribute__((noreturn
ffd6ed
   {                                                                     \
ffd6ed
     struct guestfs_version *v = guestfs_version (g);                    \
ffd6ed
     printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n",                     \
ffd6ed
-            program_name,                                               \
ffd6ed
+            guestfs___program_name,                                               \
ffd6ed
             v->major, v->minor, v->release, v->extra);                  \
ffd6ed
     exit (EXIT_SUCCESS);                                                \
ffd6ed
   }
ffd6ed
@@ -226,7 +226,7 @@ extern void display_long_options (const struct option *) __attribute__((noreturn
ffd6ed
 #define OPTION_w                                                        \
ffd6ed
   if (read_only) {                                                      \
ffd6ed
     fprintf (stderr, _("%s: cannot mix --ro and --rw options\n"),       \
ffd6ed
-             program_name);                                             \
ffd6ed
+             guestfs___program_name);                                             \
ffd6ed
     exit (EXIT_FAILURE);                                                \
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -238,7 +238,7 @@ extern void display_long_options (const struct option *) __attribute__((noreturn
ffd6ed
     if (!format_consumed) {                                             \
ffd6ed
       fprintf (stderr,                                                  \
ffd6ed
                _("%s: --format parameter must appear before -a parameter\n"), \
ffd6ed
-               program_name);                                           \
ffd6ed
+               guestfs___program_name);                                           \
ffd6ed
       exit (EXIT_FAILURE);                                              \
ffd6ed
     }                                                                   \
ffd6ed
   } while (0)
ffd6ed
diff --git a/fish/uri.c b/fish/uri.c
ffd6ed
index f45c907..80e0235 100644
ffd6ed
--- a/fish/uri.c
ffd6ed
+++ b/fish/uri.c
ffd6ed
@@ -110,7 +110,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
ffd6ed
   uri = xmlParseURI (arg);
ffd6ed
   if (!uri) {
ffd6ed
     fprintf (stderr, _("%s: --add: could not parse URI '%s'\n"),
ffd6ed
-             program_name, arg);
ffd6ed
+             guestfs___program_name, arg);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -121,7 +121,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
ffd6ed
   if (uri->scheme == NULL || STREQ (uri->scheme, "")) {
ffd6ed
     /* Probably can never happen. */
ffd6ed
     fprintf (stderr, _("%s: %s: scheme of URI is NULL or empty\n"),
ffd6ed
-             program_name, arg);
ffd6ed
+             guestfs___program_name, arg);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -129,14 +129,14 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
ffd6ed
 
ffd6ed
   if (uri->server && STRNEQ (uri->server, "") && socket) {
ffd6ed
     fprintf (stderr, _("%s: %s: cannot both a server name and a socket query parameter\n"),
ffd6ed
-             program_name, arg);
ffd6ed
+             guestfs___program_name, arg);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
   /* Is this needed? XXX
ffd6ed
   if (socket && socket[0] != '/') {
ffd6ed
     fprintf (stderr, _("%s: --add %s: socket query parameter must be an absolute path\n"),
ffd6ed
-             program_name, arg);
ffd6ed
+             guestfs___program_name, arg);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
   */
ffd6ed
diff --git a/fish/windows.c b/fish/windows.c
ffd6ed
index 04ead2f..63c5cae 100644
ffd6ed
--- a/fish/windows.c
ffd6ed
+++ b/fish/windows.c
ffd6ed
@@ -104,7 +104,7 @@ mount_drive_letter (guestfs_h *g, char drive_letter, const char *root,
ffd6ed
     guestfs_inspect_get_drive_mappings (g, root);
ffd6ed
   if (drives == NULL || drives[0] == NULL) {
ffd6ed
     fprintf (stderr, _("%s: to use Windows drive letters, this must be a Windows guest\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -118,7 +118,7 @@ mount_drive_letter (guestfs_h *g, char drive_letter, const char *root,
ffd6ed
 
ffd6ed
   if (device == NULL) {
ffd6ed
     fprintf (stderr, _("%s: drive '%c:' not found.\n"),
ffd6ed
-             program_name, drive_letter);
ffd6ed
+             guestfs___program_name, drive_letter);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/format/format.c b/format/format.c
ffd6ed
index 1651f31..06c138c 100644
ffd6ed
--- a/format/format.c
ffd6ed
+++ b/format/format.c
ffd6ed
@@ -63,7 +63,7 @@ usage (int status)
ffd6ed
 
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n%s\n"),
ffd6ed
-             program_name, warning);
ffd6ed
+             guestfs___program_name, warning);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: erase and make a blank disk\n"
ffd6ed
@@ -88,7 +88,7 @@ usage (int status)
ffd6ed
              "For more information, see the manpage %s(1).\n"
ffd6ed
              "\n"
ffd6ed
              "%s\n\n"),
ffd6ed
-             program_name, warning, program_name, program_name,
ffd6ed
+             guestfs___program_name, warning, guestfs___program_name, guestfs___program_name,
ffd6ed
              warning);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
@@ -146,7 +146,7 @@ main (int argc, char *argv[])
ffd6ed
           filesystem = NULL;
ffd6ed
         else if (optarg[0] == '-') { /* eg: --filesystem --lvm */
ffd6ed
           fprintf (stderr, _("%s: no filesystem was specified\n"),
ffd6ed
-                   program_name);
ffd6ed
+                   guestfs___program_name);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         } else
ffd6ed
           filesystem = optarg;
ffd6ed
@@ -154,7 +154,7 @@ main (int argc, char *argv[])
ffd6ed
         if (vg || lv) {
ffd6ed
           fprintf (stderr,
ffd6ed
                    _("%s: --lvm option cannot be given multiple times\n"),
ffd6ed
-                   program_name);
ffd6ed
+                   guestfs___program_name);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
         if (optarg == NULL) {
ffd6ed
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
ffd6ed
         label = optarg;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -272,7 +272,7 @@ main (int argc, char *argv[])
ffd6ed
                  "may mean there is some sort of partition table or disk\n"
ffd6ed
                  "data which we are unable to remove.  If you think this\n"
ffd6ed
                  "is a bug, please file a bug at http://libguestfs.org/\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -310,7 +310,7 @@ parse_vg_lv (const char *lvm)
ffd6ed
   } else {
ffd6ed
   cannot_parse:
ffd6ed
     fprintf (stderr, _("%s: cannot parse --lvm option (%s)\n"),
ffd6ed
-             program_name, lvm);
ffd6ed
+             guestfs___program_name, lvm);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/fuse/guestmount.c b/fuse/guestmount.c
ffd6ed
index 519bba3..abb93c0 100644
ffd6ed
--- a/fuse/guestmount.c
ffd6ed
+++ b/fuse/guestmount.c
ffd6ed
@@ -88,7 +88,7 @@ static void __attribute__((noreturn))
ffd6ed
 fuse_help (void)
ffd6ed
 {
ffd6ed
   static struct fuse_operations null_operations;
ffd6ed
-  const char *tmp_argv[] = { program_name, "--help", NULL };
ffd6ed
+  const char *tmp_argv[] = { guestfs___program_name, "--help", NULL };
ffd6ed
   fuse_main (2, (char **) tmp_argv, &null_operations, NULL);
ffd6ed
   exit (EXIT_SUCCESS);
ffd6ed
 }
ffd6ed
@@ -98,7 +98,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: FUSE module for libguestfs\n"
ffd6ed
@@ -131,7 +131,7 @@ usage (int status)
ffd6ed
              "  -w|--rw              Mount read-write\n"
ffd6ed
              "  -x|--trace           Trace guestfs API calls\n"
ffd6ed
              ),
ffd6ed
-             program_name, program_name, program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -242,12 +242,12 @@ main (int argc, char *argv[])
ffd6ed
       } else if (STREQ (long_options[option_index].name, "fd")) {
ffd6ed
         if (sscanf (optarg, "%d", &pipe_fd) != 1 || pipe_fd < 0) {
ffd6ed
           fprintf (stderr, _("%s: unable to parse --fd option value: %s\n"),
ffd6ed
-                   program_name, optarg);
ffd6ed
+                   guestfs___program_name, optarg);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -317,7 +317,7 @@ main (int argc, char *argv[])
ffd6ed
     if (!drvs || !(mps || inspector)) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: must have at least one -a/-d and at least one -m/-i option\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   } else {
ffd6ed
@@ -327,14 +327,14 @@ main (int argc, char *argv[])
ffd6ed
     if (read_only) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: --live is not compatible with --ro option\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
     if (inspector) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: --live is not compatible with -i option\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -349,14 +349,14 @@ main (int argc, char *argv[])
ffd6ed
     if (count_d != 1) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: with --live, you must use exactly one -d option\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
     if (count_other != 0) {
ffd6ed
       fprintf (stderr,
ffd6ed
                _("%s: --live is not compatible with -a option\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -365,7 +365,7 @@ main (int argc, char *argv[])
ffd6ed
   if (optind+1 != argc) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: you must specify a mountpoint in the host filesystem\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/fuse/guestunmount.c b/fuse/guestunmount.c
ffd6ed
index c36c336..3df481b 100644
ffd6ed
--- a/fuse/guestunmount.c
ffd6ed
+++ b/fuse/guestunmount.c
ffd6ed
@@ -50,7 +50,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: clean up a mounted filesystem\n"
ffd6ed
@@ -66,7 +66,7 @@ usage (int status)
ffd6ed
              "  -v|--verbose         Verbose messages\n"
ffd6ed
              "  -V|--version         Display version and exit\n"
ffd6ed
              ),
ffd6ed
-             program_name, program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -109,7 +109,7 @@ main (int argc, char *argv[])
ffd6ed
       if (STREQ (long_options[option_index].name, "fd")) {
ffd6ed
         if (sscanf (optarg, "%d", &fd) != 1 || fd < 0) {
ffd6ed
           fprintf (stderr, _("%s: cannot parse fd option '%s'\n"),
ffd6ed
-                   program_name, optarg);
ffd6ed
+                   guestfs___program_name, optarg);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
       } else if (STREQ (long_options[option_index].name, "no-retry")) {
ffd6ed
@@ -117,12 +117,12 @@ main (int argc, char *argv[])
ffd6ed
       } else if (STREQ (long_options[option_index].name, "retry")) {
ffd6ed
         if (sscanf (optarg, "%zu", &retries) != 1 || retries >= 64) {
ffd6ed
           fprintf (stderr, _("%s: cannot parse retries option or value is too large '%s'\n"),
ffd6ed
-                   program_name, optarg);
ffd6ed
+                   guestfs___program_name, optarg);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -151,7 +151,7 @@ main (int argc, char *argv[])
ffd6ed
   if (optind+1 != argc) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: you must specify a mountpoint in the host filesystem\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -206,7 +206,7 @@ main (int argc, char *argv[])
ffd6ed
   /* fusermount failed after N retries */
ffd6ed
   if (!quiet) {
ffd6ed
     fprintf (stderr, _("%s: failed to unmount %s: %s\n"),
ffd6ed
-             program_name, mountpoint, error);
ffd6ed
+             guestfs___program_name, mountpoint, error);
ffd6ed
     do_fuser (mountpoint);
ffd6ed
   }
ffd6ed
   free (error);
ffd6ed
@@ -217,7 +217,7 @@ main (int argc, char *argv[])
ffd6ed
  not_mounted:
ffd6ed
   if (!quiet)
ffd6ed
     fprintf (stderr, _("%s: %s is not mounted: %s\n"),
ffd6ed
-             program_name, mountpoint, error);
ffd6ed
+             guestfs___program_name, mountpoint, error);
ffd6ed
 
ffd6ed
   free (error);
ffd6ed
 
ffd6ed
diff --git a/fuse/test-guestmount-fd.c b/fuse/test-guestmount-fd.c
ffd6ed
index 2b3ce5b..f969cf1 100644
ffd6ed
--- a/fuse/test-guestmount-fd.c
ffd6ed
+++ b/fuse/test-guestmount-fd.c
ffd6ed
@@ -52,7 +52,7 @@ main (int argc, char *argv[])
ffd6ed
   skip = getenv ("SKIP_TEST_GUESTMOUNT_FD");
ffd6ed
   if (skip && guestfs___is_true (skip) > 0) {
ffd6ed
     fprintf (stderr, "%s: test skipped because environment variable set.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (77);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -117,7 +117,7 @@ main (int argc, char *argv[])
ffd6ed
   }
ffd6ed
   if (r == 0) {
ffd6ed
     fprintf (stderr, "%s: unexpected end of file on pipe fd.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     ignore_value (rmdir (MOUNTPOINT));
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
@@ -125,7 +125,7 @@ main (int argc, char *argv[])
ffd6ed
   /* Check that the test image was mounted. */
ffd6ed
   if (access (TEST_FILE, R_OK) == -1) {
ffd6ed
     fprintf (stderr, "%s: test failed because test image is not mounted and ready.",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     ignore_value (rmdir (MOUNTPOINT));
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
@@ -135,7 +135,7 @@ main (int argc, char *argv[])
ffd6ed
   if (r != 0) {
ffd6ed
     char status_string[80];
ffd6ed
 
ffd6ed
-    fprintf (stderr, "%s: test failed: %s\n", program_name,
ffd6ed
+    fprintf (stderr, "%s: test failed: %s\n", guestfs___program_name,
ffd6ed
              guestfs___exit_status_to_string (r, GUESTUNMOUNT_BINARY,
ffd6ed
                                               status_string,
ffd6ed
                                               sizeof status_string));
ffd6ed
@@ -156,7 +156,7 @@ main (int argc, char *argv[])
ffd6ed
     char status_string[80];
ffd6ed
 
ffd6ed
     fprintf (stderr, "%s: test failed: %s\n",
ffd6ed
-             program_name,
ffd6ed
+             guestfs___program_name,
ffd6ed
              guestfs___exit_status_to_string (status, GUESTMOUNT_BINARY,
ffd6ed
                                               status_string,
ffd6ed
                                               sizeof status_string));
ffd6ed
diff --git a/fuse/test-guestunmount-fd.c b/fuse/test-guestunmount-fd.c
ffd6ed
index 5a75469..9ddc842 100644
ffd6ed
--- a/fuse/test-guestunmount-fd.c
ffd6ed
+++ b/fuse/test-guestunmount-fd.c
ffd6ed
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
ffd6ed
   if (r != 0) {
ffd6ed
     char status_string[80];
ffd6ed
 
ffd6ed
-    fprintf (stderr, "%s: test failed: %s\n", program_name,
ffd6ed
+    fprintf (stderr, "%s: test failed: %s\n", guestfs___program_name,
ffd6ed
              guestfs___exit_status_to_string (r, "guestunmount",
ffd6ed
                                               status_string,
ffd6ed
                                               sizeof status_string));
ffd6ed
@@ -105,7 +105,7 @@ main (int argc, char *argv[])
ffd6ed
     char status_string[80];
ffd6ed
 
ffd6ed
     fprintf (stderr, "%s: test failed: guestunmount didn't return status code 2; %s\n",
ffd6ed
-             program_name,
ffd6ed
+             guestfs___program_name,
ffd6ed
              guestfs___exit_status_to_string (status, "guestunmount",
ffd6ed
                                               status_string,
ffd6ed
                                               sizeof status_string));
ffd6ed
diff --git a/generator/fish.ml b/generator/fish.ml
ffd6ed
index 6d6802a..fce7c92 100644
ffd6ed
--- a/generator/fish.ml
ffd6ed
+++ b/generator/fish.ml
ffd6ed
@@ -486,7 +486,7 @@ Guestfish will prompt for these separately."
ffd6ed
             pr "    case -1:\n";
ffd6ed
             pr "      fprintf (stderr,\n";
ffd6ed
             pr "               _(\"%%s: '%%s': invalid boolean value, use 'true' or 'false'\\n\"),\n";
ffd6ed
-            pr "               program_name, argv[i-1]);\n";
ffd6ed
+            pr "               guestfs___program_name, argv[i-1]);\n";
ffd6ed
             pr "      goto out_%s;\n" name;
ffd6ed
             pr "    case 0:  %s = 0; break;\n" name;
ffd6ed
             pr "    default: %s = 1;\n" name;
ffd6ed
@@ -529,7 +529,7 @@ Guestfish will prompt for these separately."
ffd6ed
                  pr "        case -1:\n";
ffd6ed
                  pr "          fprintf (stderr,\n";
ffd6ed
                  pr "                   _(\"%%s: '%%s': invalid boolean value, use 'true' or 'false'\\n\"),\n";
ffd6ed
-                 pr "                   program_name, &argv[i][%d]);\n" (len+1);
ffd6ed
+                 pr "                   guestfs___program_name, &argv[i][%d]);\n" (len+1);
ffd6ed
                  pr "          goto out;\n";
ffd6ed
                  pr "        case 0:  optargs_s.%s = 0; break;\n" n;
ffd6ed
                  pr "        default: optargs_s.%s = 1;\n" n;
ffd6ed
diff --git a/inspector/inspector.c b/inspector/inspector.c
ffd6ed
index 71795ce..a9709c1 100644
ffd6ed
--- a/inspector/inspector.c
ffd6ed
+++ b/inspector/inspector.c
ffd6ed
@@ -65,7 +65,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: display information about a virtual machine\n"
ffd6ed
@@ -86,8 +86,8 @@ usage (int status)
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "  --xpath query        Perform an XPath query\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -147,7 +147,7 @@ main (int argc, char *argv[])
ffd6ed
         xpath = optarg;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -240,7 +240,7 @@ main (int argc, char *argv[])
ffd6ed
   if (xpath) {
ffd6ed
     if (drvs != NULL) {
ffd6ed
       fprintf (stderr, _("%s: cannot use --xpath together with other options.\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -274,7 +274,7 @@ main (int argc, char *argv[])
ffd6ed
     CLEANUP_FREE_STRING_LIST char **roots = guestfs_inspect_os (g);
ffd6ed
     if (roots == NULL) {
ffd6ed
       fprintf (stderr, _("%s: no operating system could be detected inside this disk image.\n\nThis may be because the file is not a disk image, or is not a virtual machine\nimage, or because the OS type is not understood by libguestfs.\n\nNOTE for Red Hat Enterprise Linux 6 users: for Windows guest support you must\ninstall the separate libguestfs-winsupport package.\n\nIf you feel this is an error, please file a bug report including as much\ninformation about the disk image as possible.\n"),
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -289,7 +289,7 @@ main (int argc, char *argv[])
ffd6ed
 #define XMLERROR(code,e) do {                                           \
ffd6ed
     if ((e) == (code)) {                                                \
ffd6ed
       fprintf (stderr, _("%s: XML write error at \"%s\": %m\n"),        \
ffd6ed
-               #e, program_name);                                       \
ffd6ed
+               #e, guestfs___program_name);                                       \
ffd6ed
       exit (EXIT_FAILURE);                                              \
ffd6ed
     }                                                                   \
ffd6ed
   } while (0)
ffd6ed
@@ -301,7 +301,7 @@ output (char **roots)
ffd6ed
   if (ob == NULL) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: xmlOutputBufferCreateFd: failed to open stdout\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -310,7 +310,7 @@ output (char **roots)
ffd6ed
   if (xo == NULL) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: xmlNewTextWriter: failed to create libxml2 writer\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -768,21 +768,21 @@ do_xpath (const char *query)
ffd6ed
 
ffd6ed
   doc = xmlReadFd (STDIN_FILENO, NULL, "utf8", 0);
ffd6ed
   if (doc == NULL) {
ffd6ed
-    fprintf (stderr, _("%s: unable to parse XML from stdin\n"), program_name);
ffd6ed
+    fprintf (stderr, _("%s: unable to parse XML from stdin\n"), guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
   xpathCtx = xmlXPathNewContext (doc);
ffd6ed
   if (xpathCtx == NULL) {
ffd6ed
     fprintf (stderr, _("%s: unable to create new XPath context\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
   xpathObj = xmlXPathEvalExpression (BAD_CAST query, xpathCtx);
ffd6ed
   if (xpathObj == NULL) {
ffd6ed
     fprintf (stderr, _("%s: unable to evaluate XPath expression\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -794,26 +794,26 @@ do_xpath (const char *query)
ffd6ed
 
ffd6ed
     saveCtx = xmlSaveToFd (STDOUT_FILENO, NULL, XML_SAVE_NO_DECL);
ffd6ed
     if (saveCtx == NULL) {
ffd6ed
-      fprintf (stderr, _("%s: xmlSaveToFd failed\n"), program_name);
ffd6ed
+      fprintf (stderr, _("%s: xmlSaveToFd failed\n"), guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
     for (i = 0; i < (size_t) nodes->nodeNr; ++i) {
ffd6ed
       CLEANUP_XMLFREEDOC xmlDocPtr wrdoc = xmlNewDoc (BAD_CAST "1.0");
ffd6ed
       if (wrdoc == NULL) {
ffd6ed
-        fprintf (stderr, _("%s: xmlNewDoc failed\n"), program_name);
ffd6ed
+        fprintf (stderr, _("%s: xmlNewDoc failed\n"), guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       wrnode = xmlCopyNode (nodes->nodeTab[i], 1);
ffd6ed
       if (wrnode == NULL) {
ffd6ed
-        fprintf (stderr, _("%s: xmlCopyNode failed\n"), program_name);
ffd6ed
+        fprintf (stderr, _("%s: xmlCopyNode failed\n"), guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
 
ffd6ed
       xmlDocSetRootElement (wrdoc, wrnode);
ffd6ed
 
ffd6ed
       if (xmlSaveDoc (saveCtx, wrdoc) == -1) {
ffd6ed
-        fprintf (stderr, _("%s: xmlSaveDoc failed\n"), program_name);
ffd6ed
+        fprintf (stderr, _("%s: xmlSaveDoc failed\n"), guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
     }
ffd6ed
diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
ffd6ed
index 406aa1d..22658fb 100644
ffd6ed
--- a/make-fs/make-fs.c
ffd6ed
+++ b/make-fs/make-fs.c
ffd6ed
@@ -71,7 +71,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: make a filesystem from a tar archive or files\n"
ffd6ed
@@ -92,8 +92,8 @@ usage (int status)
ffd6ed
              "  -V|--version           Display version and exit\n"
ffd6ed
              "  -x                     Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -140,7 +140,7 @@ main (int argc, char *argv[])
ffd6ed
           partition = optarg;
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
   if (optind + 2 != argc) {
ffd6ed
     fprintf (stderr, _("%s: missing input and output arguments on the command line\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     usage (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -197,7 +197,7 @@ check_ntfs_available (void)
ffd6ed
   if (STREQ (type, "ntfs") &&
ffd6ed
       guestfs_feature_available (g, (char **) ntfs_features) == 0) {
ffd6ed
     fprintf (stderr, _("%s: NTFS support was disabled when libguestfs was compiled\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -246,7 +246,7 @@ exec_command (char **argv, const char *file)
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
     if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) {
ffd6ed
-      fprintf (stderr, _("%s: %s command failed\n"), program_name, argv[0]);
ffd6ed
+      fprintf (stderr, _("%s: %s command failed\n"), guestfs___program_name, argv[0]);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
     return 0;
ffd6ed
@@ -303,7 +303,7 @@ exec_command_count_output (char **argv, uint64_t *bytes_rtn)
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
     if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) {
ffd6ed
-      fprintf (stderr, _("%s: %s command failed\n"), program_name, argv[0]);
ffd6ed
+      fprintf (stderr, _("%s: %s command failed\n"), guestfs___program_name, argv[0]);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
     return 0;
ffd6ed
@@ -428,7 +428,7 @@ estimate_input (const char *input, uint64_t *estimate_rtn, char **ifmt_rtn)
ffd6ed
 
ffd6ed
     if (sscanf (line, "%" SCNu64, estimate_rtn) != 1) {
ffd6ed
       fprintf (stderr, _("%s: cannot parse the output of 'du' command: %s\n"),
ffd6ed
-               program_name, line);
ffd6ed
+               guestfs___program_name, line);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -463,7 +463,7 @@ estimate_input (const char *input, uint64_t *estimate_rtn, char **ifmt_rtn)
ffd6ed
 
ffd6ed
     if (strstr (line, "tar archive") == NULL) {
ffd6ed
       fprintf (stderr, _("%s: %s: input is not a directory, tar archive or compressed tar archive\n"),
ffd6ed
-               program_name, input);
ffd6ed
+               guestfs___program_name, input);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -494,7 +494,7 @@ estimate_input (const char *input, uint64_t *estimate_rtn, char **ifmt_rtn)
ffd6ed
       }
ffd6ed
       else {
ffd6ed
         fprintf (stderr, _("%s: %s: unknown compressed input format (%s)\n"),
ffd6ed
-                 program_name, input, line);
ffd6ed
+                 guestfs___program_name, input, line);
ffd6ed
         return -1;
ffd6ed
       }
ffd6ed
 
ffd6ed
@@ -617,7 +617,7 @@ parse_size (const char *str, uint64_t estimate, uint64_t *size_rtn)
ffd6ed
   if (xerr != LONGINT_OK) {
ffd6ed
     fprintf (stderr,
ffd6ed
              _("%s: %s: invalid size parameter '%s' (%s returned %d)\n"),
ffd6ed
-             program_name, "parse_size", str, "xstrtoull", xerr);
ffd6ed
+             guestfs___program_name, "parse_size", str, "xstrtoull", xerr);
ffd6ed
     return -1;
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -759,7 +759,7 @@ do_make_fs (const char *input, const char *output_str)
ffd6ed
     if (r == -1) {
ffd6ed
       /* Provide more guidance in the error message (RHBZ#823883). */
ffd6ed
       fprintf (stderr, "%s: 'mkfs' (create filesystem) operation failed.\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       if (STREQ (type, "fat"))
ffd6ed
         fprintf (stderr, "Instead of 'fat', try 'vfat' (long filenames) or 'msdos' (short filenames).\n");
ffd6ed
       else
ffd6ed
@@ -816,7 +816,7 @@ do_make_fs (const char *input, const char *output_str)
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
     if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) {
ffd6ed
-      fprintf (stderr, _("%s: subprocess failed\n"), program_name);
ffd6ed
+      fprintf (stderr, _("%s: subprocess failed\n"), guestfs___program_name);
ffd6ed
       return -1;
ffd6ed
     }
ffd6ed
   }
ffd6ed
diff --git a/p2v/conversion.c b/p2v/conversion.c
ffd6ed
index 14e7b3b..e281e45 100644
ffd6ed
--- a/p2v/conversion.c
ffd6ed
+++ b/p2v/conversion.c
ffd6ed
@@ -171,7 +171,7 @@ start_conversion (struct config *config,
ffd6ed
 #if DEBUG_STDERR
ffd6ed
     fprintf (stderr,
ffd6ed
              "%s: data connection for %s: SSH remote port %d, local port %d\n",
ffd6ed
-             program_name, device,
ffd6ed
+             guestfs_int_program_name, device,
ffd6ed
              data_conns[i].nbd_remote_port, data_conns[i].nbd_local_port);
ffd6ed
 #endif
ffd6ed
   }
ffd6ed
@@ -203,7 +203,7 @@ start_conversion (struct config *config,
ffd6ed
     goto out;
ffd6ed
 
ffd6ed
 #if DEBUG_STDERR
ffd6ed
-  fprintf (stderr, "%s: libvirt XML:\n%s", program_name, libvirt_xml);
ffd6ed
+  fprintf (stderr, "%s: libvirt XML:\n%s", guestfs___program_name, libvirt_xml);
ffd6ed
 #endif
ffd6ed
 
ffd6ed
   /* Open the control connection and start conversion */
ffd6ed
diff --git a/p2v/gui.c b/p2v/gui.c
ffd6ed
index 194f9fb..4d9363e 100644
ffd6ed
--- a/p2v/gui.c
ffd6ed
+++ b/p2v/gui.c
ffd6ed
@@ -109,7 +109,7 @@ create_connection_dialog (struct config *config)
ffd6ed
   char port_str[64];
ffd6ed
 
ffd6ed
   conn_dlg = gtk_dialog_new ();
ffd6ed
-  gtk_window_set_title (GTK_WINDOW (conn_dlg), program_name);
ffd6ed
+  gtk_window_set_title (GTK_WINDOW (conn_dlg), guestfs___program_name);
ffd6ed
   gtk_window_set_resizable (GTK_WINDOW (conn_dlg), FALSE);
ffd6ed
 
ffd6ed
   /* The main dialog area. */
ffd6ed
@@ -343,7 +343,7 @@ static void
ffd6ed
 about_button_clicked (GtkWidget *w, gpointer data)
ffd6ed
 {
ffd6ed
   gtk_show_about_dialog (GTK_WINDOW (conn_dlg),
ffd6ed
-                         "program-name", program_name,
ffd6ed
+                         "program-name", guestfs___program_name,
ffd6ed
                          "version", PACKAGE_VERSION,
ffd6ed
                          "copyright", "\u00A9 2009-2014 Red Hat Inc.",
ffd6ed
                          "comments", "Convert a physical machine to use KVM",
ffd6ed
@@ -414,7 +414,7 @@ create_conversion_dialog (struct config *config)
ffd6ed
   char memory_str[64];
ffd6ed
 
ffd6ed
   conv_dlg = gtk_dialog_new ();
ffd6ed
-  gtk_window_set_title (GTK_WINDOW (conv_dlg), program_name);
ffd6ed
+  gtk_window_set_title (GTK_WINDOW (conv_dlg), guestfs___program_name);
ffd6ed
   gtk_window_set_resizable (GTK_WINDOW (conv_dlg), FALSE);
ffd6ed
   /* XXX It would be nice not to have to set this explicitly, but
ffd6ed
    * if we don't then Gtk chooses a very small window.
ffd6ed
@@ -1065,7 +1065,7 @@ static void
ffd6ed
 create_running_dialog (void)
ffd6ed
 {
ffd6ed
   run_dlg = gtk_dialog_new ();
ffd6ed
-  gtk_window_set_title (GTK_WINDOW (run_dlg), program_name);
ffd6ed
+  gtk_window_set_title (GTK_WINDOW (run_dlg), guestfs___program_name);
ffd6ed
   gtk_window_set_resizable (GTK_WINDOW (run_dlg), FALSE);
ffd6ed
 
ffd6ed
   /* The main dialog area. */
ffd6ed
@@ -1360,7 +1360,7 @@ notify_ui_callback (int type, const char *data)
ffd6ed
   default:
ffd6ed
     fprintf (stderr,
ffd6ed
              "%s: unknown message during conversion: type=%d data=%s\n",
ffd6ed
-             program_name, type, data);
ffd6ed
+             guestfs___program_name, type, data);
ffd6ed
   }
ffd6ed
 
ffd6ed
   gdk_threads_leave ();
ffd6ed
diff --git a/p2v/kernel.c b/p2v/kernel.c
ffd6ed
index e29355d..8333cf3 100644
ffd6ed
--- a/p2v/kernel.c
ffd6ed
+++ b/p2v/kernel.c
ffd6ed
@@ -52,7 +52,7 @@ kernel_configuration (struct config *config, const char *cmdline)
ffd6ed
     r += 5+4;
ffd6ed
     if (sscanf (r, "%d", &config->port) != 1) {
ffd6ed
       fprintf (stderr, "%s: cannot parse p2v.port from kernel command line",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -84,7 +84,7 @@ kernel_configuration (struct config *config, const char *cmdline)
ffd6ed
     const char *err = get_ssh_error ();
ffd6ed
 
ffd6ed
     fprintf (stderr, "%s: error opening control connection to %s:%d: %s\n",
ffd6ed
-             program_name, config->server, config->port, err);
ffd6ed
+             guestfs___program_name, config->server, config->port, err);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -101,7 +101,7 @@ kernel_configuration (struct config *config, const char *cmdline)
ffd6ed
     r += 5+5;
ffd6ed
     if (sscanf (r, "%d", &config->vcpus) != 1) {
ffd6ed
       fprintf (stderr, "%s: cannot parse p2v.vcpus from kernel command line\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -113,7 +113,7 @@ kernel_configuration (struct config *config, const char *cmdline)
ffd6ed
     r += 5+6;
ffd6ed
     if (sscanf (r, "%" SCNu64 "%c", &config->memory, mem_code) != 1) {
ffd6ed
       fprintf (stderr, "%s: cannot parse p2v.memory from kernel command line\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
     config->memory *= 1024;
ffd6ed
@@ -123,7 +123,7 @@ kernel_configuration (struct config *config, const char *cmdline)
ffd6ed
       config->memory *= 1024;
ffd6ed
     if (mem_code[0] != 'M' && mem_code[0] != 'G') {
ffd6ed
       fprintf (stderr, "%s: p2v.memory on kernel command line must be followed by 'G' or 'M'\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -217,7 +217,7 @@ kernel_configuration (struct config *config, const char *cmdline)
ffd6ed
     const char *err = get_conversion_error ();
ffd6ed
 
ffd6ed
     fprintf (stderr, "%s: error during conversion: %s\n",
ffd6ed
-             program_name, err);
ffd6ed
+             guestfs___program_name, err);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 }
ffd6ed
@@ -227,7 +227,7 @@ notify_ui_callback (int type, const char *data)
ffd6ed
 {
ffd6ed
   switch (type) {
ffd6ed
   case NOTIFY_LOG_DIR:
ffd6ed
-    printf ("%s: remote log directory location: %s\n", program_name, data);
ffd6ed
+    printf ("%s: remote log directory location: %s\n", guestfs___program_name, data);
ffd6ed
     break;
ffd6ed
 
ffd6ed
   case NOTIFY_REMOTE_MESSAGE:
ffd6ed
@@ -235,11 +235,11 @@ notify_ui_callback (int type, const char *data)
ffd6ed
     break;
ffd6ed
 
ffd6ed
   case NOTIFY_STATUS:
ffd6ed
-    printf ("%s: %s\n", program_name, data);
ffd6ed
+    printf ("%s: %s\n", guestfs___program_name, data);
ffd6ed
     break;
ffd6ed
 
ffd6ed
   default:
ffd6ed
     printf ("%s: unknown message during conversion: type=%d data=%s\n",
ffd6ed
-            program_name, type, data);
ffd6ed
+            guestfs___program_name, type, data);
ffd6ed
   }
ffd6ed
 }
ffd6ed
diff --git a/p2v/main.c b/p2v/main.c
ffd6ed
index a93ca1c..4e11c0a 100644
ffd6ed
--- a/p2v/main.c
ffd6ed
+++ b/p2v/main.c
ffd6ed
@@ -63,7 +63,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: Convert a physical machine to use KVM\n"
ffd6ed
@@ -76,7 +76,7 @@ usage (int status)
ffd6ed
              "  -v|--verbose           Verbose messages\n"
ffd6ed
              "  -V|--version           Display version and exit\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -124,7 +124,7 @@ main (int argc, char *argv[])
ffd6ed
       }
ffd6ed
       else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -134,7 +134,7 @@ main (int argc, char *argv[])
ffd6ed
       break;
ffd6ed
 
ffd6ed
     case 'V':
ffd6ed
-      printf ("%s %s\n", program_name, PACKAGE_VERSION);
ffd6ed
+      printf ("%s %s\n", guestfs___program_name, PACKAGE_VERSION);
ffd6ed
       exit (EXIT_SUCCESS);
ffd6ed
 
ffd6ed
     case HELP_OPTION:
ffd6ed
@@ -147,7 +147,7 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
   if (optind != argc) {
ffd6ed
     fprintf (stderr, _("%s: unused arguments on the command line\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     usage (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -429,7 +429,7 @@ find_all_disks (void)
ffd6ed
 
ffd6ed
   if (all_disks == NULL) {
ffd6ed
     fprintf (stderr, "%s: error: no non-removable disks were discovered on this machine.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     fprintf (stderr, "virt-p2v looked in /sys/block.\n");
ffd6ed
     fprintf (stderr, "This is a fatal error and virt-p2v cannot continue.\n");
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
diff --git a/p2v/ssh.c b/p2v/ssh.c
ffd6ed
index d593451..3c1d2f7 100644
ffd6ed
--- a/p2v/ssh.c
ffd6ed
+++ b/p2v/ssh.c
ffd6ed
@@ -372,7 +372,7 @@ test_connection (struct config *config)
ffd6ed
       sscanf (release_str, "%d", &v2v_release);
ffd6ed
 #if DEBUG_STDERR
ffd6ed
       fprintf (stderr, "%s: remote virt-v2v version: %d.%d.%d\n",
ffd6ed
-               program_name, v2v_major, v2v_minor, v2v_release);
ffd6ed
+               guestfs___program_name, v2v_major, v2v_minor, v2v_release);
ffd6ed
 #endif
ffd6ed
       /* This is an internal error.  Need to check this here so we
ffd6ed
        * don't confuse it with the no-version case below.
ffd6ed
@@ -570,7 +570,7 @@ add_option (const char *type, char ***drivers, const char *name, size_t len)
ffd6ed
 
ffd6ed
 #if DEBUG_STDERR
ffd6ed
   fprintf (stderr, "%s: remote virt-v2v supports %s driver %s\n",
ffd6ed
-           program_name, type, (*drivers)[n-1]);
ffd6ed
+           guestfs___program_name, type, (*drivers)[n-1]);
ffd6ed
 #endif
ffd6ed
 }
ffd6ed
 
ffd6ed
diff --git a/rescue/rescue.c b/rescue/rescue.c
ffd6ed
index 00187a4..541e42b 100644
ffd6ed
--- a/rescue/rescue.c
ffd6ed
+++ b/rescue/rescue.c
ffd6ed
@@ -54,7 +54,7 @@ usage (int status)
ffd6ed
 {
ffd6ed
   if (status != EXIT_SUCCESS)
ffd6ed
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
   else {
ffd6ed
     fprintf (stdout,
ffd6ed
            _("%s: Run a rescue shell on a virtual machine\n"
ffd6ed
@@ -81,8 +81,8 @@ usage (int status)
ffd6ed
              "  -w|--rw              Mount read-write\n"
ffd6ed
              "  -x                   Trace libguestfs API calls\n"
ffd6ed
              "For more information, see the manpage %s(1).\n"),
ffd6ed
-             program_name, program_name, program_name,
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name, guestfs___program_name, guestfs___program_name,
ffd6ed
+             guestfs___program_name);
ffd6ed
   }
ffd6ed
   exit (status);
ffd6ed
 }
ffd6ed
@@ -157,12 +157,12 @@ main (int argc, char *argv[])
ffd6ed
       } else if (STREQ (long_options[option_index].name, "smp")) {
ffd6ed
         if (sscanf (optarg, "%d", &smp) != 1) {
ffd6ed
           fprintf (stderr, _("%s: could not parse --smp parameter '%s'\n"),
ffd6ed
-                   program_name, optarg);
ffd6ed
+                   guestfs___program_name, optarg);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
         if (smp < 1) {
ffd6ed
           fprintf (stderr, _("%s: --smp parameter '%s' should be >= 1\n"),
ffd6ed
-                   program_name, optarg);
ffd6ed
+                   guestfs___program_name, optarg);
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
         }
ffd6ed
       } else if (STREQ (long_options[option_index].name, "suggest")) {
ffd6ed
@@ -175,20 +175,20 @@ main (int argc, char *argv[])
ffd6ed
           if (sscanf (optarg, "%d", &n) != 1) {
ffd6ed
             fprintf (stderr,
ffd6ed
                      _("%s: could not parse --scratch parameter '%s'\n"),
ffd6ed
-                     program_name, optarg);
ffd6ed
+                     guestfs___program_name, optarg);
ffd6ed
             exit (EXIT_FAILURE);
ffd6ed
           }
ffd6ed
           if (n < 1) {
ffd6ed
             fprintf (stderr,
ffd6ed
                      _("%s: --scratch parameter '%s' should be >= 1\n"),
ffd6ed
-                     program_name, optarg);
ffd6ed
+                     guestfs___program_name, optarg);
ffd6ed
             exit (EXIT_FAILURE);
ffd6ed
           }
ffd6ed
           add_scratch_disks (n, &drvs);
ffd6ed
         }
ffd6ed
       } else {
ffd6ed
         fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -208,7 +208,7 @@ main (int argc, char *argv[])
ffd6ed
     case 'm':
ffd6ed
       if (sscanf (optarg, "%d", &memsize) != 1) {
ffd6ed
         fprintf (stderr, _("%s: could not parse memory size '%s'\n"),
ffd6ed
-                 program_name, optarg);
ffd6ed
+                 guestfs___program_name, optarg);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -316,7 +316,7 @@ main (int argc, char *argv[])
ffd6ed
           STRPREFIX (backend, "libvirt:")) {
ffd6ed
         fprintf (stderr, _("%s: warning: virt-rescue doesn't work with the libvirt backend\n"
ffd6ed
                            "at the moment.  As a workaround, forcing backend = 'direct'.\n"),
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         if (guestfs_set_backend (g, "direct") == -1)
ffd6ed
           exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h
ffd6ed
index ba3ddde..9316421 100644
ffd6ed
--- a/src/guestfs-internal-frontend.h
ffd6ed
+++ b/src/guestfs-internal-frontend.h
ffd6ed
@@ -162,12 +162,12 @@ extern GUESTFS_DLL_PUBLIC int guestfs___add_libvirt_dom (guestfs_h *g, virDomain
ffd6ed
 #endif /* HAVE_LIBVIRT */
ffd6ed
 
ffd6ed
 /* Current program name.  Note <errno.h> must be included in all files
ffd6ed
- * that want to use 'program_name'.
ffd6ed
+ * that want to use 'guestfs___program_name'.
ffd6ed
  */
ffd6ed
 #if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1
ffd6ed
-#  define program_name program_invocation_short_name
ffd6ed
+#  define guestfs___program_name program_invocation_short_name
ffd6ed
 #else
ffd6ed
-#  define program_name "libguestfs"
ffd6ed
+#  define guestfs___program_name "libguestfs"
ffd6ed
 #endif
ffd6ed
 
ffd6ed
 /* Close all file descriptors matching the condition. */
ffd6ed
diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
ffd6ed
index 7ce7d94..c127314 100644
ffd6ed
--- a/tests/charsets/test-charset-fidelity.c
ffd6ed
+++ b/tests/charsets/test-charset-fidelity.c
ffd6ed
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
ffd6ed
   str = getenv (ourenvvar);
ffd6ed
   if (str && guestfs___is_true (str) > 0) {
ffd6ed
     printf ("%s: test skipped because environment variable is set.\n",
ffd6ed
-            program_name);
ffd6ed
+            guestfs___program_name);
ffd6ed
     exit (77);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/tests/mount-local/test-parallel-mount-local.c b/tests/mount-local/test-parallel-mount-local.c
ffd6ed
index 88ca2d3..00c95dc 100644
ffd6ed
--- a/tests/mount-local/test-parallel-mount-local.c
ffd6ed
+++ b/tests/mount-local/test-parallel-mount-local.c
ffd6ed
@@ -96,13 +96,13 @@ main (int argc, char *argv[])
ffd6ed
   skip = getenv ("SKIP_TEST_PARALLEL_MOUNT_LOCAL");
ffd6ed
   if (skip && guestfs___is_true (skip) > 0) {
ffd6ed
     fprintf (stderr, "%s: test skipped because environment variable set.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (77);
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (access ("/dev/fuse", W_OK) == -1) {
ffd6ed
     fprintf (stderr, "%s: test skipped because /dev/fuse is not writable.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (77);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/tests/parallel/test-parallel.c b/tests/parallel/test-parallel.c
ffd6ed
index e412143..0ed3a8e 100644
ffd6ed
--- a/tests/parallel/test-parallel.c
ffd6ed
+++ b/tests/parallel/test-parallel.c
ffd6ed
@@ -78,7 +78,7 @@ main (int argc, char *argv[])
ffd6ed
   skip = getenv ("SKIP_TEST_PARALLEL");
ffd6ed
   if (skip && guestfs___is_true (skip) > 0) {
ffd6ed
     fprintf (stderr, "%s: test skipped because environment variable set.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (77);
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/tests/qemu/qemu-boot.c b/tests/qemu/qemu-boot.c
ffd6ed
index c1205d3..ce52f9a 100644
ffd6ed
--- a/tests/qemu/qemu-boot.c
ffd6ed
+++ b/tests/qemu/qemu-boot.c
ffd6ed
@@ -102,7 +102,7 @@ main (int argc, char *argv[])
ffd6ed
     case 0:
ffd6ed
       /* Options which are long only. */
ffd6ed
       fprintf (stderr, "%s: unknown long option: %s (%d)\n",
ffd6ed
-               program_name, long_options[option_index].name, option_index);
ffd6ed
+               guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
 
ffd6ed
     case 'i':
ffd6ed
@@ -112,14 +112,14 @@ main (int argc, char *argv[])
ffd6ed
     case 'n':
ffd6ed
       if (sscanf (optarg, "%zu", &n) != 1 || n == 0) {
ffd6ed
         fprintf (stderr, "%s: -n option not numeric and greater than 0\n",
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
 
ffd6ed
     case 'P':
ffd6ed
       if (sscanf (optarg, "%zu", &P) != 1) {
ffd6ed
-        fprintf (stderr, "%s: -P option not numeric\n", program_name);
ffd6ed
+        fprintf (stderr, "%s: -P option not numeric\n", guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -143,13 +143,13 @@ main (int argc, char *argv[])
ffd6ed
   if (n == 0) {
ffd6ed
     fprintf (stderr,
ffd6ed
              "%s: must specify number of processes to run (-n option)\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
   if (optind != argc) {
ffd6ed
     fprintf (stderr, "%s: extra arguments found on the command line\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -168,7 +168,7 @@ main (int argc, char *argv[])
ffd6ed
     err = pthread_create (&threads[i], NULL, start_thread, &thread_data[i]);
ffd6ed
     if (err != 0) {
ffd6ed
       fprintf (stderr, "%s: pthread_create[%zu]: %s\n",
ffd6ed
-               program_name, i, strerror (err));
ffd6ed
+               guestfs___program_name, i, strerror (err));
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
   }
ffd6ed
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
ffd6ed
     err = pthread_join (threads[i], &status);
ffd6ed
     if (err != 0) {
ffd6ed
       fprintf (stderr, "%s: pthread_join[%zu]: %s\n",
ffd6ed
-               program_name, i, strerror (err));
ffd6ed
+               guestfs___program_name, i, strerror (err));
ffd6ed
       errors++;
ffd6ed
     }
ffd6ed
     if (*(int *)status == -1)
ffd6ed
@@ -205,7 +205,7 @@ start_thread (void *thread_data_vp)
ffd6ed
     err = pthread_mutex_lock (&mutex);
ffd6ed
     if (err != 0) {
ffd6ed
       fprintf (stderr, "%s: pthread_mutex_lock: %s",
ffd6ed
-               program_name, strerror (err));
ffd6ed
+               guestfs___program_name, strerror (err));
ffd6ed
       goto error;
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -222,7 +222,7 @@ start_thread (void *thread_data_vp)
ffd6ed
     err = pthread_mutex_unlock (&mutex);
ffd6ed
     if (err != 0) {
ffd6ed
       fprintf (stderr, "%s: pthread_mutex_unlock: %s",
ffd6ed
-               program_name, strerror (err));
ffd6ed
+               guestfs___program_name, strerror (err));
ffd6ed
       goto error;
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -263,7 +263,7 @@ start_thread (void *thread_data_vp)
ffd6ed
 
ffd6ed
   if (errors > 0) {
ffd6ed
     fprintf (stderr, "%s: thread %d: %u errors were ignored\n",
ffd6ed
-             program_name, thread_data->thread_num, errors);
ffd6ed
+             guestfs___program_name, thread_data->thread_num, errors);
ffd6ed
     goto error;
ffd6ed
   }
ffd6ed
 
ffd6ed
diff --git a/tests/qemu/qemu-speed-test.c b/tests/qemu/qemu-speed-test.c
ffd6ed
index 1d5ef86..b054bcf 100644
ffd6ed
--- a/tests/qemu/qemu-speed-test.c
ffd6ed
+++ b/tests/qemu/qemu-speed-test.c
ffd6ed
@@ -132,7 +132,7 @@ main (int argc, char *argv[])
ffd6ed
       }
ffd6ed
       else {
ffd6ed
         fprintf (stderr, "%s: unknown long option: %s (%d)\n",
ffd6ed
-                 program_name, long_options[option_index].name, option_index);
ffd6ed
+                 guestfs___program_name, long_options[option_index].name, option_index);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -141,7 +141,7 @@ main (int argc, char *argv[])
ffd6ed
       if (sscanf (optarg, "%d", &max_time_override) != 1 ||
ffd6ed
           max_time_override < 0) {
ffd6ed
         fprintf (stderr, "%s: -t: argument is not a positive integer\n",
ffd6ed
-                 program_name);
ffd6ed
+                 guestfs___program_name);
ffd6ed
         exit (EXIT_FAILURE);
ffd6ed
       }
ffd6ed
       break;
ffd6ed
@@ -156,7 +156,7 @@ main (int argc, char *argv[])
ffd6ed
 
ffd6ed
   if (optind != argc) {
ffd6ed
     fprintf (stderr, "%s: extra arguments found on the command line\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -319,14 +319,14 @@ test_virtio_serial (void)
ffd6ed
     if (r == -1 && guestfs_last_errno (g) != EINTR) {
ffd6ed
       fprintf (stderr,
ffd6ed
                "%s: expecting upload command to return EINTR\n%s\n",
ffd6ed
-               program_name, guestfs_last_error (g));
ffd6ed
+               guestfs___program_name, guestfs_last_error (g));
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
     if (rate == -1) {
ffd6ed
     rate_error:
ffd6ed
       fprintf (stderr, "%s: internal error: progress callback was not called! (r=%d, errno=%d)\n",
ffd6ed
-               program_name,
ffd6ed
+               guestfs___program_name,
ffd6ed
                r, guestfs_last_errno (g));
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
@@ -355,7 +355,7 @@ test_virtio_serial (void)
ffd6ed
     if (r == -1 && guestfs_last_errno (g) != EINTR) {
ffd6ed
       fprintf (stderr,
ffd6ed
                "%s: expecting download command to return EINTR\n%s\n",
ffd6ed
-               program_name, guestfs_last_error (g));
ffd6ed
+               guestfs___program_name, guestfs_last_error (g));
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -427,7 +427,7 @@ test_block_device (void)
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   if (devices[0] == NULL) {
ffd6ed
     fprintf (stderr, "%s: expected guestfs_list_devices to return at least 1 device\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     exit (EXIT_FAILURE);
ffd6ed
   }
ffd6ed
 
ffd6ed
@@ -443,7 +443,7 @@ test_block_device (void)
ffd6ed
 
ffd6ed
     if (sscanf (r, "%" SCNi64, &bytes_written) != 1) {
ffd6ed
       fprintf (stderr, "%s: could not parse device_speed output\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
@@ -462,7 +462,7 @@ test_block_device (void)
ffd6ed
 
ffd6ed
     if (sscanf (r, "%" SCNi64, &bytes_read) != 1) {
ffd6ed
       fprintf (stderr, "%s: could not parse device_speed output\n",
ffd6ed
-               program_name);
ffd6ed
+               guestfs___program_name);
ffd6ed
       exit (EXIT_FAILURE);
ffd6ed
     }
ffd6ed
 
ffd6ed
diff --git a/tests/regressions/rhbz790721.c b/tests/regressions/rhbz790721.c
ffd6ed
index 370ca49..683490c 100644
ffd6ed
--- a/tests/regressions/rhbz790721.c
ffd6ed
+++ b/tests/regressions/rhbz790721.c
ffd6ed
@@ -72,7 +72,7 @@ main (int argc, char *argv[])
ffd6ed
   }
ffd6ed
   if (STRNEQ (backend, "direct")) {
ffd6ed
     fprintf (stderr, "%s: test skipped because backend isn't 'direct'.\n",
ffd6ed
-             program_name);
ffd6ed
+             guestfs___program_name);
ffd6ed
     free (backend);
ffd6ed
     guestfs_close (g);
ffd6ed
     exit (77);
ffd6ed
diff --git a/tests/regressions/rhbz914931.c b/tests/regressions/rhbz914931.c
ffd6ed
index 569e261..a677ca9 100644
ffd6ed
--- a/tests/regressions/rhbz914931.c
ffd6ed
+++ b/tests/regressions/rhbz914931.c
ffd6ed
@@ -43,7 +43,7 @@ main (int argc, char *argv[])
ffd6ed
   str = getenv ("SKIP_TEST_RHBZ914931");
ffd6ed
   if (str && guestfs___is_true (str) > 0) {
ffd6ed
     printf ("%s: test skipped because environment variable is set.\n",
ffd6ed
-            program_name);
ffd6ed
+            guestfs___program_name);
ffd6ed
     exit (77);
ffd6ed
   }
ffd6ed
 
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed