[PATCH 1/4] New internal function guestfs___print_timestamped_argv
This function generalises the existing print_cmdline used to output the qemu command line to output any given command line, and exports it to other modules. It also adds a timestamp to the old print_cmdline output for consistency with guestfs___print_timestamped_message. --- src/guestfs-internal.h | 1 + src/launch.c | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 24 deletions(-)
A side-effect of change 17e7cb9937a63ed8f9bb0fb6ac7302758be76846 was the the febootstrap-supermin-helper was no longer logged. This change adds it back using the new guestfs___print_timestamped_argv internal function. --- src/appliance.c | 55 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 29 insertions(+), 26 deletions(-)
Use febootstrap-supermin-helper's new -u and -g command line options to setuid, rather than doing it in libguestfs. This resolves an issue with the generation of the cached appliance checksum. The checksum was being generated by a call to febootstrap-supermin-helper through popen(). Unfortunately, a bash misfeature meant that euid would be reset to uid, and the checksum was generated for uid, not euid. When virt-v2v is writing to a RHEV target, uid == 0 and euid == 36, which resulted in a cached appliance being created for root with permissions for uid 36. --- src/appliance.c | 51 +++++++++++++++++++++------------------------------ 1 files changed, 21 insertions(+), 30 deletions(-)
Cached appliances are discovered by their predictable path. Previously we were creating a cached appliance directly in this predictable path. This had at least 2 undesirable effects: * Interrupting appliance creation would leave a corrupt appliance * 2 processes could simultaneously attempt to create the same appliance, causing corruption. This patch causes the cached appliance to be created in a temporary directory, and then renamed to the predictable path. As rename is an atomic operation, this makes the whole creation atomic. This patch also changes the predictable path to have a prefix of 'guestfs.'. This will make it simpler for system administrators to clean up old cached appliances. This patch resolves RHBZ#639405 --- po/POTFILES.in | 1 + regressions/test-launch-race.pl | 60 ++++++++++++++++++++++ src/appliance.c | 105 ++++++++++++++++++++++++++++++++++----- 3 files changed, 153 insertions(+), 13 deletions(-) create mode 100755 regressions/test-launch-race.pl
participants (1)
-
Matthew Booth