4 + optional_strlen(bd_info->mountpoint);
}
+ /* BMC MAC */
+ len += HWADDR_SIZE;
+
return len;
}
len += 4 + 4; /* ipmi_bootdev, ipmi_bootdev_persistent */
+ len += 4; /* allow_writes */
+
len += 4 + optional_strlen(config->lang);
return len;
pos += pb_protocol_serialise_string(pos, bd_info->mountpoint);
}
+ memcpy(pos, sysinfo->bmc_mac, HWADDR_SIZE);
+ pos += HWADDR_SIZE;
+
assert(pos <= buf + buf_len);
(void)buf_len;
*(uint32_t *)pos = config->ipmi_bootdev_persistent;
pos += 4;
+ *(uint32_t *)pos = config->allow_writes;
+ pos += 4;
+
pos += pb_protocol_serialise_string(pos, config->lang);
assert(pos <= buf + buf_len);
sysinfo->blockdevs[i] = bd_info;
}
- rc = 0;
+ for (i = 0; i < HWADDR_SIZE; i++) {
+ if (pos[i] != 0) {
+ sysinfo->bmc_mac = talloc_memdup(sysinfo, pos, HWADDR_SIZE);
+ break;
+ }
+ }
+
+ pos += HWADDR_SIZE;
+ len -= HWADDR_SIZE;
+
+ rc = 0;
out:
return rc;
}
goto out;
config->ipmi_bootdev_persistent = !!tmp;
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->allow_writes = !!tmp;
+
if (read_string(config, &pos, &len, &str))
goto out;