[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH stable-1.24] Fix fstab block device resolution for FreeBSD



On Sun, Nov 03, 2013 at 11:16:23PM +0200, Nikos Skalkotos wrote:
> +    char type_c = (strcmp (type, "vtbd") == 0) ? 'v' : 's';
>      int disk_i = guestfs___parse_unsigned_int (g, disk);
>      int slice_i = guestfs___parse_unsigned_int (g, slice);
>      int part_i = part[0] - 'a' /* counting from 0 */;
> @@ -1481,7 +1501,7 @@ resolve_fstab_device (guestfs_h *g, const char *spec, Hash_table *md_map)
>      if (disk_i != -1 && disk_i <= 26 &&
>          slice_i > 0 && slice_i <= 1 /* > 4 .. see comment above */ &&
>          part_i >= 0 && part_i < 26) {
> -      device = safe_asprintf (g, "/dev/sd%c%d", disk_i + 'a', part_i + 5);
> +      device = safe_asprintf (g, "/dev/%cd%c%d", type_c, disk_i + 'a', part_i + 5);

I think this part is wrong: In libguestfs, the device should always be
called /dev/sdX.  I think it's better just to leave out these two
hunks.

The rest all seems sensible.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]