@@ -69,6 +69,7 @@ static BdrvProbeFunc *format_probes[] = {
bdrv_qcow_probe,
bdrv_qcow2_probe,
bdrv_qed_probe,
+ bdrv_raw_probe,
};
static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states =
@@ -1,10 +1,14 @@
#include "qemu/osdep.h"
#include "block/probe.h"
-int raw_probe(const uint8_t *buf, int buf_size, const char *filename)
+const char *bdrv_raw_probe(const uint8_t *buf, int buf_size,
+ const char *filename, int *score)
{
+ const char *format = "raw";
+ assert(score);
/* smallest possible positive score so that raw is used if and only if no
* other block driver works
*/
- return 1;
+ *score = 1;
+ return format;
}
@@ -226,7 +226,6 @@ static int raw_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
BlockDriver bdrv_raw = {
.format_name = "raw",
- .bdrv_probe = &raw_probe,
.bdrv_reopen_prepare = &raw_reopen_prepare,
.bdrv_open = &raw_open,
.bdrv_close = &raw_close,
@@ -1,7 +1,6 @@
#ifndef PROBE_H
#define PROBE_H
-int raw_probe(const uint8_t *buf, int buf_size, const char *filename);
int vdi_probe(const uint8_t *buf, int buf_size, const char *filename);
int vhdx_probe(const uint8_t *buf, int buf_size, const char *filename);
int vmdk_probe(const uint8_t *buf, int buf_size, const char *filename);
@@ -22,5 +21,7 @@ const char *bdrv_qcow2_probe(const uint8_t *buf, int buf_size,
const char *filename, int *score);
const char *bdrv_qed_probe(const uint8_t *buf, int buf_size,
const char *filename, int *score);
+const char *bdrv_raw_probe(const uint8_t *buf, int buf_size,
+ const char *filename, int *score);
#endif