Hi Phil,

as of right now, there is no official spec for the TCP packet contents. However, in the client code it is rather easy see how the packets are constructed. I hope I will get the client code online by the end of the week. I will also look into qtest. We definetely need a test like this and I think your example is a good idea.

Best Regards,
Nicolas


On 08/11/2023 15:33, Philippe Mathieu-Daudé wrote:
Hi Nicolas,

On 7/11/23 14:03, Nicolas Eder wrote:
---
  include/mcdstub/mcdstub.h | 144 ++++++++++++++++++++
  mcdstub/mcdstub.c         | 277 ++++++++++++++++++++++++++++++++++++++
  2 files changed, 421 insertions(+)

diff --git a/include/mcdstub/mcdstub.h b/include/mcdstub/mcdstub.h
index 36058157ae..1461d0e1cb 100644
--- a/include/mcdstub/mcdstub.h
+++ b/include/mcdstub/mcdstub.h
@@ -25,6 +25,21 @@ typedef struct MCDProcess {
      char target_xml[1024];
  } MCDProcess;
  +typedef void (*MCDCmdHandler)(GArray *params, void *user_ctx);
+typedef struct MCDCmdParseEntry {
+    MCDCmdHandler handler;
+    const char *cmd;
+    char schema[CMD_SCHEMA_LENGTH];
+} MCDCmdParseEntry;
+
+typedef union MCDCmdVariant {
+    const char *data;
+    uint32_t data_uint32_t;
+    uint64_t data_uint64_t;
+    uint32_t query_handle;
+    uint32_t cpu_id;
+} MCDCmdVariant;

[...]

Can we add an URL to the spec in this file header?

It should be relatively easy to add a qtest for MCB, with raw
packets to:
- read memory
- write memory
- read register
- write register
- register breakpoint
- run vcpu
- stop vcpu

Maybe we can write a tiny code that loop incrementing a static
variable, run for few ms and check the variable got incremented?
That would exercise most of these commands.

Regards,

Phil.

Reply via email to