Revision 83f64091 block-vvfat.c

b/block-vvfat.c
351 351
} BDRVVVFATState;
352 352

  
353 353

  
354
static int vvfat_probe(const uint8_t *buf, int buf_size, const char *filename)
355
{
356
    if (strstart(filename, "fat:", NULL))
357
	return 100;
358
    return 0;
359
}
360

  
361 354
static void init_mbr(BDRVVVFATState* s)
362 355
{
363 356
    /* TODO: if the files mbr.img and bootsect.img exist, use them */
......
954 947
    return 0;
955 948
}
956 949

  
950
#ifdef DEBUG
957 951
static BDRVVVFATState *vvv = NULL;
952
#endif
958 953

  
959 954
static int enable_write_target(BDRVVVFATState *s);
960 955
static int is_consistent(BDRVVVFATState *s);
961 956

  
962
static int vvfat_open(BlockDriverState *bs, const char* dirname)
957
static int vvfat_open(BlockDriverState *bs, const char* dirname, int flags)
963 958
{
964 959
    BDRVVVFATState *s = bs->opaque;
965 960
    int floppy = 0;
966 961
    int i;
967 962

  
963
#ifdef DEBUG
968 964
    vvv = s;
965
#endif
969 966

  
970 967
DLOG(if (stderr == NULL) {
971 968
    stderr = fopen("vvfat.log", "a");
......
1040 1037
	bs->heads = bs->cyls = bs->secs = 0;
1041 1038

  
1042 1039
    //    assert(is_consistent(s));
1043

  
1044 1040
    return 0;
1045 1041
}
1046 1042

  
......
2732 2728
    array_init(&(s->commits), sizeof(commit_t));
2733 2729

  
2734 2730
    s->qcow_filename = malloc(1024);
2735
    strcpy(s->qcow_filename, "/tmp/vl.XXXXXX");
2736
    get_tmp_filename(s->qcow_filename, strlen(s->qcow_filename) + 1);
2731
    get_tmp_filename(s->qcow_filename, 1024);
2737 2732
    if (bdrv_create(&bdrv_qcow,
2738 2733
		s->qcow_filename, s->sector_count, "fat:", 0) < 0)
2739 2734
	return -1;
......
2767 2762
BlockDriver bdrv_vvfat = {
2768 2763
    "vvfat",
2769 2764
    sizeof(BDRVVVFATState),
2770
    vvfat_probe,
2765
    NULL, /* no probe for protocols */
2771 2766
    vvfat_open,
2772 2767
    vvfat_read,
2773 2768
    vvfat_write,
2774 2769
    vvfat_close,
2775 2770
    NULL, /* ??? Not sure if we can do any meaningful flushing.  */
2776 2771
    NULL,
2777
    vvfat_is_allocated
2772
    vvfat_is_allocated,
2773
    .protocol_name = "fat",
2778 2774
};
2779 2775

  
2780 2776
#ifdef DEBUG

Also available in: Unified diff