cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
289 stars 74 forks source link

disks: Don't take defaults from existing volumes when creating a new one #1617

Closed mvollmer closed 4 months ago

mvollmer commented 5 months ago

Specifically, don't declare the new device for a new volume to be a CDROM when the first volume in the selected pool happens to be a ISO.

mvollmer commented 5 months ago

This was hella confusing. I have a Alpine ISO in my default pool, which meant that each newly created volume in that pool would be added as a CDROM to the machine. I didn't get to use a virtio bus, and the image format was always raw, but it was still labelled as "disk" in the UI, not "cdrom". Very magic. I blame useEffect.

mvollmer commented 5 months ago

Yes, yes, a test would be nice... :-)

mvollmer commented 5 months ago

Yes, yes, a test would be nice... :-)

Added, and it found a bug. :-)

martinpitt commented 5 months ago

Rebased, to get a new run after re-dropping cloud-init from alpine. The previous run was way too red.

martinpitt commented 5 months ago

This breaks testAddDiskDirPool everywhere, I'm afraid

mvollmer commented 5 months ago

This breaks testAddDiskDirPool everywhere, I'm afraid

That was the switch to q35 by default... now cdroms can't be hotplugged anymore apparently (except on rhel-9???). I rearrange the tests a bit.