nzr-virt: stay below hardcoded libvirt packet max

This commit is contained in:
snow flurry 2024-08-15 00:42:57 -07:00
parent 5040bc7b87
commit 24a0c1cc68

View file

@ -17,7 +17,8 @@ pub struct Volume {
impl Volume {
/// Upload a disk image from libvirt in a blocking task
async fn upload_img(from: impl Read + Send + 'static, to: Stream) -> Result<(), PoolError> {
let mut reader = BufReader::with_capacity(4294967296, from);
// 33554408 is current hardcoded VIR_NET_MESSAGE_PAYLOAD_MAX
let mut reader = BufReader::with_capacity(33554407, from);
tokio::task::spawn_blocking(move || {
loop {