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

[Libguestfs] [PATCH] Raise error message max size to 64K.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
>From 8f22ca1afb619762ad66eae46afd194bdd7f3224 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones redhat com>
Date: Mon, 23 Aug 2010 22:14:27 +0100
Subject: [PATCH 1/2] Raise error message max size to 64K.

This commit removes one of the protocol limits, by raising the
maximum error message size from 256 bytes to 64K.

Although we could consider raising this further, since the
error messages are currently stored in fixed sized buffers on
the stack, that would require more invasive code changes.
---
 src/generator.ml |    6 +++++-
 src/guestfs.pod  |    9 ---------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/generator.ml b/src/generator.ml
index e18fa38..7d35ac1 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6324,8 +6324,12 @@ enum guestfs_message_status {
   GUESTFS_STATUS_ERROR = 1
 };
 
-const GUESTFS_ERROR_LEN = 256;
+";
+
+  pr "const GUESTFS_ERROR_LEN = %d;\n" (64 * 1024);
+  pr "\n";
 
+  pr "\
 struct guestfs_message_error {
   string error_message<GUESTFS_ERROR_LEN>;
 };
diff --git a/src/guestfs.pod b/src/guestfs.pod
index 5deccb5..a4d9c57 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -724,15 +724,6 @@ The error message you get from this is also a little obscure.
 This could be fixed in the generator by specially marking parameters
 and return values which take bytes or other units.
 
-=item Protocol limit of 256 characters for error messages
-
-This limit is both rather small and quite unnecessary.  We should be
-able to return error messages up to the length of the protocol message
-(2-4 MB).
-
-Note that we cannot change the protocol without some breakage, because
-there are distributions that repackage the Fedora appliance.
-
 =item Protocol should return errno with error messages.
 
 It would be a nice-to-have to be able to get the original value of
-- 
1.7.1


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