During the multi-process rework, I changed the way disk sizes are
calculated, switching to storing bytes and not 512-byte blocks. The
size calculation from reading an iso did not receive the change in
scaling, resulting in the virtio scsi emulation to think iso's are
larger than reality.
This fixes booting the latest Ubuntu amd64 iso's as apparently
there's some program that tries to arbitrarily read the tail end
of the iso into memory.
ok mlarkin@
-/* $OpenBSD: virtio.c,v 1.109 2023/09/26 01:53:54 dv Exp $ */
+/* $OpenBSD: virtio.c,v 1.110 2023/11/03 11:16:43 dv Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
}
vioscsi->locked = 0;
vioscsi->lba = 0;
- vioscsi->n_blocks = vioscsi->sz >> 2; /* num of 2048 blocks in file */
+ vioscsi->n_blocks = vioscsi->sz / VIOSCSI_BLOCK_SIZE_CDROM;
vioscsi->max_xfer = VIOSCSI_BLOCK_SIZE_CDROM;
vioscsi->pci_id = id;
vioscsi->vm_id = vcp->vcp_id;