Cannot get admin.vm.device.block.Attach to work

I’m trying to get one qube’s freshly mounted loop over to another qube.

I can do it from within dom0 of course with qvm-block attach, at the keyboard (or as a command in a script). basically qvm-block attach dest-vm src-vm:loopN

However, it’d be much cleaner if I could do it from one of the two qubes involved. So I am trying to invoke the admin.vm.device.block.Attach service. But it basically does nothing no matter what combination of parameters I try. (I have worked my way pass the policies…it does seem to be getting invoked.)

journalctl is complaining about a protocol issue.

OK, one of my command lines:

qrexec-client-vm dom0 admin.vm.device.block.Attach ./block-client dest-vm src-vm:loop1

This of course means I’m calling a client side script (block-client) that looks like this (if I don’t use the script, it will complain about a file missing–THAT took me over two hours to figure out):

#!/bin/sh echo $1 $2 exec cat >&$SAVED_FD_1 # print result here, not there.

(This, of course, is straight out of the documentation’s examples.)

So the complaint out of the journalctl is invariably some variation of:

Jul 02 20:20:13 dom0 qubesd[2957]: protocol error for call b'admin.vm.device.block.Attach'+b'' (b'src-vm' → b'dom0') with payload of 38 bytes

(where src-vm is where I am issuing the command from). Payload seems to be the size of the two command line arguments (these aren’t the real names, that’s why there’s a discrepancy in size).

It doesn’t matter whether I specify the pool or the dest-vm first. I’ve even tried making each of them the +parameter. And I’ve tried deliberately using a non-existent loop or vm. Still, it’s just a “protocol error.”

So I’m clearly pulling a bonehead error here, but I can’t find out anything about how to invoke the service directly.

I’d rather do that than create a different service on dom0 that simply makes the qvm-block call. But I’ll do that if I have to.[