于 2012-9-4 14:50, Paolo Bonzini 写道:
Il 04/09/2012 05:15, Wenchao Xia ha scritto:

Can you use GError instead?

   read through the GError doc, GError is defined as following:
struct GError {
   GQuark       domain;
   gint         code;
   gchar       *message;
};
   I am worried about the message member, I guess program would be
aborted if OOM, which I was tring to avoid, so I used char err_msg[1024]
in my code, and make things simpler.

That's true.  On the other hand, and IMHO, not aborting in the library
code is a non-goal as long as the rest of the block layer still does.

  Hard problem for me, do you have some suggestion about OOM issue?
Using GLib's more functions, such as GError and Gsource main event
loop, would cause this issue more difficult to solve later.
  Do we have an alternative robust lib as glib but reports OOM instead
exit on Linux?

    3 QBlockInfoImageStatic. Now it is not folded with location and
format.

What does "Static" mean?

  It is about sorting the information into following kinds:
1) static. It is values that defined at creating time/modifying time,
mostly some settings, and it would not be automatically changed in I/O.
2) dynamic. Some information that would changes in I/O and other
operations, such as allocated_size, snapshots.
3) statistics.
   Now only static one is provided, so I added _static suffix.

Makes sense, thanks for the clarification.  Perhaps QBlockStaticInfo is
a shorter and simpler name?

  OK.

Paolo



--
Best Regards

Wenchao Xia


Reply via email to