mirror of https://github.com/xemu-project/xemu.git
block: drop force_dup parameter of raw_reconfigure_getfd()
Since commit 72373e40fb
, this parameter is always passed as 'false'
from the caller.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
Message-ID: <20240430170213.148558-1-den@openvz.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
80e8f06021
commit
b67e353863
|
@ -1039,8 +1039,7 @@ static int fcntl_setfl(int fd, int flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
|
static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
|
||||||
int *open_flags, uint64_t perm, bool force_dup,
|
int *open_flags, uint64_t perm, Error **errp)
|
||||||
Error **errp)
|
|
||||||
{
|
{
|
||||||
BDRVRawState *s = bs->opaque;
|
BDRVRawState *s = bs->opaque;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
@ -1068,7 +1067,7 @@ static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
|
||||||
assert((s->open_flags & O_ASYNC) == 0);
|
assert((s->open_flags & O_ASYNC) == 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!force_dup && *open_flags == s->open_flags) {
|
if (*open_flags == s->open_flags) {
|
||||||
/* We're lucky, the existing fd is fine */
|
/* We're lucky, the existing fd is fine */
|
||||||
return s->fd;
|
return s->fd;
|
||||||
}
|
}
|
||||||
|
@ -3748,8 +3747,7 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* We may need a new fd if auto-read-only switches the mode */
|
/* We may need a new fd if auto-read-only switches the mode */
|
||||||
ret = raw_reconfigure_getfd(bs, input_flags, &open_flags, perm,
|
ret = raw_reconfigure_getfd(bs, input_flags, &open_flags, perm, errp);
|
||||||
false, errp);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
} else if (ret != s->fd) {
|
} else if (ret != s->fd) {
|
||||||
|
|
Loading…
Reference in New Issue