
On Mon, Oct 07, 2013 at 12:23:44PM +0200, Claudio Bley wrote:
At Tue, 1 Oct 2013 17:19:56 +0100, Daniel P. Berrange wrote:
On Tue, Oct 01, 2013 at 06:13:10PM +0200, Viktor Mihajlovski wrote:
On 10/01/2013 03:02 PM, Daniel P. Berrange wrote:
On Mon, Sep 30, 2013 at 04:24:49PM +0100, Daniel P. Berrange wrote:
On Mon, Sep 30, 2013 at 05:23:33PM +0200, Michal Privoznik wrote:
On 30.09.2013 17:02, Claudio Bley wrote: >Hi. > >When trying to do a screenshot of a remote domain connected via >qemu+tcp (for testing purposes only), I receive this error: > >---------------------------------------------------------------------- >virsh -c qemu+tcp://dev/system >Welcome to virsh, the virtualization interactive terminal. > >Type: 'help' for help with commands > 'quit' to quit > >virsh # version >Compiled against library: libvir 0.9.8 >Using library: libvir 0.9.8 >Using API: QEMU 0.9.8 >Running hypervisor: QEMU 1.5.1 > >virsh # screenshot 2 /tmp/screendump >error: could not receive data from domain 2 >error: packet 1048600 bytes received from server too large, want 262144 > >virsh # 2013-09-30 14:47:05.158+0000: 21646: info : libvirt version: 0.9.8 >2013-09-30 14:47:05.158+0000: 21646: warning : virNetClientIncomingEvent:1660 : Something went wrong during async message processing >---------------------------------------------------------------------- > >I'm using Ubuntu LTS 12.04.3, latest version in the repo which is >0.9.8-2ubuntu17.13.
This problem was fixed in
commit 27e81517a876dcb738dd8a9bb2e0e68d71c3b7e3 Author: Daniel P. Berrange <berrange@redhat.com> Date: Mon Sep 30 17:27:51 2013 +0100
Fix max stream packet size for old clients
The libvirtd server pushes data out to clients. It does not know what protocol version the client might have, so must be conservative and use the old payload limits. ie send no more than 256kb of data per packet.
And backported to stable branches.
I tried libvirt 1.1.3 containing the commit on the server and Ubuntu libvirt 0.9.8 as the client and still have the issue if the message is greater than 256KB. The problem is that the old client checks the message size during decode (which is greater than the client's max message size).
Not sure how to get out of this ...
What were you doing to get a message greater than 256KB ? This patch did not attempt to fix all possible combinations. If a API call such as virConnectListAllDomains has so much data that it requires > 256KB to encode, this fix won't solve that. There is nothing we can do for API calls which have a genuine need to exceed the old size limit.
I was only addressing the case of virStreamPtr data which was mistakenly hardcoded in the server to try sending 16 MB of data at once. I switched it to only try to send 256 KB of data per stream packet.
I've also tested your patch, and it seems 256 KB of data is still a bit too large:
virsh # screenshot 2 /tmp/test error: could not receive data from domain 2 error: packet 262168 bytes received from server too large, want 262144
The max payload size is computed as:
VIR_NET_MESSAGE_MAX = 16777216 VIR_NET_MESSAGE_HEADER_MAX = 24 VIR_NET_MESSAGE_PAYLOAD_MAX = (VIR_NET_MESSAGE_MAX - VIR_NET_MESSAGE_HEADER_MAX) = 16777192
So, it seems the legacy max payload size is actually 262120; I tested it and it works.
------------------- 8< ------ >8 --------------------------- Subject: [PATCH] Adjust legacy max payload size to account for header information Organization: AV-Test GmbH, Germany
Commit 27e81517a87 set the payload size to 256 KB, which is actually the max packet size, including the size of the header.
Reduce this by VIR_NET_MESSAGE_HEADER_MAX (24) and set VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX to 262120.
Signed-off-by: Claudio Bley <cbley@av-test.de> --- src/rpc/virnetprotocol.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x index 1eae7cb..7b6f753 100644 --- a/src/rpc/virnetprotocol.x +++ b/src/rpc/virnetprotocol.x @@ -55,7 +55,7 @@ const VIR_NET_MESSAGE_INITIAL = 65536; * payload size. We need to remember this for compat with * old clients. */ -const VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX = 262144; +const VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX = 262120;
/* Maximum total message size (serialised). */ const VIR_NET_MESSAGE_MAX = 16777216;
Damn, yes, you are correct. The original value was 262120, I copied the wrong value. THe commit which changed it first was commit eb635de1fed3257c5c62b552d1ec981c9545c1d7 Author: Michal Privoznik <mprivozn@redhat.com> Date: Fri Apr 27 14:49:48 2012 +0200 rpc: Size up RPC limits /* Size of message payload */ -const VIR_NET_MESSAGE_PAYLOAD_MAX = 262120; +const VIR_NET_MESSAGE_PAYLOAD_MAX = 4194280; Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|