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:
Rongsong Shen 2026-05-28 04:17:06 +00:00
parent bfa41eb135
commit 3ab2e6e4bf
12 changed files with 225 additions and 8 deletions

View file

@ -745,7 +745,12 @@ int cluster_init_phase2(cluster_t* c)
zarray_init(&(c->configs), 64, NULL /* FIXME */);
vtaskmgr_init(&(c->vtaskmgr), c->myconf->cluster_config->vcpus);
/* Req 4.3: use --vcpus CLI value; fall back to built-in default (8).
* The cluster config 'vcpus' field has been removed (Req 4.4 deprecation). */
{
int nvcpus = (c->myconf->vcpus > 0) ? c->myconf->vcpus : 8;
vtaskmgr_init(&(c->vtaskmgr), nvcpus);
}
delaymgr_init(&(c->delaymgr), 200 /* precision_ms */, run_delay_tasks);