tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!) (Manuel Bouyer) writes:

>On Sun, Apr 11, 2021 at 01:28:46PM -0000, Michael van Elst wrote:
>> (Manuel Bouyer) writes:
>> >The size of the disk is indeed 790528 in the xenstore (and the dom0's
>> >kernel message) but I don't know where this comes from.
>> >The file is definitively 791121 sectors long:
>> vnd computes a fake geometry based on 1MB cylinders.

>Why does this trucates the total number of sectors of the vnd ?
>there's no reason to do so.

Seems to have been introduced with netbsd-7.

This should fix it (untested):

-       dg->dg_secperunit = (int64_t)vnd->sc_geom.vng_nsectors *
-           vnd->sc_geom.vng_ntracks * vnd->sc_geom.vng_ncylinders;
+       dg->dg_secperunit = vnd->sc_size / DEV_BSIZE;

Home | Main Index | Thread Index | Old Index