qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC][PATCH v3 01/21] virtproxy: base data structures a


From: Michael Roth
Subject: Re: [Qemu-devel] [RFC][PATCH v3 01/21] virtproxy: base data structures and constants
Date: Thu, 18 Nov 2010 09:35:20 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 11/18/2010 05:06 AM, Jes Sorensen wrote:
On 11/16/10 02:15, Michael Roth wrote:
Signed-off-by: Michael Roth<address@hidden>
---
  virtproxy.c |  136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  virtproxy.h |   34 +++++++++++++++
  2 files changed, 170 insertions(+), 0 deletions(-)
  create mode 100644 virtproxy.c
  create mode 100644 virtproxy.h

diff --git a/virtproxy.c b/virtproxy.c
new file mode 100644
index 0000000..8f18d83
--- /dev/null
+++ b/virtproxy.c
@@ -0,0 +1,136 @@
+/*
+ * virt-proxy - host/guest communication layer
+ *
+ * Copyright IBM Corp. 2010
+ *
+ * Authors:
+ *  Michael Roth<address@hidden>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "virtproxy.h"
+
+#define VP_SERVICE_ID_LEN 32    /* max length of service id string */
+#define VP_PKT_DATA_LEN 1024    /* max proxied bytes per VPPacket */
+#define VP_CONN_DATA_LEN 1024   /* max bytes conns can send at a time */
+#define VP_MAGIC 0x1F374059
+
+/* listening fd, one for each service we're forwarding to remote end */
+typedef struct VPOForward {
+    VPDriver *drv;
+    int listen_fd;
+    char service_id[VP_SERVICE_ID_LEN];
+    QLIST_ENTRY(VPOForward) next;
+} VPOForward;

I am really not a fan of the typedefmeharder approach you are taking in
here, but others may disagree with me.

Isn't typedef'ing structured types part of the qemu coding style guidelines? Or is there something beyond that I'm doing that isn't agreeable? The named struct + typedef approach seems to be widely used, I think to maintain compatibility with utility macros like these while still adhering to coding style in using typedefs wherever possible:

qemu-queue.h:
#define QLIST_HEAD(name, type)                       \
struct name {                                        \
        struct type *lh_first;  /* first element */  \
}


Cheers,
Jes





reply via email to

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