@@ -24,7 +24,7 @@ block-obj-y += accounting.o dirty-bitmap.o
block-obj-y += write-threshold.o
block-obj-y += crypto.o
-block-obj-y += bochs-probe.o cloop-probe.o crypto-probe.o
+block-obj-y += bochs-probe.o cloop-probe.o crypto-probe.o dmg-probe.o
common-obj-y += stream.o
common-obj-y += backup.o
new file mode 100644
@@ -0,0 +1,17 @@
+#include "qemu/osdep.h"
+#include "block/probe.h"
+
+int dmg_probe(const uint8_t *buf, int buf_size, const char *filename)
+{
+ int len;
+
+ if (!filename) {
+ return 0;
+ }
+
+ len = strlen(filename);
+ if (len > 4 && !strcmp(filename + len - 4, ".dmg")) {
+ return 2;
+ }
+ return 0;
+}
@@ -25,6 +25,7 @@
#include "qapi/error.h"
#include "qemu-common.h"
#include "block/block_int.h"
+#include "block/probe.h"
#include "qemu/bswap.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
@@ -66,21 +67,6 @@ typedef struct BDRVDMGState {
#endif
} BDRVDMGState;
-static int dmg_probe(const uint8_t *buf, int buf_size, const char *filename)
-{
- int len;
-
- if (!filename) {
- return 0;
- }
-
- len = strlen(filename);
- if (len > 4 && !strcmp(filename + len - 4, ".dmg")) {
- return 2;
- }
- return 0;
-}
-
static int read_uint64(BlockDriverState *bs, int64_t offset, uint64_t *result)
{
uint64_t buffer;
@@ -5,5 +5,6 @@ int bochs_probe(const uint8_t *buf, int buf_size, const char *filename);
int cloop_probe(const uint8_t *buf, int buf_size, const char *filename);
int block_crypto_probe_luks(const uint8_t *buf, int buf_size,
const char *filename);
+int dmg_probe(const uint8_t *buf, int buf_size, const char *filename);
#endif