3 my $disk = "\0" x
(1024*1024);
6 # Call the debug function to check it works.
7 Nbdkit
::debug
("hello world!");
9 # Check some expected constants are defined. Since these constants
10 # are defined by the nbdkit ABI, they should never change so checking
11 # their absolute values here ought to be fine.
12 die unless $Nbdkit::FLAG_MAY_TRIM
== 1;
13 die unless $Nbdkit::FLAG_FUA
== 2;
14 die unless $Nbdkit::FLAG_REQ_ONE
== 4;
15 die unless $Nbdkit::FUA_NATIVE
== 2;
16 die unless $Nbdkit::CACHE_EMULATE
== 1;
17 die unless $Nbdkit::EXTENT_ZERO
== 2;
27 Nbdkit
::debug
("perl plugin opened, readonly=" . $readonly);
28 my $h = { readonly
=> $readonly };
40 return length ($disk);
72 return substr ($disk, $offset, $count);
79 my $count = length ($buf);
81 substr ($disk, $offset, $count) = $buf;