vvfat.c (f844ec01b36797e0e5f31f56bfbe49f8c24cc7d4) vvfat.c (bd86fb990cfedc50d9705b8ed31d183f01942035)
1/* vim:set shiftwidth=4 ts=4: */
2/*
3 * QEMU Block driver for virtual VFAT (shadows a local directory)
4 *
5 * Copyright (c) 2004,2005 Johannes E. Schindelin
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

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

3131static void vvfat_qcow_options(int *child_flags, QDict *child_options,
3132 int parent_flags, QDict *parent_options)
3133{
3134 qdict_set_default_str(child_options, BDRV_OPT_READ_ONLY, "off");
3135 qdict_set_default_str(child_options, BDRV_OPT_AUTO_READ_ONLY, "off");
3136 qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on");
3137}
3138
1/* vim:set shiftwidth=4 ts=4: */
2/*
3 * QEMU Block driver for virtual VFAT (shadows a local directory)
4 *
5 * Copyright (c) 2004,2005 Johannes E. Schindelin
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

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

3131static void vvfat_qcow_options(int *child_flags, QDict *child_options,
3132 int parent_flags, QDict *parent_options)
3133{
3134 qdict_set_default_str(child_options, BDRV_OPT_READ_ONLY, "off");
3135 qdict_set_default_str(child_options, BDRV_OPT_AUTO_READ_ONLY, "off");
3136 qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on");
3137}
3138
3139static const BdrvChildRole child_vvfat_qcow = {
3139static const BdrvChildClass child_vvfat_qcow = {
3140 .parent_is_bds = true,
3141 .inherit_options = vvfat_qcow_options,
3142};
3143
3144static int enable_write_target(BlockDriverState *bs, Error **errp)
3145{
3146 BDRVVVFATState *s = bs->opaque;
3147 BlockDriver *bdrv_qcow = NULL;

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

3205
3206err:
3207 g_free(s->qcow_filename);
3208 s->qcow_filename = NULL;
3209 return ret;
3210}
3211
3212static void vvfat_child_perm(BlockDriverState *bs, BdrvChild *c,
3140 .parent_is_bds = true,
3141 .inherit_options = vvfat_qcow_options,
3142};
3143
3144static int enable_write_target(BlockDriverState *bs, Error **errp)
3145{
3146 BDRVVVFATState *s = bs->opaque;
3147 BlockDriver *bdrv_qcow = NULL;

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

3205
3206err:
3207 g_free(s->qcow_filename);
3208 s->qcow_filename = NULL;
3209 return ret;
3210}
3211
3212static void vvfat_child_perm(BlockDriverState *bs, BdrvChild *c,
3213 const BdrvChildRole *role,
3213 const BdrvChildClass *child_class,
3214 BlockReopenQueue *reopen_queue,
3215 uint64_t perm, uint64_t shared,
3216 uint64_t *nperm, uint64_t *nshared)
3217{
3218 BDRVVVFATState *s = bs->opaque;
3219
3214 BlockReopenQueue *reopen_queue,
3215 uint64_t perm, uint64_t shared,
3216 uint64_t *nperm, uint64_t *nshared)
3217{
3218 BDRVVVFATState *s = bs->opaque;
3219
3220 assert(c == s->qcow || role == &child_backing);
3220 assert(c == s->qcow || child_class == &child_backing);
3221
3222 if (c == s->qcow) {
3223 /* This is a private node, nobody should try to attach to it */
3224 *nperm = BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE;
3225 *nshared = BLK_PERM_WRITE_UNCHANGED;
3226 } else {
3227 /* The backing file is there so 'commit' can use it. vvfat doesn't
3228 * access it in any way. */

--- 65 unchanged lines hidden ---
3221
3222 if (c == s->qcow) {
3223 /* This is a private node, nobody should try to attach to it */
3224 *nperm = BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE;
3225 *nshared = BLK_PERM_WRITE_UNCHANGED;
3226 } else {
3227 /* The backing file is there so 'commit' can use it. vvfat doesn't
3228 * access it in any way. */

--- 65 unchanged lines hidden ---