3 disk
= bytearray(1024*1024)
7 print ("set_error = %r" % nbdkit
.set_error
)
35 def pread(h
, count
, offset
):
37 return disk
[offset
:offset
+count
]
40 def pwrite(h
, buf
, offset
):
42 end
= offset
+ len(buf
)
43 disk
[offset
:end
] = buf
46 def zero(h
, count
, offset
, may_trim
=False):
48 disk
[offset
:offset
+count
] = bytearray(count
)
55 def trim(h
, count
, offset
):