Possible Bug in Libvirt::StorageVol in ruby-libvirt?

dateirunner dateirunner at gmail.com
Mon Mar 27 20:26:24 UTC 2023


Dear Support Team
I want to kindly ask for help

I am running almalinux with the packages
libvirt
libvirt-devel
I installed the gem 'libvirt-ruby'

When running the following script the execution breaks with:
./libvirt-test.rb:25:in `name': Expected Connection object (ArgumentError)
from ./libvirt-test.rb:25:in `<main>'

#!/usr/bin/env ruby
require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'ruby-libvirt'
end

require 'libvirt'

#Starts connection #works
conn = Libvirt::open()

# Lists all pools #works
pools = conn.list_all_storage_pools

# Saves all volumes of all pools #
volumes = pools.map {|p| p.list_all_volumes}.flatten

# Gets first volume
first_volume = volumes.first
puts volumes.first

#Breaks Should return the name of the volume as string
first_volume.name

#Breaks Should return the path of the volume as string
first_volume.path

--------------
Can someone confirm this issue?
Is there a possible fix or did I misread the documentation?
Thank you for your help

Regards
R. Koch



More information about the libvir-list mailing list