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

Re: [Libguestfs] [PATCH 1/2] inspection: Handle MD devices in fstab

On Fri, Nov 25, 2011 at 05:32:42PM +0000, Matthew Booth wrote:
>  static int
>  check_fstab (guestfs_h *g, struct inspect_fs *fs)
>  {
> +  /* Generate a map of MD device paths listed in /etc/mdadm.conf to MD device
> +   * paths in the guestfs appliance */
> +  Hash_table *md_map;
> +  if (map_md_devices (g, &md_map) == -1) return -1;

I'm pretty sure this is still wrong ...

If /etc/mdadm.conf doesn't exist(?) or isn't parsable, map_md_devices
returns -1.  It doesn't set error(), which could be bad, since it
returns -1 from check_fstab which requires you to set error().

What it _should_ do is not to call error(), and allow md_map to be
NULL, not returning from check_fstab, but continuing.  Then the other
functions have to be changed to deal with md_map being NULL.

Try creating some guests with /etc/mdadm.conf being
bogus/empty/missing and make sure that inspection can properly handle
them without an error.


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]