igvm: move file load to complete callback

Add UserCreatableClass->complete callback function for igvm-cfg object.

Move file loading and parsing of the igvm file from the process function
to the new complete() callback function.  Keep the igvm file loaded
after processing, release it in finalize() instead, so we parse it only
once.

Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20260126123755.357378-4-kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann
2026-01-26 13:37:53 +01:00
parent 0a158a4148
commit 74d800a098
3 changed files with 27 additions and 5 deletions

View File

@@ -13,6 +13,8 @@
#include "qom/object.h"
#include "hw/core/resettable.h"
#include <igvm/igvm.h>
struct IgvmCfg {
ObjectClass parent_class;
@@ -22,7 +24,10 @@ struct IgvmCfg {
* format.
*/
char *filename;
IgvmHandle file;
ResettableState reset_state;
};
IgvmHandle qigvm_file_init(char *filename, Error **errp);
#endif