On Mar 28, 2008, at 10:48, David Lutterkort wrote:
* there were no tests for the two new methods. In general, try to add/expand the tests in tests/tc_connect.rb when you add to the bindings, though that is highly dependent on what the test driver supports. In this case though it was pretty easy. Thanks again for doing this, and I am looking forward to the virDomainPinVcpu patch.
Attached is a patch, implementing Domain.pin_vcpu method. I have tested it locally and it works. Here is my test code: require 'libvirt' conn = Libvirt::open("") dom = conn.lookup_domain_by_name("centos52") dom.pin_vcpu(0,[2,3])After running it, I can verify via virsh that it does pin CPUs correctly:
virsh > vcpuinfo centos52 VCPU: 0 CPU: 2 State: blocked CPU time: 40.8s CPU Affinity: --yy However, when I try this method from test/tc_connect.rb it fails: # rake test (in /home/lord/src/ruby-libvirt)Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/ rake_test_loader
Startedlibvir: error : this function is not supported by the hypervisor: virDomainPinVcpu
E.... Finished in 0.006319 seconds. 1) Error: test_domain(TestConnect): SystemCallError: unknown error - libvir call virDomainPinVcpu failed ./tests/tc_connect.rb:113:in `pin_vcpu' ./tests/tc_connect.rb:113:in `test_domain' 5 tests, 60 assertions, 0 failures, 1 errors rake aborted!Command failed with status (1): [/usr/bin/ruby -Ilib:ext/libvirt "/usr/ lib/...]
(See full trace by running task with --trace)I will appreciate if somebody could help me to figure out why it is happening.
I might need to implement couple more methods, so if there are any remarks on
my code, I will appreciate your feedback. Sincerely, Vadim
Description: Binary data
-- "La perfection est atteinte non quand il ne reste rien a ajouter, mais quand il ne reste rien a enlever." (Antoine de Saint-Exupery)
Description: S/MIME cryptographic signature