vvfat.c (3d34c6cd99f434126365150c2535bbf93b94f891) vvfat.c (4f6fd3491cf0f768b135ed2e242bd1d1d2a2efec)
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

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

2889static int write_target_commit(BlockDriverState *bs, int64_t sector_num,
2890 const uint8_t* buffer, int nb_sectors) {
2891 BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
2892 return try_commit(s);
2893}
2894
2895static void write_target_close(BlockDriverState *bs) {
2896 BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
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

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

2889static int write_target_commit(BlockDriverState *bs, int64_t sector_num,
2890 const uint8_t* buffer, int nb_sectors) {
2891 BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
2892 return try_commit(s);
2893}
2894
2895static void write_target_close(BlockDriverState *bs) {
2896 BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
2897 bdrv_delete(s->qcow);
2897 bdrv_unref(s->qcow);
2898 g_free(s->qcow_filename);
2899}
2900
2901static BlockDriver vvfat_write_target = {
2902 .format_name = "vvfat_write_target",
2903 .bdrv_write = write_target_commit,
2904 .bdrv_close = write_target_close,
2905};

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

2930 goto err;
2931 }
2932
2933 s->qcow = bdrv_new("");
2934
2935 ret = bdrv_open(s->qcow, s->qcow_filename, NULL,
2936 BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH, bdrv_qcow);
2937 if (ret < 0) {
2898 g_free(s->qcow_filename);
2899}
2900
2901static BlockDriver vvfat_write_target = {
2902 .format_name = "vvfat_write_target",
2903 .bdrv_write = write_target_commit,
2904 .bdrv_close = write_target_close,
2905};

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

2930 goto err;
2931 }
2932
2933 s->qcow = bdrv_new("");
2934
2935 ret = bdrv_open(s->qcow, s->qcow_filename, NULL,
2936 BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH, bdrv_qcow);
2937 if (ret < 0) {
2938 bdrv_delete(s->qcow);
2938 bdrv_unref(s->qcow);
2939 goto err;
2940 }
2941
2942#ifndef _WIN32
2943 unlink(s->qcow_filename);
2944#endif
2945
2946 s->bs->backing_hd = bdrv_new("");

--- 72 unchanged lines hidden ---
2939 goto err;
2940 }
2941
2942#ifndef _WIN32
2943 unlink(s->qcow_filename);
2944#endif
2945
2946 s->bs->backing_hd = bdrv_new("");

--- 72 unchanged lines hidden ---