On Thu, Apr 14, 2022 at 04:40:25PM +0100, Richard W.M. Jones wrote:
+ (* For IDE disks, IDE CD-ROMs, SCSI disks, SCSI CD-ROMs, and floppies, we + * need host-bus adapters (HBAs) between these devices and the PCI(e) root + * bus. Some machine types create these HBAs automatically (despite + * "-no-user-config -nodefaults"), some don't... + *) + let parent_ctrl_needed target_bus dev_filter = + try ignore (List.find dev_filter (Array.to_list target_bus)); true + with Not_found -> false
You can Array.exists here, but it might also be worth converting ^ use everything to a list earlier on in the file, eg:
let target_virtio_blk_bus = Array.to_list target_buses.target_virtio_blk_bus and target_ide_bus = Array.to_list target_buses.target_ide_bus [etc]
and then using List.exists here and List.iter{,i} below. [warning telling people to file a bug]
So it's good that it's a warning (dropping a floppy or CD-ROM when converting is not a reason to fail), however it could be a bit more actionable. I would include a reference to the manual, "BUGS" section in virt-v2v(1).
Actually I'm having second thoughts about encouraging people to file a bug at all. If lots of people see this message and file bugs, is that something we actually would need to fix? If yes then OK, otherwise we'll just get more bugs on the backlog. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v