-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
machine: Address some QEMU TODOs #21517
machine: Address some QEMU TODOs #21517
Conversation
7a8de0a
to
ae19d18
Compare
ae19d18
to
1b0accb
Compare
Cockpit tests failed for commit 1b0accbfeac56d0903fc5122f968fd0606a69936. @martinpitt, @jelly, @mvollmer please check. |
07d068e
to
0ff9659
Compare
27cf4ef
to
63a4a34
Compare
Ephemeral COPR build failed. @containers/packit-build please check. |
211bd32
to
8f19ef5
Compare
8f19ef5
to
0af19f1
Compare
0af19f1
to
2bdd0b0
Compare
34d58dc
to
53056fe
Compare
2bdd0b0
to
05da1d3
Compare
a2d054b
to
d445228
Compare
d445228
to
d516588
Compare
pkg/machine/vmconfigs/machine.go
Outdated
@@ -185,28 +185,32 @@ func (mc *MachineConfig) Remove(saveIgnition, saveImage bool) ([]string, func() | |||
} | |||
|
|||
mcRemove := func() error { | |||
if err := connection.RemoveConnections(mc.Name, mc.Name+"-root"); err != nil { | |||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we return right away here it will not delete the other things on error which is bad
This here should really use some of the multierror packages that we use and just store all errors and then as last step remove it, i.e. declare a errs []error
slice at the top then append all error there instead of returning. Then at the function end return errorhandling.JoinErrors(errs)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that existed, thanks Paul. Should be fixed as well.
d516588
to
67e3f3e
Compare
cmd/podman/machine/rm.go
Outdated
if err := providerRm(); err != nil { | ||
logrus.Errorf("failed to remove virtual machine from provider for %q", vmName) | ||
return fmt.Errorf("failed to remove virtual machine from provider for %q: %v", vmName, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the one open question is do we want to call genericRm() even when this failed? I am not yet familiar with the differences between both but my gut tells me yes. So I would recommend to collect/log the errors like done elsewhere.
@baude WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
providerRM
deals with provider specific files. So for QEMU we would remove the QMP Monitor pid file, for example. genericRM
is where we delete the ignition file, config file, and image. I'm fine with logging the error and then doing a hard error on genericRM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would report the error either way but do both. BTW Ignore ENOTEXIST errors on missing, (You can just logrus.Debug them.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VMFile.Delete()
ignores ENOTEXIST when reporting the error so all good on that front
67e3f3e
to
09f28e7
Compare
Ephemeral COPR build failed. @containers/packit-build please check. |
09f28e7
to
d69ab14
Compare
Changes LGTM |
d69ab14
to
ccac207
Compare
Changes the order in which the machine-specific files are removed in `Remove()`. Removes the system connections first, then removes the `configPath` last. `configPath` is removed last, because in the case of an error with any of the previous files, the removal can be attempted again since the machine still "exists". Made the errors in `Remove` hard errors instead of soft errors. Added the implementation for the QEMU-specific file removal. [NO NEW TESTS NEEDED] Signed-off-by: Jake Correnti <[email protected]>
We don't care about the provenance of the machine image, so this is no longer applicable to have when displaying info. Signed-off-by: Jake Correnti <[email protected]>
Fixes the "machine rm --save-ignition --save-image" test so that it no longer uses the `{{ .Image }}` format string. Fixes the "init should cleanup on failure" test so that it no longer uses the `{{ .Image }}` and `{{ .ConfigPath }}` format strings. Signed-off-by: Jake Correnti <[email protected]>
ccac207
to
d7f7f07
Compare
@TomSweeneyRedHat PTAL |
LGTM |
/lgtm |
I have no objection. |
Does this PR introduce a user-facing change?
Addresses the following TODOs that were found in the podman 5 machine refactor code:
InspectInfo
, so remove theImage
fieldproviderRm
failures should be a hard errorpodman machine list
if there was an error removing any prior files