Skip to content

Commit

Permalink
qemu: Propagate errors from disk attachment
Browse files Browse the repository at this point in the history
I passed `--qemu-image /path/to/nofile.qcow2` and got a confusing
error because we weren't propagating errors here.  One of those
things that I miss from Rust where the compiler knows to
warn about unused results.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Apr 29, 2020
1 parent 16f1c55 commit e89b75d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ func (disk *Disk) prepare(builder *QemuBuilder) error {
}

func (builder *QemuBuilder) addDiskImpl(disk *Disk, primary bool) error {
disk.prepare(builder)
if err := disk.prepare(builder); err != nil {
return err
}
if primary {
// If the board doesn't support -fw_cfg or we were explicitly
// requested, inject via libguestfs on the primary disk.
Expand Down

0 comments on commit e89b75d

Please sign in to comment.