File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Original file line number Diff line number Diff line change @@ -202,6 +202,15 @@ void qemu_fflush(QEMUFile *f)
202
202
f -> iovcnt = 0 ;
203
203
}
204
204
205
+ void * qemu_file_get_internal_storage (QEMUFile * f , size_t * size )
206
+ {
207
+ if (f -> ops -> get_internal_storage ) {
208
+ return f -> ops -> get_internal_storage (f -> opaque , size );
209
+ }
210
+
211
+ return NULL ;
212
+ }
213
+
205
214
void ram_control_before_iterate (QEMUFile * f , uint64_t flags )
206
215
{
207
216
int ret = 0 ;
Original file line number Diff line number Diff line change @@ -99,13 +99,21 @@ typedef QEMUFile *(QEMURetPathFunc)(void *opaque);
99
99
*/
100
100
typedef int (QEMUFileShutdownFunc )(void * opaque , bool rd , bool wr );
101
101
102
+ /*
103
+ * Gets the internal storage buffer of the file object.
104
+ * Returns NULL if the command is not supported or there is
105
+ * no storage.
106
+ */
107
+ typedef void * (QEMUFileGetStorageFunc )(void * opaque , size_t * size );
108
+
102
109
typedef struct QEMUFileOps {
103
110
QEMUFileGetBufferFunc * get_buffer ;
104
111
QEMUFileCloseFunc * close ;
105
112
QEMUFileSetBlocking * set_blocking ;
106
113
QEMUFileWritevBufferFunc * writev_buffer ;
107
114
QEMURetPathFunc * get_return_path ;
108
115
QEMUFileShutdownFunc * shut_down ;
116
+ QEMUFileGetStorageFunc * get_internal_storage ;
109
117
} QEMUFileOps ;
110
118
111
119
typedef struct QEMUFileHooks {
@@ -156,6 +164,8 @@ QEMUFile *qemu_file_get_return_path(QEMUFile *f);
156
164
void qemu_fflush (QEMUFile * f );
157
165
void qemu_file_set_blocking (QEMUFile * f , bool block );
158
166
167
+ void * qemu_file_get_internal_storage (QEMUFile * f , size_t * size );
168
+
159
169
size_t qemu_get_counted_string (QEMUFile * f , char buf [256 ]);
160
170
161
171
void ram_control_before_iterate (QEMUFile * f , uint64_t flags );
You can’t perform that action at this time.
0 commit comments