regression: xen domU no longer supports "type=cdrom" vbd disk

2020-06-08 Thread Greg A. Woods
I use xl.cfg "disk" entries like the following to mount a virtual CDROM
in a Xen domU:

'format=raw, vdev=0x5, access=ro, devtype=cdrom, 
target=/images/NetBSD-9.0-amd64.iso'

However since upgrading my -current source tree I've been seeing:

xenbus0: ignoring device/vbd/4 type cdrom

As shown in this patch I had to comment out the core of the mentioned
change to be able to use an ISO image again as a virtual CDROM again:


--- xenbus_probe.c.~1.55.~  2020-05-30 17:32:39.672816814 -0700
+++ xenbus_probe.c  2020-06-08 14:13:45.025527521 -0700
@@ -443,6 +443,14 @@
kmem_free(xbusd, xbusd->xbusd_sz);
break;
}
+//revision 1.51
+//date: 2020-04-28 06:21:01 -0700;  author: bouyer;  state: Exp;  lines: +30 
-9;  commitid: 5XOy6F9zbgN8C96C;
+//Skip block device  with device-type "cdrom", as their emulation can't be
+//disabled; and the backend driver doesn't handle them either.
+//Fix hang when booting with 'ioemu:hdc:cdrom' type disks.
+//While there convert some printf to aprint_error()
+//
+#if 0 /* XXX breaks use of ISO files! */
if (strcmp(xa.xa_type, "vbd") == 0) {
char dtype[10];
if (xenbus_read(NULL, xbusd->xbusd_path,
@@ -461,6 +469,7 @@
continue;
}
}
+#endif
err = read_backend_details(xbusd);
if (err != 0) {
aprint_error_dev(xenbus_dev,


Now it works again:

xbd4 at xenbus0 id 4: Xen Virtual Block Device Interface
xbd4: using event channel 12
...
boot device: xbd4
root on xbd4a dumps on xbd4b
root file system type: cd9660

--
Greg A. Woods 

Kelowna, BC +1 250 762-7675   RoboHack 
Planix, Inc.  Avoncote Farms 


pgpyhCAjH0HNg.pgp
Description: OpenPGP Digital Signature


Re: regression: xen domU no longer supports "type=cdrom" vbd disk

2020-06-08 Thread Chavdar Ivanov
On Mon, 8 Jun 2020 at 22:26, Greg A. Woods  wrote:
>
> I use xl.cfg "disk" entries like the following to mount a virtual CDROM
> in a Xen domU:
>
> 'format=raw, vdev=0x5, access=ro, devtype=cdrom, 
> target=/images/NetBSD-9.0-amd64.iso'
>
> However since upgrading my -current source tree I've been seeing:
>
> xenbus0: ignoring device/vbd/4 type cdrom
>
> As shown in this patch I had to comment out the core of the mentioned
> change to be able to use an ISO image again as a virtual CDROM again:
>
>
> --- xenbus_probe.c.~1.55.~  2020-05-30 17:32:39.672816814 -0700
> +++ xenbus_probe.c  2020-06-08 14:13:45.025527521 -0700
> @@ -443,6 +443,14 @@
> kmem_free(xbusd, xbusd->xbusd_sz);
> break;
> }
> +//revision 1.51
> +//date: 2020-04-28 06:21:01 -0700;  author: bouyer;  state: Exp;  lines: +30 
> -9;  commitid: 5XOy6F9zbgN8C96C;
> +//Skip block device  with device-type "cdrom", as their emulation can't be
> +//disabled; and the backend driver doesn't handle them either.
> +//Fix hang when booting with 'ioemu:hdc:cdrom' type disks.
> +//While there convert some printf to aprint_error()
> +//
> +#if 0 /* XXX breaks use of ISO files! */
> if (strcmp(xa.xa_type, "vbd") == 0) {
> char dtype[10];
> if (xenbus_read(NULL, xbusd->xbusd_path,
> @@ -461,6 +469,7 @@
> continue;
> }
> }
> +#endif
> err = read_backend_details(xbusd);
> if (err != 0) {
> aprint_error_dev(xenbus_dev,
>
>
> Now it works again:
>
> xbd4 at xenbus0 id 4: Xen Virtual Block Device Interface
> xbd4: using event channel 12
> ...
> boot device: xbd4
> root on xbd4a dumps on xbd4b
> root file system type: cd9660

I believe this was necessary at least under XCP-NG in PVHVM mode with
platform:viridian set to false - before the change the CD-ROM had to
be unconfigured as the system was hanging. After the change this was
no longer necessary and the CD-ROM was available.

>
> --
> Greg A. Woods 
>
> Kelowna, BC +1 250 762-7675   RoboHack 
> Planix, Inc.  Avoncote Farms 



--



Re: regression: xen domU no longer supports "type=cdrom" vbd disk

2020-06-08 Thread Manuel Bouyer
On Mon, Jun 08, 2020 at 02:26:39PM -0700, Greg A. Woods wrote:
> I use xl.cfg "disk" entries like the following to mount a virtual CDROM
> in a Xen domU:
> 
> 'format=raw, vdev=0x5, access=ro, devtype=cdrom, 
> target=/images/NetBSD-9.0-amd64.iso'
> 
> However since upgrading my -current source tree I've been seeing:
> 
>   xenbus0: ignoring device/vbd/4 type cdrom
> 
> As shown in this patch I had to comment out the core of the mentioned
> change to be able to use an ISO image again as a virtual CDROM again:

Actually this change matches what other OSes do with 'devtype=cdrom',
we were an outsider here.

For PV or PVH domUs you can omit the devtype keyword, it's only
needed for HVM guests (if you want to boot from the cdrom image).

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


Re: regression: xen domU no longer supports "type=cdrom" vbd disk

2020-06-08 Thread Greg A. Woods
At Tue, 9 Jun 2020 00:00:17 +0200, Manuel Bouyer  wrote:
Subject: Re: regression:  xen domU no longer supports "type=cdrom" vbd disk
>
> On Mon, Jun 08, 2020 at 02:26:39PM -0700, Greg A. Woods wrote:
> > I use xl.cfg "disk" entries like the following to mount a virtual CDROM
> > in a Xen domU:
> >
> > 'format=raw, vdev=0x5, access=ro, devtype=cdrom, 
> > target=/images/NetBSD-9.0-amd64.iso'
> >
> > However since upgrading my -current source tree I've been seeing:
> >
> > xenbus0: ignoring device/vbd/4 type cdrom
> >
> > As shown in this patch I had to comment out the core of the mentioned
> > change to be able to use an ISO image again as a virtual CDROM again:
>
> Actually this change matches what other OSes do with 'devtype=cdrom',
> we were an outsider here.
>
> For PV or PVH domUs you can omit the devtype keyword, it's only
> needed for HVM guests (if you want to boot from the cdrom image).

Ah OK, I think I understand, thanks!

Perhaps this could be mentioned quite explicitly in in the CHANGES file
(though that's not the first place I though to look, unfortunately)

Maybe the xen/howto on the wiki could be more explicit about mapping a
"image.iso" file to a disk vdev (perhaps instead of the currently less
helpful suggestions about mapping an existing actual /dev/cd0a device).

(Of course the xen/howto could use a lot of help.)

(Not to mention but also some upstream Xen docs seem to need updating
too, e.g. the xl-disk-configuration(5) manual page (that we
unfortunately do not seem to install in the xentools package).  Lots of
guides mention using "devtype=cdrom" any time an "image.iso" is used.)

--
Greg A. Woods 

Kelowna, BC +1 250 762-7675   RoboHack 
Planix, Inc.  Avoncote Farms 


pgpa_VTJPzkrr.pgp
Description: OpenPGP Digital Signature