Patchwork guest agent: fix for guest agent RPCs/commands

login
register
mail settings
Submitter Michael Roth
Date June 15, 2011, 12:13 a.m.
Message ID <4DF7F915.3080500@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/100467/
State New
Headers show

Comments

Michael Roth - June 15, 2011, 12:13 a.m.
One of my commits must've gotten lost while I was squashing patches. 
Please apply the attached patch to correct a build issue due to 
qmp_guest_file_open()'s implementation not matching the qapi-generated 
prototype. Patch 3 has been updated in the corresponding repo branch if 
you're pulling from there.

Thanks to Matsuda Daiki for catching this.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
      FILE *fh;
      int fd, ret;
@@ -179,6 +179,9 @@ int64_t qmp_guest_file_open(const char *filepath, 
const char *mode, Error **err)
          error_set(err, QERR_QGA_LOGGING_FAILED);
          goto out;
      }
+    if (!has_mode) {
+        mode = "r";
+    }
      slog("guest-file-open called, filepath: %s, mode: %s", filepath, 
mode);
      fh = fopen(filepath, mode);
      if (!fh) {

Patch

diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
index 6f9886a..dbdc3b7 100644
--- a/qga/guest-agent-commands.c
+++ b/qga/guest-agent-commands.c
@@ -169,7 +169,7 @@  static void guest_file_handle_remove(int64_t id)
      g_free(data);
  }

-int64_t qmp_guest_file_open(const char *filepath, const char *mode, 
Error **err)
+int64_t qmp_guest_file_open(const char *filepath, bool has_mode, const 
char *mode, Error **err)
  {