qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] guest agent: fix for guest agent RPCs/commands


From: Michael Roth
Subject: [Qemu-devel] [PATCH] guest agent: fix for guest agent RPCs/commands
Date: Tue, 14 Jun 2011 19:13:09 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

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 <address@hidden>
---
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)
 {
     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) {



reply via email to

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