Arjun Roy
2009-Jul-21 15:15 UTC
[Ovirt-devel] [PATCH server] Fixed db-omatic so it doesn't segfault because of newer qmf api.
---
src/db-omatic/db_omatic.rb | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb
index 155ff5e..b5b7b81 100755
--- a/src/db-omatic/db_omatic.rb
+++ b/src/db-omatic/db_omatic.rb
@@ -270,10 +270,10 @@ class DbOmatic < Qpid::Qmf::Console
end
def object_props(broker, obj)
- target = obj.klass_key[0]
+ target = obj.schema.klass_key.package
return if target != "com.redhat.libvirt"
- type = obj.klass_key[1]
+ type = obj.schema.klass_key.klass_name
# I just sync this whole thing because there shouldn't be a lot of
contention here..
synchronize do
@@ -289,7 +289,7 @@ class DbOmatic < Qpid::Qmf::Console
values[:broker_bank] = obj.object_id.broker_bank
values[:agent_bank] = obj.object_id.agent_bank
values[:obj_key] = obj.object_id.to_s
- values[:class_type] = obj.klass_key[1]
+ values[:class_type] = type
values[:timed_out] = false
values[:synced] = false
@logger.info "New object type #{type}"
@@ -339,9 +339,9 @@ class DbOmatic < Qpid::Qmf::Console
end
def object_stats(broker, obj)
- target = obj.klass_key[0]
+ target = obj.schema.klass_key.package
return if target != "com.redhat.libvirt"
- type = obj.klass_key[1]
+ type = obj.schema.klass_key.klass_name
synchronize do
values = @cached_objects[obj.object_id.to_s]
@@ -351,7 +351,7 @@ class DbOmatic < Qpid::Qmf::Console
values[:broker_bank] = obj.object_id.broker_bank
values[:agent_bank] = obj.object_id.agent_bank
- values[:class_type] = obj.klass_key[1]
+ values[:class_type] = type
values[:timed_out] = false
values[:synced] = false
end
--
1.6.2.5
Mike McGrath
2009-Jul-21 18:13 UTC
[Ovirt-devel] [PATCH server] Fixed db-omatic so it doesn't segfault because of newer qmf api.
On Tue, 21 Jul 2009, Arjun Roy wrote:> --- > src/db-omatic/db_omatic.rb | 12 ++++++------ > 1 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb > index 155ff5e..b5b7b81 100755 > --- a/src/db-omatic/db_omatic.rb > +++ b/src/db-omatic/db_omatic.rb > @@ -270,10 +270,10 @@ class DbOmatic < Qpid::Qmf::Console > end > > def object_props(broker, obj) > - target = obj.klass_key[0] > + target = obj.schema.klass_key.package > return if target != "com.redhat.libvirt" > > - type = obj.klass_key[1] > + type = obj.schema.klass_key.klass_name > > # I just sync this whole thing because there shouldn't be a lot of contention here.. > synchronize do > @@ -289,7 +289,7 @@ class DbOmatic < Qpid::Qmf::Console > values[:broker_bank] = obj.object_id.broker_bank > values[:agent_bank] = obj.object_id.agent_bank > values[:obj_key] = obj.object_id.to_s > - values[:class_type] = obj.klass_key[1] > + values[:class_type] = type > values[:timed_out] = false > values[:synced] = false > @logger.info "New object type #{type}" > @@ -339,9 +339,9 @@ class DbOmatic < Qpid::Qmf::Console > end > > def object_stats(broker, obj) > - target = obj.klass_key[0] > + target = obj.schema.klass_key.package > return if target != "com.redhat.libvirt" > - type = obj.klass_key[1] > + type = obj.schema.klass_key.klass_name > > synchronize do > values = @cached_objects[obj.object_id.to_s] > @@ -351,7 +351,7 @@ class DbOmatic < Qpid::Qmf::Console > > values[:broker_bank] = obj.object_id.broker_bank > values[:agent_bank] = obj.object_id.agent_bank > - values[:class_type] = obj.klass_key[1] > + values[:class_type] = type > values[:timed_out] = false > values[:synced] = false > endI was seeing this issue as well, after applying the patch things seem to be working. ACK -Mike
Seemingly Similar Threads
- [PATCH server] Update daemons to use new QMF.
- [PATCH] Fix dbomatic state changes.
- [PATCH server] Add svc_vm_actions method to VmService.
- [PATCH server] Fixed db-omatic so it doesn't die due to an unhandled ActiveRecord::StaleObjectError exception.
- [PATCH server] Fixed db-omatic to update the host for a running vm when the object_props callback is fired.