Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dlmgmtd/dlmgmt_db.c
          +++ new/usr/src/cmd/dlmgmtd/dlmgmt_db.c
↓ open down ↓ 547 lines elided ↑ open up ↑
 548  548          dlmgmt_db_req_t *req;
 549  549          int             err;
 550  550  
 551  551          /* It is either a persistent request or an active request, not both. */
 552  552          assert((flags == DLMGMT_PERSIST) || (flags == DLMGMT_ACTIVE));
 553  553  
 554  554          if ((req = dlmgmt_db_req_alloc(op, entryname, linkp->ll_linkid,
 555  555              linkp->ll_zoneid, flags, &err)) == NULL)
 556  556                  return (err);
 557  557  
 558      -        /* If transient op and onloan, use the global zone cache file. */
 559      -        if (flags == DLMGMT_ACTIVE && linkp->ll_onloan)
 560      -                req->ls_zoneid = GLOBAL_ZONEID;
 561      -
 562  558          /*
 563  559           * If the return error is EINPROGRESS, this request is handled
 564  560           * asynchronously; return success.
 565  561           */
 566  562          err = dlmgmt_process_db_req(req);
 567  563          if (err != EINPROGRESS)
 568  564                  free(req);
 569  565          else
 570  566                  err = 0;
 571  567          return (err);
↓ open down ↓ 148 lines elided ↑ open up ↑
 720  716          char                    *curr;
 721  717          char                    attr_name[MAXLINKATTRLEN];
 722  718          size_t                  attr_buf_len = 0;
 723  719          void                    *attr_buf = NULL;
 724  720          boolean_t               rename;
 725  721  
 726  722          curr = buf;
 727  723          len = strlen(buf);
 728  724          attr_name[0] = '\0';
 729  725          for (i = 0; i < len; i++) {
 730      -                rename = B_FALSE;
 731  726                  char            c = buf[i];
 732  727                  boolean_t       match = (c == '=' ||
 733  728                      (c == ',' && !found_type) || c == ';');
 734  729  
      730 +                rename = B_FALSE;
 735  731                  /*
 736  732                   * Move to the next character if there is no match and
 737  733                   * if we have not reached the last character.
 738  734                   */
 739  735                  if (!match && i != len - 1)
 740  736                          continue;
 741  737  
 742  738                  if (match) {
 743  739                          /*
 744  740                           * NUL-terminate the string pointed to by 'curr'.
↓ open down ↓ 747 lines elided ↑ open up ↑
1492 1488                           * loaded the persistent configuration.
1493 1489                           */
1494 1490                          if (err != ENOENT)
1495 1491                                  goto done;
1496 1492                          boot = B_TRUE;
1497 1493                  }
1498 1494          } else {
1499 1495                  boot = B_TRUE;
1500 1496          }
1501 1497  
1502      -        if (zone_file_exists(zoneroot, DLMGMT_PERSISTENT_DB_PATH)) {
1503      -                req->ls_flags = DLMGMT_PERSIST;
1504      -                err = dlmgmt_process_db_req(req);
1505      -                if (err != 0 && err != ENOENT)
1506      -                        goto done;
1507      -        }
     1498 +        req->ls_flags = DLMGMT_PERSIST;
     1499 +        err = dlmgmt_process_db_req(req);
     1500 +        if (err != 0 && err != ENOENT)
     1501 +                goto done;
1508 1502          err = 0;
1509 1503          if (rewrite_needed) {
1510 1504                  /*
1511 1505                   * First update links in memory, then dump the entire db to
1512 1506                   * disk.
1513 1507                   */
1514 1508                  dlmgmt_db_walk(zoneid, DATALINK_CLASS_ALL, dlmgmt_db_upgrade);
1515 1509                  req->ls_op = DLMGMT_DB_OP_WRITE;
1516 1510                  req->ls_linkid = DATALINK_ALL_LINKID;
1517 1511                  if ((err = dlmgmt_process_db_req(req)) != 0 &&
↓ open down ↓ 37 lines elided ↑ open up ↑
1555 1549                           * refer to the VNIC by the name/zoneid.
1556 1550                           */
1557 1551                          if (onloan) {
1558 1552                                  (void) dlmgmt_delete_db_entry(linkp,
1559 1553                                      DLMGMT_ACTIVE);
1560 1554                                  linkp->ll_tomb = B_TRUE;
1561 1555                          } else {
1562 1556                                  (void) dlmgmt_destroy_common(linkp,
1563 1557                                      DLMGMT_ACTIVE | DLMGMT_PERSIST);
1564 1558                          }
1565      -
1566 1559                  }
1567 1560                  linkp = next_linkp;
1568 1561          }
1569 1562  
1570 1563  again:
1571 1564          linkp = avl_first(&dlmgmt_name_avl);
1572 1565          while (linkp != NULL) {
1573 1566                  vnic_ioc_delete_t ioc;
1574 1567  
1575 1568                  next_linkp = AVL_NEXT(&dlmgmt_name_avl, linkp);
↓ open down ↓ 37 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX