Re: [PATCH 3/3] build: storage: Macro 'MKFS' is undefined on some platforms.

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

 



On Fri, Sep 16, 2011 at 02:14:16PM +0200, Peter Krempa wrote:
> Mac OS X 10.6. Snow Leopard and probably other do not provide a mkfs
> command to create filesystems. Macro MKFS then remained undefined and
> did not provide any substitute, so that build failed on a missing
> argument.
> ---
>  src/storage/storage_backend_fs.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
> index 02c4c17..da98f87 100644
> --- a/src/storage/storage_backend_fs.c
> +++ b/src/storage/storage_backend_fs.c
> @@ -625,6 +625,8 @@ virStorageBackendFileSystemProbe(const char *device ATTRIBUTE_UNUSED,
> 
>  #endif /* #if HAVE_LIBBLKID */
> 
> +/* some platforms don't support mkfs */
> +#ifdef MKFS
>  static int
>  virStorageBackendExecuteMKFS(const char *device,
>                               const char *format)
> @@ -647,6 +649,19 @@ virStorageBackendExecuteMKFS(const char *device,
>      }
>      return ret;
>  }
> +#else /* #ifdef MKFS */
> +static int
> +virStorageBackendExecuteMKFS(const char *device ATTRIBUTE_UNUSED,
> +                             const char *format ATTRIBUTE_UNUSED)
> +{
> +    virStorageReportError(VIR_ERR_INTERNAL_ERROR,
> +                              _("mkfs is not supported on this platform: "
> +                                "Failed to make filesystem of "
> +                               "type '%s' on device '%s'"),
> +                             format, device);
> +    return -1;
> +}
> +#endif /* #ifdef MKFS */
> 
>  static int
>  virStorageBackendMakeFileSystem(virStoragePoolObjPtr pool,

  Okay, I think this is teh right way, ACK,

I'm gonna push your patch set except for 1/3,

   thanks a lot !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]