search for: flag_fast_zero

Displaying 13 results from an estimated 13 matches for "flag_fast_zero".

2019 Nov 22
2
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...+ > + PyModule_AddIntConstant (m, "FLAG_MAY_TRIM", NBDKIT_FLAG_MAY_TRIM); > + PyModule_AddIntConstant (m, "FLAG_FUA", NBDKIT_FLAG_FUA); > + PyModule_AddIntConstant (m, "FLAG_REQ_ONE", NBDKIT_FLAG_REQ_ONE); > + PyModule_AddIntConstant (m, "FLAG_FAST_ZERO", NBDKIT_FLAG_FAST_ZERO); > + > + PyModule_AddIntConstant (m, "FUA_NONE", NBDKIT_FUA_NONE); > + PyModule_AddIntConstant (m, "FUA_EMULATE", NBDKIT_FUA_EMULATE); > + PyModule_AddIntConstant (m, "FUA_NATIVE", NBDKIT_FUA_NATIVE); > + &gt...
2019 Nov 22
1
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...tant (m, "FLAG_MAY_TRIM", NBDKIT_FLAG_MAY_TRIM); > > > + PyModule_AddIntConstant (m, "FLAG_FUA", NBDKIT_FLAG_FUA); > > > + PyModule_AddIntConstant (m, "FLAG_REQ_ONE", NBDKIT_FLAG_REQ_ONE); > > > + PyModule_AddIntConstant (m, "FLAG_FAST_ZERO", NBDKIT_FLAG_FAST_ZERO); > > > + > > > + PyModule_AddIntConstant (m, "FUA_NONE", NBDKIT_FUA_NONE); > > > + PyModule_AddIntConstant (m, "FUA_EMULATE", NBDKIT_FUA_EMULATE); > > > + PyModule_AddIntConstant (m, "FUA_NATIVE&q...
2019 Nov 22
0
[PATCH nbdkit v2 02/10] python: Add various constants to the API.
...EAD_MODEL_PARALLEL); + + PyModule_AddIntConstant (m, "FLAG_MAY_TRIM", NBDKIT_FLAG_MAY_TRIM); + PyModule_AddIntConstant (m, "FLAG_FUA", NBDKIT_FLAG_FUA); + PyModule_AddIntConstant (m, "FLAG_REQ_ONE", NBDKIT_FLAG_REQ_ONE); + PyModule_AddIntConstant (m, "FLAG_FAST_ZERO", NBDKIT_FLAG_FAST_ZERO); + + PyModule_AddIntConstant (m, "FUA_NONE", NBDKIT_FUA_NONE); + PyModule_AddIntConstant (m, "FUA_EMULATE", NBDKIT_FUA_EMULATE); + PyModule_AddIntConstant (m, "FUA_NATIVE", NBDKIT_FUA_NATIVE); + + PyModule_AddIntConstant (...
2019 Nov 22
0
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...dule_AddIntConstant (m, "FLAG_MAY_TRIM", NBDKIT_FLAG_MAY_TRIM); > > + PyModule_AddIntConstant (m, "FLAG_FUA", NBDKIT_FLAG_FUA); > > + PyModule_AddIntConstant (m, "FLAG_REQ_ONE", NBDKIT_FLAG_REQ_ONE); > > + PyModule_AddIntConstant (m, "FLAG_FAST_ZERO", NBDKIT_FLAG_FAST_ZERO); > > + > > + PyModule_AddIntConstant (m, "FUA_NONE", NBDKIT_FUA_NONE); > > + PyModule_AddIntConstant (m, "FUA_EMULATE", NBDKIT_FUA_EMULATE); > > + PyModule_AddIntConstant (m, "FUA_NATIVE", NBDKIT_FUA...
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1: https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html v2: - Fix implementation of can_cache. - Add implementation of can_fua. - Add a very thorough test suite which tests every command + flag combination.
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html In v4: - Rebase on top of current master. Includes various fixes and updates required because of Nir's patches that went into master. - Fix api_version() -> API_VERSION in patch 2 noted previously on the mailing list. Rich.
2019 Nov 23
8
[PATCH nbdkit v3 0/7] Implement nbdkit API v2 for Python plugins.
v2 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00163.html I pushed patch 1 (with spelling fix), patch 4 and patch 5 since those were previously ACKed on the list. Differences in v3: - Add error checking to PyModule_AddIntConstant. - Use API_VERSION constant instead of function. - Add max API version supported to --dump-plugin output. - Print API_VERSION selected by
2019 Nov 21
10
[PATCH nbdkit 0/8] Implement nbdkit API v2 for Python plugins.
And fill out most of the missing bits of the API. Rich.
2019 Nov 22
0
[PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...expect_may_trim = cfg.get ('zero_expect_may_trim', False) + actual_may_trim = bool (flags & nbdkit.FLAG_MAY_TRIM) + assert expect_may_trim == actual_may_trim + expect_fast_zero = cfg.get ('zero_expect_fast_zero', False) + actual_fast_zero = bool (flags & nbdkit.FLAG_FAST_ZERO) + assert expect_fast_zero == actual_fast_zero + h['disk'][offset:offset+count] = bytearray(count) + +def cache(h, count, offset, flags): + assert flags == 0 + # do nothing diff --git a/tests/test-python.py b/tests/test-python.py new file mode 100755 index 0000000..2f565ba --- /...
2019 Nov 22
0
[PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...-as subsequent reads see zeroes. +The body of your C<zero> function should ensure that C<count> bytes of +the disk, starting at C<offset>, will read back as zero. C<flags> is +a bitmask which may include C<nbdkit.FLAG_MAY_TRIM>, +C<nbdkit.FLAG_FUA>, C<nbdkit.FLAG_FAST_ZERO>. NBD only supports whole writes, so your function should try to -write the whole region (perhaps requiring a loop). If the write -fails or is partial, your function should throw an exception, -optionally using C<nbdkit.set_error> first. In particular, if -you would like to automatica...
2019 Nov 23
0
[PATCH nbdkit v3 2/7] python: Implement nbdkit API version 2.
...-as subsequent reads see zeroes. +The body of your C<zero> function should ensure that C<count> bytes of +the disk, starting at C<offset>, will read back as zero. C<flags> is +a bitmask which may include C<nbdkit.FLAG_MAY_TRIM>, +C<nbdkit.FLAG_FUA>, C<nbdkit.FLAG_FAST_ZERO>. NBD only supports whole writes, so your function should try to -write the whole region (perhaps requiring a loop). If the write -fails or is partial, your function should throw an exception, -optionally using C<nbdkit.set_error> first. In particular, if -you would like to automatica...
2019 Nov 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...cfg.get ('zero_expect_may_trim', False) > + actual_may_trim = bool (flags & nbdkit.FLAG_MAY_TRIM) > + assert expect_may_trim == actual_may_trim > + expect_fast_zero = cfg.get ('zero_expect_fast_zero', False) > + actual_fast_zero = bool (flags & nbdkit.FLAG_FAST_ZERO) > + assert expect_fast_zero == actual_fast_zero > + h['disk'][offset:offset+count] = bytearray(count) > + > +def cache(h, count, offset, flags): > + assert flags == 0 > + # do nothing > diff --git a/tests/test-python.py b/tests/test-python.py > new file...
2019 Nov 22
8
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...s see zeroes. > +The body of your C<zero> function should ensure that C<count> bytes of > +the disk, starting at C<offset>, will read back as zero. C<flags> is > +a bitmask which may include C<nbdkit.FLAG_MAY_TRIM>, > +C<nbdkit.FLAG_FUA>, C<nbdkit.FLAG_FAST_ZERO>. Well, technically FAST_ZERO can't be set until later in the series when you plumb in the can_fast_zero callback... :) > static int > -py_pwrite (void *handle, const void *buf, > - uint32_t count, uint64_t offset) > +py_pwrite (void *handle, const void *buf, uint...