Example #1
0
def zero(h, count, offset, may_trim):
    global disk
    if may_trim:
        disk[offset:offset+count] = bytearray(count)
    else:
        nbdkit.set_error(errno.EOPNOTSUPP)
        raise Exception
Example #2
0
def zero(h, count, offset, may_trim):
    global disk
    if may_trim:
        disk[offset:offset+count] = bytearray(count)
    else:
        nbdkit.set_error(errno.EOPNOTSUPP)
        raise Exception
Example #3
0
def zero(h, count, offset, flags):
    global disk
    if flags & nbdkit.FLAG_MAY_TRIM:
        disk[offset:offset+count] = bytearray(count)
    else:
        nbdkit.set_error(errno.EOPNOTSUPP)
        raise Exception