Lines Matching +defs:event +defs:flags

85                                            QDict *options, int flags,
1127 * Set open flags for aio engine
1131 int bdrv_parse_aio(const char *mode, int *flags)
1136 *flags |= BDRV_O_NATIVE_AIO;
1139 *flags |= BDRV_O_IO_URING;
1149 * Set open flags for a given discard mode
1153 int bdrv_parse_discard_flags(const char *mode, int *flags)
1155 *flags &= ~BDRV_O_UNMAP;
1160 *flags |= BDRV_O_UNMAP;
1169 * Set open flags for a given cache mode
1173 int bdrv_parse_cache_mode(const char *mode, int *flags, bool *writethrough)
1175 *flags &= ~BDRV_O_CACHE_MASK;
1179 *flags |= BDRV_O_NOCACHE;
1182 *flags |= BDRV_O_NOCACHE;
1187 *flags |= BDRV_O_NO_FLUSH;
1239 * Returns the options and flags that a temporary snapshot should get, based on
1240 * the originally requested flags (the originally requested image will have
1241 * flags like a backing file)
1360 * Returns the options and flags that a generic child of a BDS should
1361 * get, based on the given options and flags for the parent BDS.
1367 int flags = parent_flags;
1387 flags &= ~BDRV_O_PROTOCOL;
1398 flags |= BDRV_O_PROTOCOL;
1427 /* Clear flags that only apply to the top layer */
1428 flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ);
1431 flags &= ~BDRV_O_NO_IO;
1434 flags &= ~BDRV_O_TEMPORARY;
1437 *child_flags = flags;
1542 static int bdrv_open_flags(BlockDriverState *bs, int flags)
1544 int open_flags = flags;
1548 * Clear flags that are internal to the block layer before opening the
1556 static void update_flags_from_options(int *flags, QemuOpts *opts)
1560 *flags &= ~(BDRV_O_CACHE_MASK | BDRV_O_RDWR | BDRV_O_AUTO_RDONLY);
1563 *flags |= BDRV_O_NO_FLUSH;
1567 *flags |= BDRV_O_NOCACHE;
1571 *flags |= BDRV_O_RDWR;
1575 *flags |= BDRV_O_AUTO_RDONLY;
1579 *flags |= BDRV_O_INACTIVE;
1583 static void update_options_from_flags(QDict *options, int flags)
1587 qdict_put_bool(options, BDRV_OPT_CACHE_DIRECT, flags & BDRV_O_NOCACHE);
1591 flags & BDRV_O_NO_FLUSH);
1594 qdict_put_bool(options, BDRV_OPT_READ_ONLY, !(flags & BDRV_O_RDWR));
1598 flags & BDRV_O_AUTO_RDONLY);
1746 QDict *options, int flags,
1755 bs->open_flags = flags;
1760 update_options_from_flags(bs->options, flags);
1762 ret = bdrv_open_driver(bs, drv, node_name, bs->options, flags, errp);
1777 int flags, Error **errp)
1780 return bdrv_new_open_driver_opts(drv, node_name, NULL, flags, errp);
2064 * filename/flags pair to option QDict entries.
2065 * The BDRV_O_PROTOCOL flag in *flags will be set or cleared accordingly if a
2069 int *flags, bool allow_parse_filename,
2073 bool protocol = *flags & BDRV_O_PROTOCOL;
2100 *flags |= BDRV_O_PROTOCOL;
2102 *flags &= ~BDRV_O_PROTOCOL;
2105 /* Translate cache options from flags into options */
2106 update_options_from_flags(*options, *flags);
2164 * Return the flags that @bs will have after the reopens in @q have
2166 * return the current flags.
2175 return entry->state.flags;
2188 int flags = bdrv_reopen_get_flags(q, bs);
2190 return (flags & (BDRV_O_RDWR | BDRV_O_INACTIVE)) == BDRV_O_RDWR;
2813 int flags;
2818 flags = bdrv_reopen_get_flags(reopen_queue, bs);
2838 if (!(flags & BDRV_O_NO_IO)) {
3896 int flags,
3942 bs_snapshot = bdrv_open(NULL, NULL, snapshot_options, flags, errp);
3976 int flags, BlockDriverState *parent,
3991 assert(!child_class || !flags);
4051 &flags, options,
4055 ret = bdrv_fill_options(&options, filename, &flags, parse_filename,
4062 * Set the BDRV_O_RDWR and BDRV_O_ALLOW_RDWR flags.
4070 flags |= (BDRV_O_RDWR | BDRV_O_ALLOW_RDWR);
4072 flags &= ~BDRV_O_RDWR;
4075 if (flags & BDRV_O_SNAPSHOT) {
4078 flags, options);
4082 &flags, options, flags, options);
4085 bs->open_flags = flags;
4100 assert(drvname || !(flags & BDRV_O_PROTOCOL));
4111 flags |= BDRV_O_NO_BACKING;
4120 if ((flags & BDRV_O_PROTOCOL) == 0) {
4172 assert(!!(flags & BDRV_O_PROTOCOL) == !!drv->protocol_name);
4175 assert(!(flags & BDRV_O_PROTOCOL) || !file);
4189 if ((flags & BDRV_O_NO_BACKING) == 0) {
4211 if (flags & BDRV_O_PROTOCOL) {
4269 QDict *options, int flags, Error **errp)
4273 return bdrv_open_inherit(filename, reference, options, flags, NULL,
4360 * flags contains the open flags for the associated bs
4379 int flags;
4423 flags = 0;
4424 klass->inherit_options(role, parent_is_format, &flags, options,
4427 flags = bdrv_get_flags(bs);
4437 /* We have the final set of options so let's update the flags */
4441 update_flags_from_options(&flags, opts);
4445 /* bdrv_open_inherit() sets and clears some additional flags internally */
4446 flags &= ~BDRV_O_PROTOCOL;
4447 if (flags & BDRV_O_RDWR) {
4448 flags |= BDRV_O_ALLOW_RDWR;
4462 bs_entry->state.flags = flags;
4513 options, flags, child_keep_old);
4560 * flags. All devices are prepared for reopen, and failure of any
4840 * flags are the new open flags
4887 /* This was already called in bdrv_reopen_queue_child() so the flags
4890 old_flags = reopen_state->flags;
4891 update_flags_from_options(&reopen_state->flags, opts);
4892 assert(old_flags == reopen_state->flags);
4896 if (bdrv_parse_discard_flags(discard, &reopen_state->flags) != 0) {
4904 bdrv_parse_detect_zeroes(opts, reopen_state->flags, &local_err);
4919 read_only = !(reopen_state->flags & BDRV_O_RDWR);
5104 /* set BDS specific flags now */
5112 bs->open_flags = reopen_state->flags;
5591 int flags, Error **errp)
5616 new_node_bs = bdrv_new_open_driver_opts(drv, node_name, options, flags,
6635 void coroutine_fn bdrv_co_debug_event(BlockDriverState *bs, BlkdebugEvent event)
6644 bs->drv->bdrv_co_debug_event(bs, event);
6663 int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event,
6671 return bs->drv->bdrv_debug_breakpoint(bs, event, tag);
7291 char *options, uint64_t img_size, int flags, bool quiet,
7383 if (backing_file && !(flags & BDRV_O_NO_BACKING)) {
7401 back_flags = flags;
7438 /* (backing_file && !(flags & BDRV_O_NO_BACKING)) */