feat(ha-config-bootstrap): implement --vcpus CLI, wire validation, remove vcpus from config (task 2.2)
- Add --vcpus N argp option in main.c; store in myconf.vcpus - Replace inline argp guard with validate_vcpus() call (returns -EINVAL for <=0) - Add validate_startup_config() in startup_validation.c: returns 0; writes deprecation warning into caller-supplied warn_buf when vcpus key present - Wire validate_startup_config() into myapp_run() after conffile resolved; emit WARN() if warn_buf non-empty (Req 4.4) - Remove vcpus field from cluster_config_t (clusterconfig.h) - Preserve capnp ordinal: vcpus @7 -> vcpusDeprecated @7: Void in controller.capnp - vtaskmgr_init uses only myconf->vcpus with hardcoded default 8 - Add stub C types in typemap.h for capnp schema extensions from task 1.1 - 96 tests pass
This commit is contained in:
parent
bfa41eb135
commit
3ab2e6e4bf
12 changed files with 225 additions and 8 deletions
|
|
@ -14,6 +14,10 @@
|
|||
#include "request.h"
|
||||
#include "utils.h"
|
||||
|
||||
/* forward declaration — implemented in startup_validation.c */
|
||||
int validate_startup_config(const char *config_path,
|
||||
char *warn_buf, size_t warn_len);
|
||||
|
||||
time_t last_print_time = 0;
|
||||
unsigned long npkts = 0;
|
||||
unsigned long npkts_old = 0;
|
||||
|
|
@ -70,6 +74,15 @@ int myapp_run(myconf_t* myconf)
|
|||
/* Role stays CTRL_STANDBY — already set by ha_init(). */
|
||||
}
|
||||
|
||||
/* Req 4.4: warn if config file contains deprecated 'vcpus' key */
|
||||
{
|
||||
char warn_buf[256] = {0};
|
||||
validate_startup_config(myconf->conffile, warn_buf, sizeof(warn_buf));
|
||||
if (warn_buf[0]) {
|
||||
WARN("startup: %s", warn_buf);
|
||||
}
|
||||
}
|
||||
|
||||
/* Phase 2: full init (requires cluster_config) */
|
||||
rc = cluster_init_phase2(&c);
|
||||
if (rc < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue