#include <stdio.h>
#include <stdlib.h>
+#include "c-ctype.h"
+
#include "guestfs.h"
#include "options.h"
}
static void display_mountpoints_on_failure (const char *mp_device);
+static void canonical_device_name (char *dev);
/* List is built in reverse order, so mount them in reverse order. */
void
program_name, mp_device);
for (i = 0; fses[i] != NULL; i += 2) {
+ canonical_device_name (fses[i]);
fprintf (stderr, "\t%s (%s)\n", fses[i], fses[i+1]);
free (fses[i]);
free (fses[i+1]);
free (fses);
}
+static void
+canonical_device_name (char *dev)
+{
+ if (STRPREFIX (dev, "/dev/") &&
+ (dev[5] == 'h' || dev[5] == 'v') &&
+ dev[6] == 'd' &&
+ c_isalpha (dev[7]) &&
+ (c_isdigit (dev[8]) || dev[8] == '\0'))
+ dev[5] = 's';
+}
+
void
free_drives (struct drv *drv)
{