Friday, July 29, 2011

Release of ruby-libvirt 0.4.0

I'm pleased to announce the release of ruby-libvirt 0.4.0. ruby-libvirt is a ruby wrapper around the libvirt API. Version 0.4.0 brings new APIs, more documentation, and bugfixes:

  • Updated Domain class, implementing dom.memory_parameters=,
    dom.memory_parameters, dom.updated?, dom.migrate2,
    dom.migrate_to_uri2, dom.migrate_set_max_speed,
    dom.qemu_monitor_command, dom.blkio_parameters,
    dom.blkio_parameters=, dom.state, dom.open_console, dom.screenshot,
    and dom.inject_nmi

  • Implementation of the Stream class, which covers the
    libvirt virStream APIs

  • Add the ability to build against non-system libvirt libraries

  • Updated Error object, which now includes the libvirt
    code, component and level of the error, as well as all of
    the error constants from libvirt.h

  • Updated Connect class, implementing conn.sys_info, conn.stream,
    conn.interface_change_begin, conn.interface_change_commit, and
    conn.interface_change_rollback

  • Updated StorageVol class, implementing vol.download and vol.upload

  • Various bugfixes


Version 0.4.0 is available from http://libvirt.org/ruby:

Tarball: http://libvirt.org/ruby/download/ruby-libvirt-0.4.0.tgz
Gem: http://libvirt.org/ruby/download/ruby-libvirt-0.4.0.gem

It is also available from rubygems.org; to get the latest version, run:

$ gem install ruby-libvirt

As usual, if you run into questions, problems, or bugs, please feel free to
mail me (clalance@redhat.com) and/or the libvirt mailing list.

6 comments:

  1. Are you planning to introduce new features to the Libvirt 0.9.10 and upper to the Ruby library?

    ReplyDelete
  2. I don't have immediate plans to implement anything new in ruby-libvirt. However, I would definitely welcome help in adding them. The best thing to do would be to implement and test the new functions that you are interested in, then send them to me with a CC to libvirt-list@redhat.com. I'll then review them and merge them as appropriate. Thanks in advance for the help!

    ReplyDelete
  3. Is there a function to get all domains, regardless of whether they're active or inactive? As far as I see, there's only list_domains, which gives the active domains, and list_defined_domains which gives the inactive. The C-Library has a function named virConnectListAllDomains(), which apparently returns all domains. I also don't understand why list_domains() gives an array containing domain ids, while list_defined_domains returns an array containing the the names of the domains.

    Thanks in advance

    ReplyDelete
    Replies
    1. I believe that the virConnectListAllDomains() call was added to libvirt after I did this release, so there isn't currently support for it. Unfortunately I don't have a ton of time to work on ruby-libvirt these days, but if you were interested in implementing it I would be happy to take the patches.

      As for list_domains() vs. list_defined_domains(), the reason they are different is that libvirt returns that information differently. A call to virConnectListDomains() returns a list of numeric IDs corresponding to the running domains, and the ruby list_domains() is just a wrapper on top of that. Similarly, a call to virConnectListDefinedDomains() returns a list of names corresponding to the not-running domains, and the ruby list_defined_domains() is just a wrapper on top of that. A new implementation of virConnectListAllDomains() would help out here.

      Delete
    2. Thanks for your answer. Unfortunately, my C knowledge is really bad - the implementation of virConnectListAllDomains() would be rather difficult for me. At the moment I simply merge the results of list_domains and list_defined_domains in Ruby, which works fine for my purpose. However I saw that you wrote a really great series of writing Ruby extensions in C - maybe I'll take a look at those if I have some time. Thank you.

      Delete