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

Re: [Libguestfs] [PATCH 2/2] New API: pwrite-device



On Sun, Sep 26, 2010 at 07:55:03PM +0100, Richard W.M. Jones wrote:
> +   [InitPartition, Always, TestOutputList (
> +      [["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"]], [])],

This test probably deserves some more explanation.

InitPartition creates a single partition (/dev/sda1) for the test
environment.

The test code then zaps the MBR partition table, overwriting the table
and the signature with all zeroes.  This Wikipedia page is a helpful
reference:
https://secure.wikimedia.org/wikipedia/en/wiki/Master_Boot_Record

We then tell the kernel to reread the partition table, and list the
partitions (which, being zapped, we expect to be an empty list).

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw


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