Please read L<guestfs(3)/INSPECTION> for more details.");
+ ("inspect_get_hostname", (RString "hostname", [Device "root"], []), -1, [],
+ [],
+ "get hostname of the operating system",
+ "\
+This function should only be called with a root device string
+as returned by C<guestfs_inspect_os>.
+
+This function returns the hostname of the operating system
+as found by inspection of the guest's configuration files.
+
+If the hostname could not be determined, then the
+string C<unknown> is returned.
+
+Please read L<guestfs(3)/INSPECTION> for more details.");
+
]
(* daemon_functions are any functions which cause some action
("list_partitions", (RStringList "partitions", [], []), 8, [],
[InitBasicFS, Always, TestOutputListOfDevices (
- [["list_partitions"]], ["/dev/sda1"]);
+ [["list_partitions"]], ["/dev/sda1"; "/dev/sdb1"]);
InitEmpty, Always, TestOutputListOfDevices (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "p"; "204800"; "409599"];
["part_add"; "/dev/sda"; "p"; "409600"; "-64"];
- ["list_partitions"]], ["/dev/sda1"; "/dev/sda2"; "/dev/sda3"])],
+ ["list_partitions"]], ["/dev/sda1"; "/dev/sda2"; "/dev/sda3"; "/dev/sdb1"])],
"list the partitions",
"\
List all the partitions detected on all block devices.
("get_e2uuid", (RString "uuid", [Device "device"], []), 83, [DeprecatedBy "vfs_uuid"],
(* Regression test for RHBZ#597112. *)
(let uuid = uuidgen () in
- [InitBasicFS, Always, TestOutput (
- [["mke2journal"; "1024"; "/dev/sdb"];
- ["set_e2uuid"; "/dev/sdb"; uuid];
- ["get_e2uuid"; "/dev/sdb"]], uuid)]),
+ [InitNone, Always, TestOutput (
+ [["mke2journal"; "1024"; "/dev/sdc"];
+ ["set_e2uuid"; "/dev/sdc"; uuid];
+ ["get_e2uuid"; "/dev/sdc"]], uuid)]),
"get the ext2/3/4 filesystem UUID",
"\
This returns the ext2/3/4 filesystem UUID of the filesystem on
("swapon_label", (RErr, [String "label"], []), 174, [],
[InitEmpty, Always, TestRun (
- [["part_disk"; "/dev/sdb"; "mbr"];
- ["mkswap_L"; "swapit"; "/dev/sdb1"];
+ [["part_disk"; "/dev/sda"; "mbr"];
+ ["mkswap_L"; "swapit"; "/dev/sda1"];
["swapon_label"; "swapit"];
["swapoff_label"; "swapit"];
- ["zero"; "/dev/sdb"];
- ["blockdev_rereadpt"; "/dev/sdb"]])],
+ ["zero"; "/dev/sda"];
+ ["blockdev_rereadpt"; "/dev/sda"]])],
"enable swap on labeled swap partition",
"\
This command enables swap to a labeled swap partition.
("swapon_uuid", (RErr, [String "uuid"], []), 176, [Optional "linuxfsuuid"],
(let uuid = uuidgen () in
[InitEmpty, Always, TestRun (
- [["mkswap_U"; uuid; "/dev/sdb"];
+ [["mkswap_U"; uuid; "/dev/sdc"];
["swapon_uuid"; uuid];
["swapoff_uuid"; uuid]])]),
"enable swap on swap partition by UUID",
See also C<guestfs_download>, C<guestfs_pread>.");
("pwrite_device", (RInt "nbytes", [Device "device"; BufferIn "content"; Int64 "offset"], []), 275, [ProtocolLimitWarning],
- [InitPartition, Always, TestOutputList (
+ [InitPartition, Always, TestOutputListOfDevices (
[["pwrite_device"; "/dev/sda"; "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"; "446"];
["blockdev_rereadpt"; "/dev/sda"];
- ["list_partitions"]], [])],
+ ["list_partitions"]], ["/dev/sdb1"])],
"write to part of a device",
"\
This command writes to part of a device. It writes the data