diskimage_ext2.cmi: diskimage_utils.cmi
diskimage_linux_swap.cmi: diskimage_utils.cmi
+diskimage_linux_swsuspend.cmi: diskimage_utils.cmi
diskimage_lvm2_metadata.cmi: int63.cmi
diskimage_lvm2.cmi: diskimage_utils.cmi
diskimage_lvm2_parser.cmi: int63.cmi diskimage_lvm2_metadata.cmi
/usr/lib64/ocaml/bitmatch/bitmatch.cmi diskimage_linux_swap.cmi
diskimage_linux_swap.cmx: int63.cmx diskimage_utils.cmx \
/usr/lib64/ocaml/bitmatch/bitmatch.cmi diskimage_linux_swap.cmi
+diskimage_linux_swsuspend.cmo: int63.cmi diskimage_utils.cmi \
+ /usr/lib64/ocaml/bitmatch/bitmatch.cmi diskimage_linux_swsuspend.cmi
+diskimage_linux_swsuspend.cmx: int63.cmx diskimage_utils.cmx \
+ /usr/lib64/ocaml/bitmatch/bitmatch.cmi diskimage_linux_swsuspend.cmi
diskimage_lvm2_metadata.cmo: int63.cmi diskimage_lvm2_metadata.cmi
diskimage_lvm2_metadata.cmx: int63.cmx diskimage_lvm2_metadata.cmi
diskimage_lvm2.cmo: int63.cmi diskimage_utils.cmi diskimage_lvm2_metadata.cmi \
diskimage_mbr.cmx: int63.cmx diskimage_utils.cmx \
/usr/lib64/ocaml/bitmatch/bitmatch.cmi diskimage_mbr.cmi
diskimage.cmo: int63.cmi diskimage_utils.cmi diskimage_mbr.cmi \
- diskimage_lvm2.cmi diskimage_linux_swap.cmi diskimage_ext2.cmi \
- diskimage.cmi
+ diskimage_lvm2.cmi diskimage_linux_swsuspend.cmi diskimage_linux_swap.cmi \
+ diskimage_ext2.cmi diskimage.cmi
diskimage.cmx: int63.cmx diskimage_utils.cmx diskimage_mbr.cmx \
- diskimage_lvm2.cmx diskimage_linux_swap.cmx diskimage_ext2.cmx \
- diskimage.cmi
+ diskimage_lvm2.cmx diskimage_linux_swsuspend.cmx diskimage_linux_swap.cmx \
+ diskimage_ext2.cmx diskimage.cmi
diskimage_utils.cmo: int63.cmi diskimage_utils.cmi
diskimage_utils.cmx: int63.cmx diskimage_utils.cmi
int63.cmo: int63.cmi
# Plugin objects.
OBJS += diskimage_ext2.cmo \
diskimage_linux_swap.cmo \
+ diskimage_linux_swsuspend.cmo \
diskimage_lvm2_metadata.cmo \
diskimage_lvm2_parser.cmo \
diskimage_lvm2_lexer.cmo \
("Linux ext2/3", Diskimage_ext2.probe);
Diskimage_linux_swap.plugin_id,
("Linux swap", Diskimage_linux_swap.probe);
+ Diskimage_linux_swsuspend.plugin_id,
+ ("Linux s/w suspend", Diskimage_linux_swsuspend.probe);
]
let lvm_types = [
| {
(* Actually this isn't just padding. *)
padding : 8*0x1000 - 10*8 : bitstring;
- "SWAPSPACE2" : 80 : string
+ ("SWAP-SPACE"|"SWAPSPACE2") : 80 : string
} ->
let fs_dev = new blocksize_overlay blocksize dev in
--- /dev/null
+(* '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 Linux software suspend partitions.
+*)
+
+open Diskimage_utils
+
+open Int63.Operators
+
+let plugin_id = "linux_swsuspend"
+let blocksize = ~^4096 (* XXX *)
+
+let probe dev =
+ (* Load the "superblock" (ie. first 0x1000 bytes). *)
+ let bits = dev#read_bitstring ~^0 ~^0x1000 in
+
+ bitmatch bits with
+ | {
+ (* Actually this isn't just padding. *)
+ padding : 8*0x1000 - 10*8 : bitstring;
+ ("S1SUSPEND"|"S2SUSPEND") : 80 : string
+ } ->
+
+ let fs_dev = new blocksize_overlay blocksize dev in
+ {
+ fs_plugin_id = plugin_id;
+ fs_dev = fs_dev;
+
+ fs_blocksize = blocksize;
+ fs_blocks_total = fs_dev#size /^ blocksize;
+
+ (* The remaining fields are ignored when fs_is_swap is true. *)
+ fs_is_swap = true;
+ fs_blocks_reserved = ~^0;
+ fs_blocks_avail = ~^0;
+ fs_blocks_used = ~^0;
+ fs_inodes_total = ~^0;
+ fs_inodes_reserved = ~^0;
+ fs_inodes_avail = ~^0;
+ fs_inodes_used = ~^0;
+ }
+
+ | { _ } ->
+ raise Not_found (* Not Linux software suspend. *)
--- /dev/null
+(* '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 plugin_id : string
+val probe : Diskimage_utils.device -> Diskimage_utils.filesystem