@@ -68,6 +68,7 @@ static BdrvProbeFunc *format_probes[] = {
bdrv_parallels_probe,
bdrv_qcow_probe,
bdrv_qcow2_probe,
+ bdrv_qed_probe,
};
static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states =
@@ -3,16 +3,22 @@
#include "block/probe.h"
#include "qed.h"
-int bdrv_qed_probe(const uint8_t *buf, int buf_size,
- const char *filename)
+const char *bdrv_qed_probe(const uint8_t *buf, int buf_size,
+ const char *filename, int *score)
{
+ const char *format = "qed";
const QEDHeader *header = (const QEDHeader *)buf;
+ assert(score);
+ *score = 0;
if (buf_size < sizeof(*header)) {
- return 0;
+ return format;
}
+
if (le32_to_cpu(header->magic) != QED_MAGIC) {
- return 0;
+ return format;
}
- return 100;
+
+ *score = 100;
+ return format;
}
@@ -1638,7 +1638,6 @@ static BlockDriver bdrv_qed = {
.create_opts = &qed_create_opts,
.supports_backing = true,
- .bdrv_probe = bdrv_qed_probe,
.bdrv_open = bdrv_qed_open,
.bdrv_close = bdrv_qed_close,
.bdrv_reopen_prepare = bdrv_qed_reopen_prepare,
@@ -1,7 +1,6 @@
#ifndef PROBE_H
#define PROBE_H
-int bdrv_qed_probe(const uint8_t *buf, int buf_size, const char *filename);
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);
@@ -21,5 +20,7 @@ const char *bdrv_qcow_probe(const uint8_t *buf, int buf_size,
const char *filename, int *score);
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);
#endif