ovn-nbd: Calculate 'up' state for logical ports.
authorRussell Bryant <rbryant@redhat.com>
Thu, 2 Apr 2015 00:04:21 +0000 (20:04 -0400)
committerBen Pfaff <blp@nicira.com>
Thu, 2 Apr 2015 15:17:28 +0000 (08:17 -0700)
commitf93818dd393e6574671f3c9e869c5cbeada91ecc
tree291c6a834603e28ef934c904770ec6635cab71b7
parent67d9b93028e1503f5b399aa23a7b965ab1740d43
ovn-nbd: Calculate 'up' state for logical ports.

When the state of the chassis column in the Bindings table changes for
any row, ovn-nbd will notice and trigger recalculating the 'up' state
for all logical ports.

This can be tested manually by starting up ovs-sandbox with ovn support
enabled, running ovn-nbd, and then running the following commands:

  ovn-nbctl lswitch-add sw0
  ovn-nbctl lport-add sw0-port0 sw0
  port_uuid=$(ovn-nbctl lport-list sw0 | awk '{print $1}')
  ovsdb-client transact "[\"OVN\",\
    {\"uuid-name\":\"rowd4eca046_9233_4094_bc55_e28dd49217f9\",\
    \"row\":{\"logical_port\":\"$port_uuid\",\"chassis\":\"hostname\"},\
    \"op\":\"insert\",\"table\":\"Bindings\"}]"

ovn-nbd will then see that the 'chassis' column is set in the Bindings
row for the logical port and will mark the logical port as 'up' in the
northbound db.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovn/ovn-nbd.c