Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

volume names are incorrectly reported in cia-cli volume list #644

Closed
kaccardi opened this issue Oct 6, 2016 · 2 comments
Closed

volume names are incorrectly reported in cia-cli volume list #644

kaccardi opened this issue Oct 6, 2016 · 2 comments

Comments

@kaccardi
Copy link
Contributor

kaccardi commented Oct 6, 2016

I noticed that the name of the volume seems to disappear in ciao-cli volume list after it has been detached.

@kaccardi
Copy link
Contributor Author

check the json the cli receives to determine if this is a cli problem or controller issue.

@markdryan markdryan changed the title volume names are deleted when updating volume state volume names are incorrectly reported in cia-cli volume list Oct 17, 2016
@markdryan
Copy link
Contributor

Actually, this is not related to detaching volumes. It seems to happen all the time. In the example below I've added two volumes to two separate instances, one of which was a container ( so the attach should have failed) and one was a Fedora VM. I did not specify a name when creating the first volume. I did when specifying the second. Here's the output of two back to back calls to ciao-cli volume list

# ciao-cli volume list
Volume #1
    Name             []
    Size             [1 GB]
    UUID             [f888ae99-b5ea-4274-b556-1eee3ddfd571]
    Status           [in-use]
    Description      []

Volume #2
    Name             [Container Test]
    Size             [1 GB]
    UUID             [c6ee5b28-97fd-438d-bf8e-6bbc0800ffac]
    Status           [attaching]
    Description      []

# ciao-cli volume list
Volume #1
    Name             []
    Size             [1 GB]
    UUID             [c6ee5b28-97fd-438d-bf8e-6bbc0800ffac]
    Status           [attaching]
    Description      []

Volume #2
    Name             []
    Size             [1 GB]
    UUID             [f888ae99-b5ea-4274-b556-1eee3ddfd571]
    Status           [in-use]
    Description      []

Note in the second call to ciao-cli volume list the name of the second volume is missing.

rbradford added a commit to rbradford/ciao that referenced this issue Oct 20, 2016
Various members of the Volume structure require a pointer. These were
being filled by taking the address of the member from the loop variable.
Unfortunately because this loop variable is reused for each iteration of
the loop all these pointers were ultimately the same resulting in
duplicated values in the volume details list.

The solution is to copy the value to a local variable and take the
address of that.

Fixes: ciao-project#644

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
rbradford added a commit to rbradford/ciao that referenced this issue Oct 21, 2016
Various members of the Volume structure require a pointer. These were
being filled by taking the address of the member from the loop variable.
Unfortunately because this loop variable is reused for each iteration of
the loop all these pointers were ultimately the same resulting in
duplicated values in the volume details list.

The solution is to loop through the slice by index and take pointers to
the underlying data.

Fixes: ciao-project#644

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants