qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 07/32] blockdev: Move dmg probe to its own fi


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v3 07/32] blockdev: Move dmg probe to its own file
Date: Wed, 6 Jul 2016 16:39:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 05.07.2016 17:24, Colin Lord wrote:
> Isolate dmg probe as part of the modularization process.
> 
> Signed-off-by: Colin Lord <address@hidden>
> ---
>  block/Makefile.objs   |  2 +-
>  block/dmg.c           | 16 +---------------
>  block/probe/dmg.c     | 17 +++++++++++++++++
>  include/block/probe.h |  1 +
>  4 files changed, 20 insertions(+), 16 deletions(-)
>  create mode 100644 block/probe/dmg.c

Reviewed-by: Max Reitz <address@hidden>

[...]

> diff --git a/block/probe/dmg.c b/block/probe/dmg.c
> new file mode 100644
> index 0000000..a40281b
> --- /dev/null
> +++ b/block/probe/dmg.c
> @@ -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")) {

Reading this probing code makes me feel all funny inside. :-)

> +        return 2;
> +    }
> +    return 0;
> +}

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]