On 05.07.2016 17:24, Colin Lord wrote: > Isolates qcow probe as part of the modularization process. > > Signed-off-by: Colin Lord <cl...@redhat.com> > --- > 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 <mre...@redhat.com> > 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. > +}
signature.asc
Description: OpenPGP digital signature