Module Name: src
Committed By: bouyer
Date: Fri Jul 21 11:21:56 UTC 2023
Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c
Log Message:
The disk size reported in the xenstore is always in XEN_BSIZE units,
not sector-size. Should fix the issue reported by Christian Kujau
on netbsd-users and port-xen.
To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/xen/xen/xbd_xenbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.131 src/sys/arch/xen/xen/xbd_xenbus.c:1.132
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.131 Sat Feb 25 00:35:15 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c Fri Jul 21 11:21:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xbd_xenbus.c,v 1.131 2023/02/25 00:35:15 riastradh Exp $ */
+/* $NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.131 2023/02/25 00:35:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $");
#include "opt_xen.h"
@@ -674,7 +674,7 @@ xbd_backend_changed(void *arg, XenbusSta
xbd_connect(sc);
sc->sc_shutdown = BLKIF_SHUTDOWN_RUN;
sc->sc_xbdsize =
- sc->sc_sectors * (uint64_t)sc->sc_secsize / DEV_BSIZE;
+ sc->sc_sectors * (uint64_t)XEN_BSIZE / DEV_BSIZE;
dg = &sc->sc_dksc.sc_dkdev.dk_geom;
memset(dg, 0, sizeof(*dg));