]> git.ipfire.org Git - thirdparty/qemu.git/blame - hw/virtio/virtio-balloon.c
qapi: Empty out qapi-schema.json
[thirdparty/qemu.git] / hw / virtio / virtio-balloon.c
CommitLineData
bd322087 1/*
d4443cb6 2 * Virtio Balloon Device
bd322087
AL
3 *
4 * Copyright IBM, Corp. 2008
d4443cb6
AS
5 * Copyright (C) 2011 Red Hat, Inc.
6 * Copyright (C) 2011 Amit Shah <amit.shah@redhat.com>
bd322087
AL
7 *
8 * Authors:
9 * Anthony Liguori <aliguori@us.ibm.com>
10 *
11 * This work is licensed under the terms of the GNU GPL, version 2. See
12 * the COPYING file in the top-level directory.
13 *
14 */
15
9b8bfe21 16#include "qemu/osdep.h"
1de7afc9 17#include "qemu/iov.h"
7e6ccd9c 18#include "qemu/timer.h"
bd322087 19#include "qemu-common.h"
0d09e41a 20#include "hw/virtio/virtio.h"
2070aaeb 21#include "hw/mem/pc-dimm.h"
9c17d615 22#include "sysemu/balloon.h"
0d09e41a 23#include "hw/virtio/virtio-balloon.h"
9c17d615 24#include "sysemu/kvm.h"
022c62cb 25#include "exec/address-spaces.h"
e688df6b 26#include "qapi/error.h"
112ed241 27#include "qapi/qapi-events-misc.h"
7e6ccd9c 28#include "qapi/visitor.h"
6adfdc5a 29#include "trace.h"
2ab4b135 30#include "qemu/error-report.h"
bd322087 31
0d09e41a 32#include "hw/virtio/virtio-bus.h"
8609d2a8 33#include "hw/virtio/virtio-access.h"
1ab461b5 34
01310e2a
TH
35#define BALLOON_PAGE_SIZE (1 << VIRTIO_BALLOON_PFN_SHIFT)
36
bd322087
AL
37static void balloon_page(void *addr, int deflate)
38{
371ff5a3
DDAG
39 if (!qemu_balloon_is_inhibited() && (!kvm_enabled() ||
40 kvm_has_sync_mmu())) {
01310e2a 41 qemu_madvise(addr, BALLOON_PAGE_SIZE,
e78815a5 42 deflate ? QEMU_MADV_WILLNEED : QEMU_MADV_DONTNEED);
371ff5a3 43 }
bd322087
AL
44}
45
7e6ccd9c
LC
46static const char *balloon_stat_names[] = {
47 [VIRTIO_BALLOON_S_SWAP_IN] = "stat-swap-in",
48 [VIRTIO_BALLOON_S_SWAP_OUT] = "stat-swap-out",
49 [VIRTIO_BALLOON_S_MAJFLT] = "stat-major-faults",
50 [VIRTIO_BALLOON_S_MINFLT] = "stat-minor-faults",
51 [VIRTIO_BALLOON_S_MEMFREE] = "stat-free-memory",
52 [VIRTIO_BALLOON_S_MEMTOT] = "stat-total-memory",
a0d06486 53 [VIRTIO_BALLOON_S_AVAIL] = "stat-available-memory",
bf1e7140 54 [VIRTIO_BALLOON_S_CACHES] = "stat-disk-caches",
7e6ccd9c
LC
55 [VIRTIO_BALLOON_S_NR] = NULL
56};
57
625a5bef
AL
58/*
59 * reset_stats - Mark all items in the stats array as unset
60 *
52f35022
SW
61 * This function needs to be called at device initialization and before
62 * updating to a set of newly-generated stats. This will ensure that no
625a5bef
AL
63 * stale values stick around in case the guest reports a subset of the supported
64 * statistics.
65 */
66static inline void reset_stats(VirtIOBalloon *dev)
67{
68 int i;
69 for (i = 0; i < VIRTIO_BALLOON_S_NR; dev->stats[i++] = -1);
70}
71
7e6ccd9c
LC
72static bool balloon_stats_supported(const VirtIOBalloon *s)
73{
c96caced 74 VirtIODevice *vdev = VIRTIO_DEVICE(s);
95129d6f 75 return virtio_vdev_has_feature(vdev, VIRTIO_BALLOON_F_STATS_VQ);
7e6ccd9c
LC
76}
77
78static bool balloon_stats_enabled(const VirtIOBalloon *s)
79{
80 return s->stats_poll_interval > 0;
81}
82
83static void balloon_stats_destroy_timer(VirtIOBalloon *s)
84{
85 if (balloon_stats_enabled(s)) {
bc72ad67
AB
86 timer_del(s->stats_timer);
87 timer_free(s->stats_timer);
7e6ccd9c
LC
88 s->stats_timer = NULL;
89 s->stats_poll_interval = 0;
90 }
91}
92
1f9296b5 93static void balloon_stats_change_timer(VirtIOBalloon *s, int64_t secs)
7e6ccd9c 94{
bc72ad67 95 timer_mod(s->stats_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + secs * 1000);
7e6ccd9c
LC
96}
97
98static void balloon_stats_poll_cb(void *opaque)
99{
100 VirtIOBalloon *s = opaque;
c96caced 101 VirtIODevice *vdev = VIRTIO_DEVICE(s);
7e6ccd9c 102
4eae2a65 103 if (s->stats_vq_elem == NULL || !balloon_stats_supported(s)) {
7e6ccd9c
LC
104 /* re-schedule */
105 balloon_stats_change_timer(s, s->stats_poll_interval);
106 return;
107 }
108
51b19ebe 109 virtqueue_push(s->svq, s->stats_vq_elem, s->stats_vq_offset);
c96caced 110 virtio_notify(vdev, s->svq);
51b19ebe
PB
111 g_free(s->stats_vq_elem);
112 s->stats_vq_elem = NULL;
7e6ccd9c
LC
113}
114
d7bce999
EB
115static void balloon_stats_get_all(Object *obj, Visitor *v, const char *name,
116 void *opaque, Error **errp)
7e6ccd9c 117{
2ddb16a9 118 Error *err = NULL;
7e6ccd9c
LC
119 VirtIOBalloon *s = opaque;
120 int i;
121
337283df 122 visit_start_struct(v, name, NULL, 0, &err);
2ddb16a9
MA
123 if (err) {
124 goto out;
125 }
51e72bc1 126 visit_type_int(v, "last-update", &s->stats_last_update, &err);
297a3646
MA
127 if (err) {
128 goto out_end;
129 }
7e6ccd9c 130
337283df 131 visit_start_struct(v, "stats", NULL, 0, &err);
2ddb16a9
MA
132 if (err) {
133 goto out_end;
134 }
9dbb8fa7 135 for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) {
51e72bc1 136 visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], &err);
9dbb8fa7 137 if (err) {
15c2f669 138 goto out_nested;
9dbb8fa7 139 }
7e6ccd9c 140 }
15c2f669
EB
141 visit_check_struct(v, &err);
142out_nested:
1158bb2a 143 visit_end_struct(v, NULL);
2ddb16a9 144
15c2f669
EB
145 if (!err) {
146 visit_check_struct(v, &err);
147 }
2ddb16a9 148out_end:
1158bb2a 149 visit_end_struct(v, NULL);
2ddb16a9
MA
150out:
151 error_propagate(errp, err);
7e6ccd9c
LC
152}
153
4fa45492 154static void balloon_stats_get_poll_interval(Object *obj, Visitor *v,
d7bce999 155 const char *name, void *opaque,
7e6ccd9c
LC
156 Error **errp)
157{
158 VirtIOBalloon *s = opaque;
51e72bc1 159 visit_type_int(v, name, &s->stats_poll_interval, errp);
7e6ccd9c
LC
160}
161
4fa45492 162static void balloon_stats_set_poll_interval(Object *obj, Visitor *v,
d7bce999 163 const char *name, void *opaque,
7e6ccd9c
LC
164 Error **errp)
165{
166 VirtIOBalloon *s = opaque;
65cd9064 167 Error *local_err = NULL;
7e6ccd9c
LC
168 int64_t value;
169
51e72bc1 170 visit_type_int(v, name, &value, &local_err);
65cd9064
MA
171 if (local_err) {
172 error_propagate(errp, local_err);
7e6ccd9c
LC
173 return;
174 }
175
176 if (value < 0) {
177 error_setg(errp, "timer value must be greater than zero");
178 return;
179 }
180
22644cd2 181 if (value > UINT32_MAX) {
1f9296b5
LC
182 error_setg(errp, "timer value is too big");
183 return;
184 }
185
7e6ccd9c
LC
186 if (value == s->stats_poll_interval) {
187 return;
188 }
189
190 if (value == 0) {
191 /* timer=0 disables the timer */
192 balloon_stats_destroy_timer(s);
193 return;
194 }
195
196 if (balloon_stats_enabled(s)) {
197 /* timer interval change */
198 s->stats_poll_interval = value;
199 balloon_stats_change_timer(s, value);
200 return;
201 }
202
203 /* create a new timer */
204 g_assert(s->stats_timer == NULL);
bc72ad67 205 s->stats_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, balloon_stats_poll_cb, s);
7e6ccd9c
LC
206 s->stats_poll_interval = value;
207 balloon_stats_change_timer(s, 0);
208}
209
bd322087
AL
210static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq)
211{
c96caced 212 VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
51b19ebe 213 VirtQueueElement *elem;
b7c28c74 214 MemoryRegionSection section;
bd322087 215
51b19ebe 216 for (;;) {
bd322087
AL
217 size_t offset = 0;
218 uint32_t pfn;
51b19ebe
PB
219 elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
220 if (!elem) {
221 return;
222 }
bd322087 223
51b19ebe 224 while (iov_to_buf(elem->out_sg, elem->out_num, offset, &pfn, 4) == 4) {
c227f099
AL
225 ram_addr_t pa;
226 ram_addr_t addr;
8609d2a8 227 int p = virtio_ldl_p(vdev, &pfn);
bd322087 228
8609d2a8 229 pa = (ram_addr_t) p << VIRTIO_BALLOON_PFN_SHIFT;
bd322087
AL
230 offset += 4;
231
b7c28c74
AK
232 /* FIXME: remove get_system_memory(), but how? */
233 section = memory_region_find(get_system_memory(), pa, 1);
f2fd57db
DDAG
234 if (!int128_nz(section.size) ||
235 !memory_region_is_ram(section.mr) ||
236 memory_region_is_rom(section.mr) ||
237 memory_region_is_romd(section.mr)) {
238 trace_virtio_balloon_bad_addr(pa);
b86107ab 239 memory_region_unref(section.mr);
bd322087 240 continue;
f2fd57db 241 }
bd322087 242
6adfdc5a
HZ
243 trace_virtio_balloon_handle_output(memory_region_name(section.mr),
244 pa);
b7c28c74 245 /* Using memory_region_get_ram_ptr is bending the rules a bit, but
5c130f65 246 should be OK because we only want a single page. */
b7c28c74
AK
247 addr = section.offset_within_region;
248 balloon_page(memory_region_get_ram_ptr(section.mr) + addr,
249 !!(vq == s->dvq));
dfde4e6e 250 memory_region_unref(section.mr);
bd322087
AL
251 }
252
51b19ebe 253 virtqueue_push(vq, elem, offset);
bd322087 254 virtio_notify(vdev, vq);
51b19ebe 255 g_free(elem);
bd322087
AL
256 }
257}
258
625a5bef
AL
259static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq)
260{
c96caced 261 VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
51b19ebe 262 VirtQueueElement *elem;
625a5bef
AL
263 VirtIOBalloonStat stat;
264 size_t offset = 0;
7e6ccd9c 265 qemu_timeval tv;
625a5bef 266
4eae2a65 267 elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
51b19ebe 268 if (!elem) {
7e6ccd9c 269 goto out;
625a5bef
AL
270 }
271
4eae2a65
LP
272 if (s->stats_vq_elem != NULL) {
273 /* This should never happen if the driver follows the spec. */
274 virtqueue_push(vq, s->stats_vq_elem, 0);
275 virtio_notify(vdev, vq);
276 g_free(s->stats_vq_elem);
277 }
278
279 s->stats_vq_elem = elem;
280
625a5bef
AL
281 /* Initialize the stats to get rid of any stale values. This is only
282 * needed to handle the case where a guest supports fewer stats than it
283 * used to (ie. it has booted into an old kernel).
284 */
285 reset_stats(s);
286
dcf6f5e1 287 while (iov_to_buf(elem->out_sg, elem->out_num, offset, &stat, sizeof(stat))
fa6111f2 288 == sizeof(stat)) {
8609d2a8
RR
289 uint16_t tag = virtio_tswap16(vdev, stat.tag);
290 uint64_t val = virtio_tswap64(vdev, stat.val);
625a5bef
AL
291
292 offset += sizeof(stat);
293 if (tag < VIRTIO_BALLOON_S_NR)
294 s->stats[tag] = val;
295 }
296 s->stats_vq_offset = offset;
7e6ccd9c
LC
297
298 if (qemu_gettimeofday(&tv) < 0) {
2ab4b135 299 warn_report("%s: failed to get time of day", __func__);
7e6ccd9c
LC
300 goto out;
301 }
302
303 s->stats_last_update = tv.tv_sec;
304
305out:
306 if (balloon_stats_enabled(s)) {
307 balloon_stats_change_timer(s, s->stats_poll_interval);
308 }
625a5bef
AL
309}
310
bd322087
AL
311static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
312{
c96caced 313 VirtIOBalloon *dev = VIRTIO_BALLOON(vdev);
bd322087
AL
314 struct virtio_balloon_config config;
315
316 config.num_pages = cpu_to_le32(dev->num_pages);
317 config.actual = cpu_to_le32(dev->actual);
318
6adfdc5a 319 trace_virtio_balloon_get_config(config.num_pages, config.actual);
e6baf613 320 memcpy(config_data, &config, sizeof(struct virtio_balloon_config));
bd322087
AL
321}
322
2b75f848
VSO
323static int build_dimm_list(Object *obj, void *opaque)
324{
325 GSList **list = opaque;
326
327 if (object_dynamic_cast(obj, TYPE_PC_DIMM)) {
328 DeviceState *dev = DEVICE(obj);
329 if (dev->realized) { /* only realized DIMMs matter */
330 *list = g_slist_prepend(*list, dev);
331 }
332 }
333
334 object_child_foreach(obj, build_dimm_list, opaque);
335 return 0;
336}
337
39de9984
VSO
338static ram_addr_t get_current_ram_size(void)
339{
e8dc06d2 340 GSList *list = NULL, *item;
39de9984
VSO
341 ram_addr_t size = ram_size;
342
2b75f848 343 build_dimm_list(qdev_get_machine(), &list);
e8dc06d2
VSO
344 for (item = list; item; item = g_slist_next(item)) {
345 Object *obj = OBJECT(item->data);
2b75f848
VSO
346 if (!strcmp(object_get_typename(obj), TYPE_PC_DIMM)) {
347 size += object_property_get_int(obj, PC_DIMM_SIZE_PROP,
348 &error_abort);
349 }
39de9984 350 }
e8dc06d2 351 g_slist_free(list);
39de9984
VSO
352
353 return size;
354}
355
bd322087
AL
356static void virtio_balloon_set_config(VirtIODevice *vdev,
357 const uint8_t *config_data)
358{
c96caced 359 VirtIOBalloon *dev = VIRTIO_BALLOON(vdev);
bd322087 360 struct virtio_balloon_config config;
973603a8 361 uint32_t oldactual = dev->actual;
463756d0
HZ
362 ram_addr_t vm_ram_size = get_current_ram_size();
363
e6baf613 364 memcpy(&config, config_data, sizeof(struct virtio_balloon_config));
e54f1771 365 dev->actual = le32_to_cpu(config.actual);
973603a8 366 if (dev->actual != oldactual) {
463756d0 367 qapi_event_send_balloon_change(vm_ram_size -
aef9d311
WX
368 ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT),
369 &error_abort);
973603a8 370 }
6adfdc5a 371 trace_virtio_balloon_set_config(dev->actual, oldactual);
bd322087
AL
372}
373
9d5b731d
JW
374static uint64_t virtio_balloon_get_features(VirtIODevice *vdev, uint64_t f,
375 Error **errp)
bd322087 376{
e3816255
DL
377 VirtIOBalloon *dev = VIRTIO_BALLOON(vdev);
378 f |= dev->host_features;
40de55af 379 virtio_add_feature(&f, VIRTIO_BALLOON_F_STATS_VQ);
8172539d 380 return f;
bd322087
AL
381}
382
96637bcd 383static void virtio_balloon_stat(void *opaque, BalloonInfo *info)
dce911c7
AS
384{
385 VirtIOBalloon *dev = opaque;
463756d0
HZ
386 info->actual = get_current_ram_size() - ((uint64_t) dev->actual <<
387 VIRTIO_BALLOON_PFN_SHIFT);
dce911c7
AS
388}
389
30fb2ca6 390static void virtio_balloon_to_target(void *opaque, ram_addr_t target)
bd322087 391{
c96caced
FK
392 VirtIOBalloon *dev = VIRTIO_BALLOON(opaque);
393 VirtIODevice *vdev = VIRTIO_DEVICE(dev);
463756d0 394 ram_addr_t vm_ram_size = get_current_ram_size();
bd322087 395
463756d0
HZ
396 if (target > vm_ram_size) {
397 target = vm_ram_size;
dce911c7 398 }
bd322087 399 if (target) {
463756d0 400 dev->num_pages = (vm_ram_size - target) >> VIRTIO_BALLOON_PFN_SHIFT;
c96caced 401 virtio_notify_config(vdev);
bd322087 402 }
6adfdc5a 403 trace_virtio_balloon_to_target(target, dev->num_pages);
bd322087
AL
404}
405
019518a8 406static int virtio_balloon_post_load_device(void *opaque, int version_id)
9ea2511c 407{
019518a8 408 VirtIOBalloon *s = VIRTIO_BALLOON(opaque);
fecb48f7
PB
409
410 if (balloon_stats_enabled(s)) {
411 balloon_stats_change_timer(s, s->stats_poll_interval);
412 }
bd322087
AL
413 return 0;
414}
415
019518a8
DDAG
416static const VMStateDescription vmstate_virtio_balloon_device = {
417 .name = "virtio-balloon-device",
418 .version_id = 1,
419 .minimum_version_id = 1,
420 .post_load = virtio_balloon_post_load_device,
421 .fields = (VMStateField[]) {
422 VMSTATE_UINT32(num_pages, VirtIOBalloon),
423 VMSTATE_UINT32(actual, VirtIOBalloon),
424 VMSTATE_END_OF_LIST()
425 },
426};
427
74def47c 428static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
bd322087 429{
74def47c 430 VirtIODevice *vdev = VIRTIO_DEVICE(dev);
a546fb17 431 VirtIOBalloon *s = VIRTIO_BALLOON(dev);
f76f6655 432 int ret;
bd322087 433
e6baf613
LC
434 virtio_init(vdev, "virtio-balloon", VIRTIO_ID_BALLOON,
435 sizeof(struct virtio_balloon_config));
bd322087 436
f76f6655
AS
437 ret = qemu_add_balloon_handler(virtio_balloon_to_target,
438 virtio_balloon_stat, s);
5c7d0962 439
1ab461b5 440 if (ret < 0) {
46abb812 441 error_setg(errp, "Only one balloon device is supported");
a546fb17 442 virtio_cleanup(vdev);
74def47c 443 return;
1ab461b5 444 }
f76f6655 445
5c7d0962
FK
446 s->ivq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output);
447 s->dvq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output);
448 s->svq = virtio_add_queue(vdev, 128, virtio_balloon_receive_stats);
bd322087 449
38dbd48b 450 reset_stats(s);
1ab461b5
FK
451}
452
306ec6c3 453static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
1ab461b5 454{
306ec6c3
AF
455 VirtIODevice *vdev = VIRTIO_DEVICE(dev);
456 VirtIOBalloon *s = VIRTIO_BALLOON(dev);
1ab461b5
FK
457
458 balloon_stats_destroy_timer(s);
459 qemu_remove_balloon_handler(s);
6a1a8cc7 460 virtio_cleanup(vdev);
1ab461b5
FK
461}
462
4eae2a65
LP
463static void virtio_balloon_device_reset(VirtIODevice *vdev)
464{
465 VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
466
467 if (s->stats_vq_elem != NULL) {
27e57efe 468 virtqueue_unpop(s->svq, s->stats_vq_elem, 0);
4eae2a65
LP
469 g_free(s->stats_vq_elem);
470 s->stats_vq_elem = NULL;
471 }
472}
473
4a1e48be
LP
474static void virtio_balloon_set_status(VirtIODevice *vdev, uint8_t status)
475{
476 VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
477
478 if (!s->stats_vq_elem && vdev->vm_running &&
479 (status & VIRTIO_CONFIG_S_DRIVER_OK) && virtqueue_rewind(s->svq, 1)) {
480 /* poll stats queue for the element we have discarded when the VM
481 * was stopped */
482 virtio_balloon_receive_stats(vdev, s->svq);
483 }
484}
485
1190044e
SZ
486static void virtio_balloon_instance_init(Object *obj)
487{
488 VirtIOBalloon *s = VIRTIO_BALLOON(obj);
489
490 object_property_add(obj, "guest-stats", "guest statistics",
491 balloon_stats_get_all, NULL, NULL, s, NULL);
492
493 object_property_add(obj, "guest-stats-polling-interval", "int",
494 balloon_stats_get_poll_interval,
495 balloon_stats_set_poll_interval,
496 NULL, s, NULL);
497}
498
c5dc16b7
HP
499static const VMStateDescription vmstate_virtio_balloon = {
500 .name = "virtio-balloon",
501 .minimum_version_id = 1,
502 .version_id = 1,
503 .fields = (VMStateField[]) {
504 VMSTATE_VIRTIO_DEVICE,
505 VMSTATE_END_OF_LIST()
506 },
507};
7f1ca9b2 508
1ab461b5 509static Property virtio_balloon_properties[] = {
e3816255
DL
510 DEFINE_PROP_BIT("deflate-on-oom", VirtIOBalloon, host_features,
511 VIRTIO_BALLOON_F_DEFLATE_ON_OOM, false),
1ab461b5
FK
512 DEFINE_PROP_END_OF_LIST(),
513};
514
515static void virtio_balloon_class_init(ObjectClass *klass, void *data)
516{
517 DeviceClass *dc = DEVICE_CLASS(klass);
518 VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
74def47c 519
1ab461b5 520 dc->props = virtio_balloon_properties;
7f1ca9b2 521 dc->vmsd = &vmstate_virtio_balloon;
125ee0ed 522 set_bit(DEVICE_CATEGORY_MISC, dc->categories);
74def47c 523 vdc->realize = virtio_balloon_device_realize;
306ec6c3 524 vdc->unrealize = virtio_balloon_device_unrealize;
4eae2a65 525 vdc->reset = virtio_balloon_device_reset;
1ab461b5
FK
526 vdc->get_config = virtio_balloon_get_config;
527 vdc->set_config = virtio_balloon_set_config;
528 vdc->get_features = virtio_balloon_get_features;
4a1e48be 529 vdc->set_status = virtio_balloon_set_status;
019518a8 530 vdc->vmsd = &vmstate_virtio_balloon_device;
1ab461b5
FK
531}
532
533static const TypeInfo virtio_balloon_info = {
534 .name = TYPE_VIRTIO_BALLOON,
535 .parent = TYPE_VIRTIO_DEVICE,
536 .instance_size = sizeof(VirtIOBalloon),
1190044e 537 .instance_init = virtio_balloon_instance_init,
1ab461b5
FK
538 .class_init = virtio_balloon_class_init,
539};
540
541static void virtio_register_types(void)
542{
543 type_register_static(&virtio_balloon_info);
544}
545
546type_init(virtio_register_types)