}
static void dump_vmstate_vmss(FILE *out_file,
- const VMStateDescription **subsection,
+ const VMStateDescription *subsection,
int indent)
{
- if (*subsection != NULL) {
- dump_vmstate_vmsd(out_file, *subsection, indent, true);
+ if (subsection != NULL) {
+ dump_vmstate_vmsd(out_file, subsection, indent, true);
}
}
fprintf(out_file, "\n%*s]", indent, "");
}
if (vmsd->subsections != NULL) {
- const VMStateDescription **subsection = vmsd->subsections;
+ const VMStateDescription * const *subsection = vmsd->subsections;
bool first;
fprintf(out_file, ",\n%*s\"Subsections\": [\n", indent, "");
if (!first) {
fprintf(out_file, ",\n");
}
- dump_vmstate_vmss(out_file, subsection, indent + 2);
+ dump_vmstate_vmss(out_file, *subsection, indent + 2);
subsection++;
first = false;
}
static void vmstate_check(const VMStateDescription *vmsd)
{
const VMStateField *field = vmsd->fields;
- const VMStateDescription **subsection = vmsd->subsections;
+ const VMStateDescription * const *subsection = vmsd->subsections;
if (field) {
while (field->name) {
}
static const VMStateDescription *
-vmstate_get_subsection(const VMStateDescription **sub, char *idstr)
+vmstate_get_subsection(const VMStateDescription * const *sub,
+ const char *idstr)
{
- while (sub && *sub) {
- if (strcmp(idstr, (*sub)->name) == 0) {
- return *sub;
+ if (sub) {
+ for (const VMStateDescription *s = *sub; s ; s = *++sub) {
+ if (strcmp(idstr, s->name) == 0) {
+ return s;
+ }
}
- sub++;
}
return NULL;
}
static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,
void *opaque, JSONWriter *vmdesc)
{
- const VMStateDescription **sub = vmsd->subsections;
+ const VMStateDescription * const *sub = vmsd->subsections;
bool vmdesc_has_subsections = false;
int ret = 0;