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

Re: [Libguestfs] [PATCH V2] NEW API:xfs:xfs_repair



On 08/28/2012 09:06 PM, Richard W.M. Jones wrote:
>> > +  if (!(optargs_bitmask & GUESTFS_XFS_REPAIR_IMGFILE_BITMASK))
>> > +    imgfile = 0;
> This xfs_repair -f option is annoying!  Also the way you've defined
> the "device" parameter (as type Device) means it won't work -- the
> caller would never be able to use a non-device as a parameter.
> 
> Instead, can we check for the input being file or device and add the
> option automatically?  It should be sufficient to change the code to
> something like:
> 
>   ... Dev_or_path "device" ...
> 
>   if (STRPREFIX (device, "/dev/"))
>     is_device = 1;
> 
>   if (!is_device) {
>     /* do the sysroot adjustment, and add -f parameter */
>   } else {
>     /* just add device parameter */
>   }
> 

Sorry, I can't understand here, since the original xfs_repair command
just receive "device" as its parameter, I wonder why do you suggest to use
"Dev_or_path" here. 

Thanks,
Wanlong Gao


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