qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 09/32] blockdev: Move qcow probe to its own f


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v3 09/32] blockdev: Move qcow probe to its own file
Date: Wed, 6 Jul 2016 16:49:09 +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:
> Isolates qcow probe as part of the modularization process.
> 
> Signed-off-by: Colin Lord <address@hidden>
> ---
>  block/Makefile.objs         |  2 +-
>  block/probe/qcow.c          | 16 ++++++++++++++++
>  block/qcow.c                | 31 ++-----------------------------
>  include/block/driver/qcow.h | 21 +++++++++++++++++++++
>  include/block/probe.h       |  1 +
>  5 files changed, 41 insertions(+), 30 deletions(-)
>  create mode 100644 block/probe/qcow.c
>  create mode 100644 include/block/driver/qcow.h

Reviewed-by: Max Reitz <address@hidden>

> diff --git a/block/probe/qcow.c b/block/probe/qcow.c
> new file mode 100644
> index 0000000..6024d11
> --- /dev/null
> +++ b/block/probe/qcow.c
> @@ -0,0 +1,16 @@
> +#include "qemu/osdep.h"
> +#include "block/block_int.h"
> +#include "block/probe.h"
> +#include "block/driver/qcow.h"
> +
> +int qcow_probe(const uint8_t *buf, int buf_size, const char *filename)
> +{
> +    const QCowHeader *cow_header = (const void *)buf;
> +
> +    if (buf_size >= sizeof(QCowHeader) &&
> +        be32_to_cpu(cow_header->magic) == QCOW_MAGIC &&
> +        be32_to_cpu(cow_header->version) == QCOW_VERSION)
> +        return 100;
> +    else
> +        return 0;

Again, pre-existing code style issues.

> +}

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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