[Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2012-11-29 Thread Wenchao Xia
  These patches introduce libqblock API, make subdir-libqblock and make
check-libqblock could build this library.
Functionalities:
 1 create a new image.
 2 sync access of an image.
 3 basic image information retrieving such as backing file.
 4 detect if a sector is allocated in an image.
Supported Formats:
 ALL using file protocols.

  Patch 1 to 3 prepares qemu to accept libqblock.

v2:
  Insert reserved bytes into union.
  Use uint64_t instead of size_t, offset.
  Use const char * in filename pointer.
  Initialization function removed and it was automatically executed when
library is loaded.
  Added compile flag visibility=hidden, to avoid name space pollution.
  Structure naming style changed.
  Using byte unit instead of sector for every API.
  Added a member in image static information structure, to report logical
sector size, which is always 512 now.
  Read and write API can take request not aligned to 512 now. It returns the
byte number that have succeed in operation, but now either negative value
or the number requested would be returned, because qemu block sync I/O API
would not return such number.
  Typo fix due to comments and improved documents.

v3:
  Removed the code about OOM error, introduced GError.
  Used a table to map from string to enum types about format.
  Use typedef for every structure.
  Improved the gcc compiler macro to warn if gcc was not used.
  Global variable name changed with prefix libqb_.
  The struct QBlockStaticInfo was changed to folder full format related
information inside, and a new member with pointers pointing to the mostly used
members, such as backing file, virt size, was added. This would allow the user
to get full information about how it is created in the future.
  Each patch in the serial can work with qemu now.
  Typo fixes.

v4:
  Renamed QBroker to QBlockContext.
  Removed tool objs out of libqblock.
  Added a check in initialization about structure size for ABI.
  Added a new helper API to duplicate protocol information, helps to open files
in a backing file chain.
  Check-libqblock will not rebuild libqblock every time now.
  Test case file renamed to "libqblock-[FMT].c".
  Test use gtest framework now.
  Test do random creation of test file now, added check for information API in
it.
  Test do random sync io instead of fixed offset io now.
  Test accept one parameter about where to place the test image, now it is
./tests/libqblock/test_images.

v5:
  Makefile of libqblock was adjusted to be similar as libcacard, added spec
file and install section.
  Removed warning when GCC was not found.
  Structure names were changed to better ones.
  Removed the union typedef that contain reserved bytes to reduce the folder
depth.
  Some format related enum options was changed to better name.
  Added accessors about image static information, hide indirect accessing
member detail in the structure.
  Test Makefile do not create diretory now, test case create it themself.
  Test build system do not use libtool now, and removed qtest-obj-y in its
dependency, make check will automatically execute test anyway now.
  Removed "ifeq ($(LIBTOOL),)" in Makefile.

v6:
  Remove address pointer member in image static info structure.

v7:
  Support out of tree building.

v8:
  Fix a bug in out of tree building.

v9:
  Rebase and splitted out small fix patch for qemu.

v10:
  Rebased to upstream, adjusted libqblock build system according to Paolo's
comments.

v11:
  Adjusting code in patch 4 to 7, details are in the child patch's commit
message.

v12:
  Split a patch to add a function in stubs, other change are in patch 4 to 7
commit messages.

v13:
  Moved another function into stubs, added xml rule in tests/makefile, little
changes in patch 4, 6, 7.

Wenchao Xia (7):
  Build system clean tests directory clearly
  block export function path_has_protocol
  stubs add set_fd_handler and signalfd_available
  libqblock build system
  libqblock API design and type defines
  libqblock API implement
  libqblock test example

 .gitignore |2 +
 Makefile   |   31 +-
 block.c|2 +-
 block.h|2 +
 configure  |   41 ++-
 libqblock/Makefile |   75 +++
 libqblock/libqblock-aio.c  |   78 +++
 libqblock/libqblock-aio.h  |8 +
 libqblock/libqblock-error.c|   57 ++
 libqblock/libqblock-error.h|   49 ++
 libqblock/libqblock-internal.h |   68 +++
 libqblock/libqblock-types.h|  245 +
 libqblock/libqblock.c  | 1180 
 libqblock/libqblock.h  |  355 
 libqblock/libqblock.pc.in  |   13 +
 rules.mak  |4 +
 stubs/Makefile.objs|1 +
 stubs/set-fd-handler.c |8 +
 stubs/signalfd.c   |7 +
 tests/Makefile |   38 ++-
 tests/check-libqblock-qcow2.c  |  392 +
 21 files changed, 2645 insertions(

Re: [Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2013-01-21 Thread Paolo Bonzini
Il 14/12/2012 11:17, Paolo Bonzini ha scritto:
> Il 14/12/2012 11:06, Wenchao Xia ha scritto:
>>
>> Hi Paolo,
>>   Do you think a rebase of the libqblock is needed? It have been quite
>> a time without comments.
> 
> I was hoping that other people would jump in. :)

Please rebase, there will be some changes required in the build system.
 See libcacard/Makefile for a model.

Paolo




Re: [Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2012-12-08 Thread Wenchao Xia

Hi, Paolo
  Do you think this version still needs more improvement?


   These patches introduce libqblock API, make subdir-libqblock and make
check-libqblock could build this library.
Functionalities:
  1 create a new image.
  2 sync access of an image.
  3 basic image information retrieving such as backing file.
  4 detect if a sector is allocated in an image.
Supported Formats:
  ALL using file protocols.

   Patch 1 to 3 prepares qemu to accept libqblock.

v2:
   Insert reserved bytes into union.
   Use uint64_t instead of size_t, offset.
   Use const char * in filename pointer.
   Initialization function removed and it was automatically executed when
library is loaded.
   Added compile flag visibility=hidden, to avoid name space pollution.
   Structure naming style changed.
   Using byte unit instead of sector for every API.
   Added a member in image static information structure, to report logical
sector size, which is always 512 now.
   Read and write API can take request not aligned to 512 now. It returns the
byte number that have succeed in operation, but now either negative value
or the number requested would be returned, because qemu block sync I/O API
would not return such number.
   Typo fix due to comments and improved documents.

v3:
   Removed the code about OOM error, introduced GError.
   Used a table to map from string to enum types about format.
   Use typedef for every structure.
   Improved the gcc compiler macro to warn if gcc was not used.
   Global variable name changed with prefix libqb_.
   The struct QBlockStaticInfo was changed to folder full format related
information inside, and a new member with pointers pointing to the mostly used
members, such as backing file, virt size, was added. This would allow the user
to get full information about how it is created in the future.
   Each patch in the serial can work with qemu now.
   Typo fixes.

v4:
   Renamed QBroker to QBlockContext.
   Removed tool objs out of libqblock.
   Added a check in initialization about structure size for ABI.
   Added a new helper API to duplicate protocol information, helps to open files
in a backing file chain.
   Check-libqblock will not rebuild libqblock every time now.
   Test case file renamed to "libqblock-[FMT].c".
   Test use gtest framework now.
   Test do random creation of test file now, added check for information API in
it.
   Test do random sync io instead of fixed offset io now.
   Test accept one parameter about where to place the test image, now it is
./tests/libqblock/test_images.

v5:
   Makefile of libqblock was adjusted to be similar as libcacard, added spec
file and install section.
   Removed warning when GCC was not found.
   Structure names were changed to better ones.
   Removed the union typedef that contain reserved bytes to reduce the folder
depth.
   Some format related enum options was changed to better name.
   Added accessors about image static information, hide indirect accessing
member detail in the structure.
   Test Makefile do not create diretory now, test case create it themself.
   Test build system do not use libtool now, and removed qtest-obj-y in its
dependency, make check will automatically execute test anyway now.
   Removed "ifeq ($(LIBTOOL),)" in Makefile.

v6:
   Remove address pointer member in image static info structure.

v7:
   Support out of tree building.

v8:
   Fix a bug in out of tree building.

v9:
   Rebase and splitted out small fix patch for qemu.

v10:
   Rebased to upstream, adjusted libqblock build system according to Paolo's
comments.

v11:
   Adjusting code in patch 4 to 7, details are in the child patch's commit
message.

v12:
   Split a patch to add a function in stubs, other change are in patch 4 to 7
commit messages.

v13:
   Moved another function into stubs, added xml rule in tests/makefile, little
changes in patch 4, 6, 7.

Wenchao Xia (7):
   Build system clean tests directory clearly
   block export function path_has_protocol
   stubs add set_fd_handler and signalfd_available
   libqblock build system
   libqblock API design and type defines
   libqblock API implement
   libqblock test example

  .gitignore |2 +
  Makefile   |   31 +-
  block.c|2 +-
  block.h|2 +
  configure  |   41 ++-
  libqblock/Makefile |   75 +++
  libqblock/libqblock-aio.c  |   78 +++
  libqblock/libqblock-aio.h  |8 +
  libqblock/libqblock-error.c|   57 ++
  libqblock/libqblock-error.h|   49 ++
  libqblock/libqblock-internal.h |   68 +++
  libqblock/libqblock-types.h|  245 +
  libqblock/libqblock.c  | 1180 
  libqblock/libqblock.h  |  355 
  libqblock/libqblock.pc.in  |   13 +
  rules.mak  |4 +
  stubs/Makefile.objs|1 +
  stubs/set-fd-handler.c |8 +
  stubs/signalfd.c  

Re: [Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2012-12-14 Thread Wenchao Xia



v13:
   Moved another function into stubs, added xml rule in tests/makefile, little
changes in patch 4, 6, 7.

Wenchao Xia (7):


Hi Paolo,
  Do you think a rebase of the libqblock is needed? It have been quite
a time without comments.


--
Best Regards

Wenchao Xia




Re: [Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2012-12-14 Thread Paolo Bonzini
Il 14/12/2012 11:06, Wenchao Xia ha scritto:
> 
> Hi Paolo,
>   Do you think a rebase of the libqblock is needed? It have been quite
> a time without comments.

I was hoping that other people would jump in. :)

Paolo