Arthur Clement
2010-Aug-18 09:51 UTC
[Ovirt-devel] [PATCH] Don't show vlan interfaces in NIC host management
Signed-off-by: Arthur Clement <aclement at linagora.com> --- src/host-browser/host-register.rb | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/host-browser/host-register.rb b/src/host-browser/host-register.rb index 693a6f2..5ff6a90 100755 --- a/src/host-browser/host-register.rb +++ b/src/host-browser/host-register.rb @@ -393,13 +393,18 @@ class HostRegister < Qmf::ConsoleHandler # if we have a match, then update the database and remove # the received data to avoid creating a dupe later @logger.info "Searching for existing record for: #{detail.macaddr.upcase} in host #{host_qmf.hostname}" - if detail.macaddr.upcase == nic.mac + # if detail.interface ~ /eth.*\..*/ || detail.interface ~ /vnet.*/ + if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ + @logger.info "Don't manage #{detail.interface.inspect}" + else + if detail.macaddr.upcase == nic.mac @logger.info "Updating details for: #{detail.interface} [#{nic.mac}]}" nic.bandwidth = detail.bandwidth nic.interface_name = detail.interface nic.save! found = true nic_info.delete(detail) + end end end @@ -425,9 +430,12 @@ class HostRegister < Qmf::ConsoleHandler 'interface_name' => nic.interface, 'usage_type' => 1) - host_db.nics << detail - - @logger.info "Added NIC #{nic.interface} with MAC #{nic.macaddr} to host #{host_qmf.hostname}" + if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ + @logger.info "Don't Add #{detail.interface.inspect}" + else + host_db.nics << detail + @logger.info "Added NIC #{nic.interface} with MAC #{nic.macaddr} to host #{host_qmf.hostname}" + end end end -- 1.7.2.1
Arthur Clément
2010-Aug-18 09:53 UTC
[Ovirt-devel] [PATCH] Don't show vlan interfaces in NIC host management
This is the third patch for vlan support To add vlan : [PATCH] Add support for tagged VLAN 21/07/2010 [PATCH] Add vlan support in taskomatic Patch from Patrick Guiran <pguiran at linagora.com> 21/07/2010 and this one On mercredi 18 ao?t 2010 11:51:14 you wrote:> Signed-off-by: Arthur Clement <aclement at linagora.com> > --- > src/host-browser/host-register.rb | 16 ++++++++++++---- > 1 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/src/host-browser/host-register.rb > b/src/host-browser/host-register.rb index 693a6f2..5ff6a90 100755 > --- a/src/host-browser/host-register.rb > +++ b/src/host-browser/host-register.rb > @@ -393,13 +393,18 @@ class HostRegister < Qmf::ConsoleHandler > # if we have a match, then update the database and remove > # the received data to avoid creating a dupe later > @logger.info "Searching for existing record for: > #{detail.macaddr.upcase} in host #{host_qmf.hostname}" - if > detail.macaddr.upcase == nic.mac > + # if detail.interface ~ /eth.*\..*/ || detail.interface ~ /vnet.*/ > + if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~/vnet\d+/> + @logger.info "Don't manage #{detail.interface.inspect}" > + else > + if detail.macaddr.upcase == nic.mac > @logger.info "Updating details for: > #{detail.interface} [#{nic.mac}]}" nic.bandwidth = detail.bandwidth > nic.interface_name = detail.interface > nic.save! > found = true > nic_info.delete(detail) > + end > end > end > > @@ -425,9 +430,12 @@ class HostRegister < Qmf::ConsoleHandler > 'interface_name' => nic.interface, > 'usage_type' => 1) > > - host_db.nics << detail > - > - @logger.info "Added NIC #{nic.interface} with MAC > #{nic.macaddr} to host #{host_qmf.hostname}" + if detail.interface =~ > /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ + > @logger.info "Don't Add #{detail.interface.inspect}" + else > + host_db.nics << detail > + @logger.info "Added NIC #{nic.interface} with MAC > #{nic.macaddr} to host #{host_qmf.hostname}" + end > end > end-- Arthur CLEMENT Linagora Paris
Arthur Clément
2010-Aug-18 13:39 UTC
[Ovirt-devel] [PATCH] Don't show vlan interfaces in NIC host management
pushed On mercredi 18 ao?t 2010 11:51:14 Arthur Clement wrote:> Signed-off-by: Arthur Clement <aclement at linagora.com> > --- > src/host-browser/host-register.rb | 16 ++++++++++++---- > 1 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/src/host-browser/host-register.rb > b/src/host-browser/host-register.rb index 693a6f2..5ff6a90 100755 > --- a/src/host-browser/host-register.rb > +++ b/src/host-browser/host-register.rb > @@ -393,13 +393,18 @@ class HostRegister < Qmf::ConsoleHandler > # if we have a match, then update the database and remove > # the received data to avoid creating a dupe later > @logger.info "Searching for existing record for: > #{detail.macaddr.upcase} in host #{host_qmf.hostname}" - if > detail.macaddr.upcase == nic.mac > + # if detail.interface ~ /eth.*\..*/ || detail.interface ~ /vnet.*/ > + if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~/vnet\d+/> + @logger.info "Don't manage #{detail.interface.inspect}" > + else > + if detail.macaddr.upcase == nic.mac > @logger.info "Updating details for: > #{detail.interface} [#{nic.mac}]}" nic.bandwidth = detail.bandwidth > nic.interface_name = detail.interface > nic.save! > found = true > nic_info.delete(detail) > + end > end > end > > @@ -425,9 +430,12 @@ class HostRegister < Qmf::ConsoleHandler > 'interface_name' => nic.interface, > 'usage_type' => 1) > > - host_db.nics << detail > - > - @logger.info "Added NIC #{nic.interface} with MAC > #{nic.macaddr} to host #{host_qmf.hostname}" + if detail.interface =~ > /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ + > @logger.info "Don't Add #{detail.interface.inspect}" + else > + host_db.nics << detail > + @logger.info "Added NIC #{nic.interface} with MAC > #{nic.macaddr} to host #{host_qmf.hostname}" + end > end > end-- Arthur CLEMENT Linagora Paris
Apparently Analagous Threads
- [PATCH] Fix bad declaration in host-register
- [PATCH server] Update daemons to use new QMF.
- Updating oVirt Server to the latest Matahari 0.4.0 schema
- [PATCH: server 0/3] Add host-register.rb (replaces host-browser.rb in part)
- permit many-to-many vms / networks relationship redux