+ free (type);
+ free (disk);
+ free (part);
+ guestfs___free_string_list (devices);
+ }
+ else if (match2 (g, spec, re_cciss, &disk, &part)) {
+ /* disk: (cciss/c\d+d\d+)
+ * part: (\d+)? */
+ char **devices = guestfs_list_devices (g);
+ if (devices == NULL)
+ return NULL;
+
+ /* Check any hints we were passed for a non-heuristic mapping */
+ size_t i = 0;
+ struct drive *drive = g->drives;
+ while (drive) {
+ if (drive->name && STREQ(drive->name, disk)) {
+ if (part) {
+ device = safe_asprintf (g, "%s%s", devices[i], part);
+ } else {
+ device = safe_strdup (g, devices[i]);
+ }
+ break;
+ }
+
+ i++; drive = drive->next;
+ }
+
+ /* We don't try to guess mappings for cciss devices */
+