From 90d06e28888d9a492560ca986dca0708f881d173 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 23 Aug 2010 22:14:27 +0100 Subject: [PATCH] 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; }; 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.8.3.1