From 116b1583a8e27e587e382fb53dbfce3d21ad9b45 Mon Sep 17 00:00:00 2001 From: "rjones@intel.home.annexia.org" Date: Fri, 9 May 2008 16:02:22 +0100 Subject: [PATCH] Initial, non-working FAT32 support. --- lib/diskimage_fat.ml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ lib/diskimage_fat.mli | 22 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 lib/diskimage_fat.ml create mode 100644 lib/diskimage_fat.mli diff --git a/lib/diskimage_fat.ml b/lib/diskimage_fat.ml new file mode 100644 index 0000000..1fbeac4 --- /dev/null +++ b/lib/diskimage_fat.ml @@ -0,0 +1,48 @@ +(* 'df' command for virtual domains. + (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + http://libvirt.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Support for FAT32. +*) + +open Unix +open Printf + +open Diskimage_impl + +(* Private data functions. *) +let attach_private_data, get_private_data = + private_data_functions (fun {fs_cb = {fs_cb_uq = u}} -> u) + +let id = "fat" + +let rec probe dev = + raise Not_found (* XXX *) + +and offset_is_free _ _ = false + +and callbacks = + let i = ref 0 in + fun () -> { + fs_cb_uq = (incr i; !i); + fs_cb_name = id; + fs_cb_printable_name = "DOS/Windows"; + fs_cb_offset_is_free = offset_is_free; + } + +(* Register the plugin. *) +let () = register_plugin ~filesystem:probe id diff --git a/lib/diskimage_fat.mli b/lib/diskimage_fat.mli new file mode 100644 index 0000000..52995b3 --- /dev/null +++ b/lib/diskimage_fat.mli @@ -0,0 +1,22 @@ +(* 'df' command for virtual domains. + (C) Copyright 2007-2008 Richard W.M. Jones, Red Hat Inc. + http://libvirt.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *) + +(**/**) + +val id : string -- 1.8.3.1