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

virtiofs: Don't check Filesystem support if it is nil #103

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

praveenkumar
Copy link
Member

Domain capabilities for older version of libvirt doesn't contain
filesystem entry. Using this PR we first check if there is filesystem
entry on capabilities then only check for supported driverTypes.

Our CI have older version of libvirt and it should fix following error

Error creating machine: Error in driver during machine creation: Panic in the driver: runtime error: invalid memory address or nil pointer dereference
goroutine 15 [running]:
runtime/debug.Stack()
	/usr/lib/golang/src/runtime/debug/stack.go:24 +0x65
github.com/code-ready/machine/libmachine/drivers/rpc.(*StandardStack).Stack(0xc000026000?)
	/go/src/github.com/code-ready/machine-driver-libvirt/vendor/github.com/code-ready/machine/libmachine/drivers/rpc/server_driver.go:20 +0x17
github.com/code-ready/machine/libmachine/drivers/rpc.trapPanic(0xc0002bb740)
	/go/src/github.com/code-ready/machine-driver-libvirt/vendor/github.com/code-ready/machine/libmachine/drivers/rpc/server_driver.go:72 +0x63
panic({0x886dc0, 0xe18ba0})
	/usr/lib/golang/src/runtime/panic.go:838 +0x207
github.com/code-ready/machine-driver-libvirt/pkg/libvirt.virtiofsSupported(0xc0000720c0?)
	/go/src/github.com/code-ready/machine-driver-libvirt/pkg/libvirt/domain.go:187 +0x1c5
github.com/code-ready/machine-driver-libvirt/pkg/libvirt.domainXML(0xc0000720c0, {0x903e89, 0x3})
	/go/src/github.com/code-ready/machine-driver-libvirt/pkg/libvirt/domain.go:123 +0x9ef
github.com/code-ready/machine-driver-libvirt/pkg/libvirt.(*Driver).Create(0xc0000720c0)
	/go/src/github.com/code-ready/machine-driver-libvirt/pkg/libvirt/libvirt.go:316 +0x95
github.com/code-ready/machine/libmachine/drivers/rpc.(*RPCServerDriver).Create(0x2?, 0xc000018b10?, 0x1?)
	/go/src/github.com/code-ready/machine-driver-libvirt/vendor/github.com/code-ready/machine/libmachine/drivers/rpc/server_driver.go:83 +0x67
reflect.Value.call({0xc0000801e0?, 0xc000010178?, 0x13?}, {0x9040ff, 0x4}, {0xc000068ef8, 0x3, 0x3?})
	/usr/lib/golang/src/reflect/value.go:556 +0x845
reflect.Value.Call({0xc0000801e0?, 0xc000010178?, 0x3?}, {0xc0000506f8, 0x3, 0x3})
	/usr/lib/golang/src/reflect/value.go:339 +0xbf
net/rpc.(*service).call(0xc00007e180, 0xc00008a1e0?, 0xc000050750?, 0xc0000181b0, 0xc000024b00, 0xc00008a1e0?, {0x857c00?, 0xe8e1c8?, 0x78e4c6?}, {0x857c00, ...}, ...)
	/usr/lib/golang/src/net/rpc/server.go:381 +0x226
created by net/rpc.(*Server).ServeCodec
	/usr/lib/golang/src/net/rpc/server.go:478 +0x3fe

pkg/libvirt/domain.go Outdated Show resolved Hide resolved
Domain capabilities for older version of libvirt doesn't contain
filesystem entry. Using this PR we first check if there is filesystem
entry on capabilities then only check for supported driverTypes.

Our CI have older version of libvirt and it should fix following error
```
Error creating machine: Error in driver during machine creation: Panic in the driver: runtime error: invalid memory address or nil pointer dereference
goroutine 15 [running]:
runtime/debug.Stack()
	/usr/lib/golang/src/runtime/debug/stack.go:24 +0x65
github.com/code-ready/machine/libmachine/drivers/rpc.(*StandardStack).Stack(0xc000026000?)
	/go/src/github.com/code-ready/machine-driver-libvirt/vendor/github.com/code-ready/machine/libmachine/drivers/rpc/server_driver.go:20 +0x17
github.com/code-ready/machine/libmachine/drivers/rpc.trapPanic(0xc0002bb740)
	/go/src/github.com/code-ready/machine-driver-libvirt/vendor/github.com/code-ready/machine/libmachine/drivers/rpc/server_driver.go:72 +0x63
panic({0x886dc0, 0xe18ba0})
	/usr/lib/golang/src/runtime/panic.go:838 +0x207
github.com/code-ready/machine-driver-libvirt/pkg/libvirt.virtiofsSupported(0xc0000720c0?)
	/go/src/github.com/code-ready/machine-driver-libvirt/pkg/libvirt/domain.go:187 +0x1c5
github.com/code-ready/machine-driver-libvirt/pkg/libvirt.domainXML(0xc0000720c0, {0x903e89, 0x3})
	/go/src/github.com/code-ready/machine-driver-libvirt/pkg/libvirt/domain.go:123 +0x9ef
github.com/code-ready/machine-driver-libvirt/pkg/libvirt.(*Driver).Create(0xc0000720c0)
	/go/src/github.com/code-ready/machine-driver-libvirt/pkg/libvirt/libvirt.go:316 +0x95
github.com/code-ready/machine/libmachine/drivers/rpc.(*RPCServerDriver).Create(0x2?, 0xc000018b10?, 0x1?)
	/go/src/github.com/code-ready/machine-driver-libvirt/vendor/github.com/code-ready/machine/libmachine/drivers/rpc/server_driver.go:83 +0x67
reflect.Value.call({0xc0000801e0?, 0xc000010178?, 0x13?}, {0x9040ff, 0x4}, {0xc000068ef8, 0x3, 0x3?})
	/usr/lib/golang/src/reflect/value.go:556 +0x845
reflect.Value.Call({0xc0000801e0?, 0xc000010178?, 0x3?}, {0xc0000506f8, 0x3, 0x3})
	/usr/lib/golang/src/reflect/value.go:339 +0xbf
net/rpc.(*service).call(0xc00007e180, 0xc00008a1e0?, 0xc000050750?, 0xc0000181b0, 0xc000024b00, 0xc00008a1e0?, {0x857c00?, 0xe8e1c8?, 0x78e4c6?}, {0x857c00, ...}, ...)
	/usr/lib/golang/src/net/rpc/server.go:381 +0x226
created by net/rpc.(*Server).ServeCodec
	/usr/lib/golang/src/net/rpc/server.go:478 +0x3fe
```
@anjannath
Copy link
Member

@anjannath anjannath merged commit f27d8c5 into crc-org:master Aug 3, 2022
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