Skip to content
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

check if conn is nil and return error in function virtiofsSupported #105

Merged
merged 2 commits into from
Oct 28, 2022

Conversation

anjannath
Copy link
Member

No description provided.

This reverts commit ce66284.

we can do a check for if conn is nil in the virtiofsSupported
function itself instead of moving it around to pass the  unit
test
if conn is nil we cannot check if virtiofs is supported
so return ErrorNotSupported
@cfergeau
Copy link

Is this still needed?

@anjannath
Copy link
Member Author

Is this still needed?

i'd say nice to have (no release needed just for this)

@@ -159,6 +159,10 @@ func domainXML(d *Driver, machineType string) (string, error) {
}

func virtiofsSupported(conn *libvirt.Connect) error {
if conn == nil {
return drivers.ErrNotSupported

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return ErrInvalidLibvirtConnection, or ErrInvalidArgs would be more accurate, but I don't think we have such error constants.

@anjannath anjannath merged commit 53a65ae into crc-org:master Oct 28, 2022
@anjannath anjannath deleted the unit-test-fix branch October 28, 2022 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants