Пример #1
0
AggregatePort* AggregatePort::modify(std::shared_ptr<SwitchState>* state) {
  if (!isPublished()) {
    CHECK(!(*state)->isPublished());
    return this;
  }

  AggregatePortMap* aggPorts = (*state)->getAggregatePorts()->modify(state);
  auto newAggPort = clone();
  auto* ptr = newAggPort.get();
  aggPorts->updateAggregatePort(std::move(newAggPort));
  return ptr;
}
Пример #2
0
Vlan* Vlan::modify(std::shared_ptr<SwitchState>* state) {
  if (!isPublished()) {
    CHECK(!(*state)->isPublished());
    return this;
  }

  VlanMap* vlans = (*state)->getVlans()->modify(state);
  auto newVlan = clone();
  auto* ptr = newVlan.get();
  vlans->updateVlan(std::move(newVlan));
  return ptr;
}
Пример #3
0
AggregatePortMap* AggregatePortMap::modify(
    std::shared_ptr<SwitchState>* state) {
  if (!isPublished()) {
    CHECK(!(*state)->isPublished());
    return this;
  }

  SwitchState::modify(state);
  auto newAggPorts = clone();
  auto* ptr = newAggPorts.get();
  (*state)->resetAggregatePorts(std::move(newAggPorts));
  return ptr;
}
Пример #4
0
OSDictionary * AppleLVMVolume::getVolumeProperties(void)
{
    // make a copy
    assert(lvProps);
    OSDictionary * props = OSDictionary::withDictionary(lvProps, lvProps->getCount() + 2);
    if (!props) return NULL;
    
    // not from header
    OSString * status = NULL;
    if (isPublished()) {
	status = OSString::withCString(kAppleRAIDStatusOnline);
    } else {
	status = OSString::withCString(kAppleRAIDStatusOffline);
    }
    if (status) {
	props->setObject(kAppleLVMVolumeStatusKey, status);
	status->release();
    }

    props->setObject(kIOBSDNameKey, getDiskName());

    return props;
}