block.c (5efa9d5a8b18841c9c62208a494d7f519238979a) | block.c (c833ab7351f2ebac46740380a81e34482e208dcc) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 292 unchanged lines hidden (view full) --- 301 (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) { 302 return bdrv_find_format("host_device"); 303 } 304 } 305#endif 306 307 drv = find_protocol(filename); 308 /* no need to test disk image formats for vvfat */ | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 292 unchanged lines hidden (view full) --- 301 (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) { 302 return bdrv_find_format("host_device"); 303 } 304 } 305#endif 306 307 drv = find_protocol(filename); 308 /* no need to test disk image formats for vvfat */ |
309 if (strcmp(drv->format_name, "vvfat") == 0) | 309 if (drv && strcmp(drv->format_name, "vvfat") == 0) |
310 return drv; 311 312 ret = bdrv_file_open(&bs, filename, BDRV_O_RDONLY); 313 if (ret < 0) 314 return NULL; 315 ret = bdrv_pread(bs, 0, buf, sizeof(buf)); 316 bdrv_delete(bs); 317 if (ret < 0) { --- 1324 unchanged lines hidden --- | 310 return drv; 311 312 ret = bdrv_file_open(&bs, filename, BDRV_O_RDONLY); 313 if (ret < 0) 314 return NULL; 315 ret = bdrv_pread(bs, 0, buf, sizeof(buf)); 316 bdrv_delete(bs); 317 if (ret < 0) { --- 1324 unchanged lines hidden --- |