[Libguestfs] [PATCH] Fix bogus partition number passed to guestfs___check_for_filesystem_on

Richard W.M. Jones rjones at redhat.com
Fri Feb 8 11:34:30 UTC 2013


On Fri, Feb 08, 2013 at 10:22:28AM +0000, Matthew Booth wrote:
>  static int
> -check_filesystem (guestfs_h *g, const char *device,
> -                  int is_block, int is_partnum)
> +check_filesystem (guestfs_h *g, const char *device, int whole_device)
>  {
>    if (extend_fses (g) == -1)
>      return -1;
>  
> +  int partnum = -1;
> +  if (!whole_device) {
> +    partnum = guestfs_part_to_partnum (g, device);
> +    /* If this returns an error it just means it's not a partition */
> +  }

If we are going to ignore the error, then we need to push & pop the
error handler around this call.  If you don't want to ignore the
error, then you need to return -1.

Apart from that, the patch looks fine to me so ACK with that change.

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#)




More information about the Libguestfs mailing list