qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines
Date: Tue, 04 Sep 2012 15:10:23 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0

于 2012-9-3 22:20, Eric Blake 写道:
On 09/03/2012 03:18 AM, Wenchao Xia wrote:
   This patch contains public type and defines used in APIs.

Signed-off-by: Wenchao Xia <address@hidden>
---
  libqblock/libqblock-types.h |  228 +++++++++++++++++++++++++++++++++++++++++++
  1 files changed, 228 insertions(+), 0 deletions(-)
  create mode 100644 libqblock/libqblock-types.h

diff --git a/libqblock/libqblock-types.h b/libqblock/libqblock-types.h
new file mode 100644
index 0000000..3389bda
--- /dev/null
+++ b/libqblock/libqblock-types.h
@@ -0,0 +1,228 @@
+#ifndef LIBQBLOCK_TYPES_H

Missing a copyright header.  Shame.

+#define LIBQBLOCK_TYPES_H
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>

I see use of stdint (uint8_t) and stdbool (bool), but isn't
<sys/types.h> better than <stdio.h> and <stdlib.h> for size_t?

  right, thanks.

+
+/**
+ * QBlockInfoImageStatic: information about the block image.
+ *
+ * @loc: location info.
+ * @fmt_type: format type.
+ * @virt_size: virtual size in bytes.
+ * @backing_loc: backing file location, its type is QB_PROT_NONE if not exist.
+ * @allocated_size: allocated size in bytes, negative if not available.

Reading this...

+ * @encrypt: encrypt flag.
+ */
+struct QBlockInfoImageStatic {
+    struct QBlockOptionLoc loc;
+    enum QBlockFormat fmt_type;
+    size_t virt_size;
+    /* advance info */
+    struct QBlockOptionLoc backing_loc;
+    size_t allocated_size;

...negative is not possible for size_t.  Did you mean ssize_t?

  you are right.


--
Best Regards

Wenchao Xia




reply via email to

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