Repository navigation
Conversation
| return nil, fmt.Errorf("can't retrieve volume %q: %v", volumeName, err) | ||
| } | ||
| defer volPool.Free() | ||
| //defer volume.Free() |
There was a problem hiding this comment.
Do we need to remove this and instead free the returned volumes in each of the calling sites?
|
/approve cancel |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@enxebre: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
|
||
| // Create domain | ||
| if err = libvirtutils.CreateDomain(name, ignKey, name, name, networkInterfaceName, networkInterfaceAddress, autostart, memory, vcpu, offset, client); err != nil { | ||
| if err = libvirtutils.CreateDomain(name, ignKey, pool, name, name, networkInterfaceName, networkInterfaceAddress, autostart, memory, vcpu, offset, client); err != nil { |
There was a problem hiding this comment.
Although you've added pool here, why do we pass name, twice?
There was a problem hiding this comment.
Although you've added
poolhere, why do we passname, twice?
We actually pass it three times ;). CreateDomain allows the domain, volume, and host names to be configured seperately, but we opt to use the same value for all three here.
| if err := setCoreOSIgnition(&domainDef, ignKey); err != nil { | ||
| ignVolume, err := getVolumeFromPool(ignKey, poolName, virConn) | ||
| if err != nil { | ||
| return fmt.Errorf("error getting ignition volume: %v", err) |
There was a problem hiding this comment.
Add which pool:
error getting ignition from pool %q ...
It will help any subsequent debugging if we know which pool (by name).
There was a problem hiding this comment.
Add which pool...
I'd rather handle that in getVolumeFromPool, where all callers can benefit. And at least one of the errors there already includes the pool name.
|
|
||
| // create the volume | ||
| pool, err := virConn.LookupStoragePoolByName(poolName) | ||
| defer pool.Free() |
There was a problem hiding this comment.
Can you actually call pool.Free() in the face of an error? Won't pool be nil in those cases?
| // Refresh the pool of the volume so that libvirt knows it is | ||
| // not longer in use. | ||
| waitForSuccess("error refreshing pool for volume", func() error { | ||
| return pool.Refresh(0) |
There was a problem hiding this comment.
How does this exit? Will it run forever if the pool fails to refresh successfully?
| return pool.Refresh(0) | ||
| }) | ||
| if err != nil { | ||
| return fmt.Errorf("can't find storage pool '%s'", poolName) |
There was a problem hiding this comment.
Use %q for quoting strings.
| // not longer in use. | ||
| volPool, err := volume.LookupPoolByVolume() | ||
| waitForSuccess("error refreshing pool for volume", func() error { | ||
| return pool.Refresh(0) |
There was a problem hiding this comment.
I'm new to Go/Installer so maybe I'm missing something but pool.Refresh call is blocking and since it does I/O, theoretically it can take a long time before returning. If the call returns an error, it's very unlikely to succeed if called again. So I'm not sure looking over it until it succeeds is the way to go here.
| return volume, nil | ||
| } | ||
|
|
||
| // DeleteVolume removes the volume identified by `key` from libvirt |
There was a problem hiding this comment.
Comment needs updating; key isn't listed as a parameter.
| } | ||
| // TODO: add locking support | ||
| //poolName, err := volPool.GetName() | ||
| //poolName, err := pool.GetName() |
| volumeName = name | ||
| diskVolume, err := getVolumeFromPool(volumeName, poolName, virConn) | ||
| if err != nil { | ||
| return fmt.Errorf("can't retrieve volume %s for pool %s: %v", volumeName, poolName, err) |
There was a problem hiding this comment.
If getVolumeFromPool becomes consistent about listing the volume and pool in its error messages, we can drop them here.
|
👍 I need this as had to move my default location due to limitations in the root partition |
|
@enxebre: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
+100 |
|
@enxebre ping, Any plan to update it with suggested changes and rebase with current master. |
|
hey @praveenkumar sorry for the delay, we still plan on doing this but libvirt development moves slow due to our priorities pipeline. Any contributions are always welcome :) |
|
@zeenix can you take a look to this PR and try to update? |
Sure. Thanks for pointing it out. |
|
I finally started looking into this. It's not a straight-forward rebase on current master but it's not too difficult either. |
|
People with access rights to do so, please close this in favour of #144 |
|
Closing per #45 (comment) |
Drop full paths in favour of pool and name based look up for volumes
See openshift/machine-api-operator#70