Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / block / write-threshold.h
blob63d1583887aa5ce2f14f4f2d2f514b0f87aae555
1 /*
2 * QEMU System Emulator block write threshold notification
4 * Copyright Red Hat, Inc. 2014
6 * Authors:
7 * Francesco Romani <fromani@redhat.com>
9 * This work is licensed under the terms of the GNU LGPL, version 2 or later.
10 * See the COPYING.LIB file in the top-level directory.
13 #ifndef BLOCK_WRITE_THRESHOLD_H
14 #define BLOCK_WRITE_THRESHOLD_H
17 * bdrv_write_threshold_set:
19 * Set the write threshold for block devices, in bytes.
20 * Notify when a write exceeds the threshold, meaning the device
21 * is becoming full, so it can be transparently resized.
22 * To be used with thin-provisioned block devices.
24 * Use threshold_bytes == 0 to disable.
26 void bdrv_write_threshold_set(BlockDriverState *bs, uint64_t threshold_bytes);
29 * bdrv_write_threshold_get
31 * Get the configured write threshold, in bytes.
32 * Zero means no threshold configured.
34 uint64_t bdrv_write_threshold_get(const BlockDriverState *bs);
37 * bdrv_write_threshold_check_write
39 * Check whether the specified request exceeds the write threshold.
40 * If so, send a corresponding event and disable write threshold checking.
42 void bdrv_write_threshold_check_write(BlockDriverState *bs, int64_t offset,
43 int64_t bytes);
45 #endif