copy-on-read.c (672f9d0df10a68a5c5f2b32cbc8284abf9f5ee18) copy-on-read.c (bd86fb990cfedc50d9705b8ed31d183f01942035)
1/*
2 * Copy-on-read filter block driver
3 *
4 * Copyright (c) 2018 Red Hat, Inc.
5 *
6 * Author:
7 * Max Reitz <mreitz@redhat.com>
8 *

--- 37 unchanged lines hidden (view full) ---

46
47
48#define PERM_PASSTHROUGH (BLK_PERM_CONSISTENT_READ \
49 | BLK_PERM_WRITE \
50 | BLK_PERM_RESIZE)
51#define PERM_UNCHANGED (BLK_PERM_ALL & ~PERM_PASSTHROUGH)
52
53static void cor_child_perm(BlockDriverState *bs, BdrvChild *c,
1/*
2 * Copy-on-read filter block driver
3 *
4 * Copyright (c) 2018 Red Hat, Inc.
5 *
6 * Author:
7 * Max Reitz <mreitz@redhat.com>
8 *

--- 37 unchanged lines hidden (view full) ---

46
47
48#define PERM_PASSTHROUGH (BLK_PERM_CONSISTENT_READ \
49 | BLK_PERM_WRITE \
50 | BLK_PERM_RESIZE)
51#define PERM_UNCHANGED (BLK_PERM_ALL & ~PERM_PASSTHROUGH)
52
53static void cor_child_perm(BlockDriverState *bs, BdrvChild *c,
54 const BdrvChildRole *role,
54 const BdrvChildClass *child_class,
55 BlockReopenQueue *reopen_queue,
56 uint64_t perm, uint64_t shared,
57 uint64_t *nperm, uint64_t *nshared)
58{
59 *nperm = perm & PERM_PASSTHROUGH;
60 *nshared = (shared & PERM_PASSTHROUGH) | PERM_UNCHANGED;
61
62 /* We must not request write permissions for an inactive node, the child

--- 86 unchanged lines hidden ---
55 BlockReopenQueue *reopen_queue,
56 uint64_t perm, uint64_t shared,
57 uint64_t *nperm, uint64_t *nshared)
58{
59 *nperm = perm & PERM_PASSTHROUGH;
60 *nshared = (shared & PERM_PASSTHROUGH) | PERM_UNCHANGED;
61
62 /* We must not request write permissions for an inactive node, the child

--- 86 unchanged lines hidden ---