qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: stefanha@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2
Date: Fri, 10 Aug 2012 16:04:38 +0800	[thread overview]
Message-ID: <5024C096.9040007@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAAu8pHsJeuTCt3FzvTr_udktDa9ji1ze176++X1mUSMdt4AzBA@mail.gmail.com>

    Thanks for your review, sorry I have forgot some fixing you
mentioned before, will correct them this time.

于 2012-8-10 1:12, Blue Swirl 写道:
> On Thu, Aug 9, 2012 at 10:10 AM, Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote:
>>    This patch intrudce libqblock API, libqblock-test is used as a test case.
>>
>> V2:
>>    Using struct_size and [xxx]_new [xxx]_free to keep ABI.
>>    Using embbed structure to class format options in image creating.
>>    Format specific options were brought to surface.
>>    Image format was changed to enum interger instead of string.
>>    Some API were renamed.
>>    Internel error with errno was saved and with an API caller can get it.
>>    ALL flags used were defined in libqblock.h.
>>
>> Something need discuss:
>>    Embbed structure or union could make the model more friendly, but that
>> make ABI more difficult, because we need to check every embbed structure's
>> size and guess compiler's memory arrangement. This means #pragma pack(4)
>> or struct_size, offset_next in every structure. Any better way to solve it?
>> or make every structure a plain one?
>
> I'd still use accessor functions instead of structure passing, it
> would avoid these problems.
>
   Do you mean some function like :
   CreateOption_Filename_Set(const char *filename)
   CreateOption_Format_Set(const char *filename)

   It can solve the issue, with a cost of more small APIs in header
files that user should use. Not sure if there is a good way to make
it more friendly as an object language:
   "oc.filename = name;" automatically call CreateOption_Filename_Set,
API CreateOption_Filename_Set is invisible to user.


> Packing can even introduce a new set of problems since we don't
> control the CFLAGS of the client of the library.

   indeed, I tried to handle the difference in function qboo_adjust_o2n,
found that structure member alignment is hard to deal.

>>    AIO is missing, need a prototype.
>>
>> Wenchao Xia (3):
>>    adding libqblock
>>    libqblock API
>>    libqblock test case
>>
>>   Makefile         |    3 +
>>   block.c          |    2 +-
>>   block.h          |    1 +
>>   libqblock-test.c |  197 ++++++++++++++++
>>   libqblock.c      |  670 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>   libqblock.h      |  447 ++++++++++++++++++++++++++++++++++++
>>   6 files changed, 1319 insertions(+), 1 deletions(-)
>>   create mode 100644 libqblock-test.c
>>   create mode 100644 libqblock.c
>>   create mode 100644 libqblock.h
>>
>>
>>
>


-- 
Best Regards

Wenchao Xia

  reply	other threads:[~2012-08-10  8:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 10:10 [Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2 Wenchao Xia
2012-08-09 17:12 ` Blue Swirl
2012-08-10  8:04   ` Wenchao Xia [this message]
2012-08-11 12:18     ` Blue Swirl
2012-08-13 11:27       ` Wenchao Xia
2012-08-13 20:00         ` Blue Swirl
2012-08-14  8:52           ` Wenchao Xia
2012-08-14 18:25             ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5024C096.9040007@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).