Add module infrastructure to QEMU
Subsystems (2)
cover Add module infrastructure to QEMU
This is the current state of a patch set to introduce a module infrastructure to QEMU. It depends on GCC constructors and GNU ld's --whole-archive.
The dependency on GNU ld's --whole-archive is a problem, but it can be addressed in a number of ways:
1) Avoid creating a shared archive and just use object files. I see no real downside to this except that we're just ignoring this problem.
2) Switch to using dynamic shared libraries. This has the benefit of reducing the QEMU install size. This is attractive except for the fact that creating dynamic shared libraries across multiple host architectures is a pain.
3) For platforms that don't use GNU ld (Solaris, AIX, ???), add platform specific equivalents. For instance, -z allextract should work for Solaris.
I'm leaning toward #3 as I think it's a reasonable compromise.
This patch series introduces a number of other concepts though beyond constructors. It decentralizes the block driver code and moves it to a separate subdirectory. It also introduces also decentralizes the Makefile for the block drivers.
Finally, it allows for a config file to be used during build time to selectively choose what block drivers are compiled in. This is done in a fashion similar to how the Linux kernel's build system works.
There are a number of reasons to allow this level of build customization. One reason is that it makes per-platform support more understandable. Instead of having #ifdefs all through the code, you have a central place to disable features for particular platforms.
It also has the advantage of allowing an individual to build a minimal version of QEMU to support a particular type of machine with a particular set of functionality. This is useful for embedded environments and for security sensitive environments.
I have additional patches that split up qemu-char.c and introduce a similar structure there but they are not quite ready yet.
PATCH 1/4 Add module infrastructure to QEMU
Makefile +1 -1
@@ -63,7 +63,7 @@ recurse-all: $(SUBDIR_RULES) ####################################################################### # BLOCK_OBJS is code used by both qemu system emulation and qemu-img -BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o +BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o module.o BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o BLOCK_OBJS+=block-qcow2.o block-parallels.o block-nbd.o
Makefile.target +11 -22
@@ -340,14 +340,13 @@ ifeq ($(TARGET_ARCH), m68k) OBJS+= m68k-sim.o m68k-semi.o endif -OBJS+= libqemu.a - # Note: this is a workaround. The real fix is to avoid compiling # cpu_signal_handler() in cpu-exec.c. signal.o: CFLAGS += $(HELPER_CFLAGS) -$(QEMU_PROG): $(OBJS) ../libqemu_user.a - $(LINK) +$(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a +$(QEMU_PROG): $(OBJS) ../libqemu_user.a libqemu.a + $(call LINK,$(OBJS)) ifeq ($(ARCH),alpha) # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of # the address space (31 bit so sign extending doesn't matter)
@@ -372,14 +371,13 @@ LIBS+=-lmx OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \ gdbstub.o gdbstub-xml.o -OBJS+= libqemu.a - # Note: this is a workaround. The real fix is to avoid compiling # cpu_signal_handler() in cpu-exec.c. signal.o: CFLAGS += $(HELPER_CFLAGS) -$(QEMU_PROG): $(OBJS) - $(LINK) +$(QEMU_PROG): ARLIBS=libqemu.a +$(QEMU_PROG): $(OBJS) libqemu.a + $(call LINK,$(OBJS)) endif #CONFIG_DARWIN_USER
@@ -473,14 +471,13 @@ OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \ gdbstub.o gdbstub-xml.o OBJS+= uaccess.o -OBJS+= libqemu.a - # Note: this is a workaround. The real fix is to avoid compiling # cpu_signal_handler() in cpu-exec.c. signal.o: CFLAGS += $(HELPER_CFLAGS) -$(QEMU_PROG): $(OBJS) ../libqemu_user.a - $(LINK) +$(QEMU_PROG): ARLIBS=libqemu.a ../libqemu_user.a +$(QEMU_PROG): $(OBJS) libqemu.a ../libqemu_user.a + $(call LINK,$(OBJS)) endif #CONFIG_BSD_USER
@@ -497,14 +494,6 @@ OBJS+=fw_cfg.o ifdef CONFIG_KVM OBJS+=kvm.o kvm-all.o endif -ifdef CONFIG_WIN32 -OBJS+=block-raw-win32.o -else -ifdef CONFIG_AIO -OBJS+=posix-aio-compat.o -endif -OBJS+=block-raw-posix.o -endif LIBS+=-lz ifdef CONFIG_ALSA
@@ -724,9 +713,9 @@ endif vl.o: qemu-options.h $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) - +$(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a - $(LINK) + $(call LINK,$(OBJS)) endif # !CONFIG_USER_ONLY
module.c new file +137 -0
137 lines not on this page · raw message
module.h new file +41 -0
41 lines not on this page · raw message
rules.mak +5 -2
@@ -8,10 +8,13 @@ %.o: %.m $(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") -LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)," LINK $(TARGET_DIR)$@") +WAS=-Wl,--whole-archive +WAE=-Wl,--no-whole-archive + +LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(1) $(LIBS) $(WAS) $(ARLIBS) $(WAE)," LINK $(TARGET_DIR)$@") %$(EXESUF): %.o - $(LINK) + $(call LINK,$^) %.a: $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")
Signature · 1 line
1.6.0.6
Quoted 19 lines
module.h new file +13
-0@@ -0,0 +1,41 @@ +/* +* QEMU Module Infrastructure +* +* Copyright IBM, Corp. 2009 +* +* Authors: +* Anthony Liguori <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +* +*/ +
module.h line 23
Quoted 10 lines
module.h new file +10
-0+#ifndef QEMU_MODULE_H +#define QEMU_MODULE_H + +#define module_init (function, priority) \ +static void __attribute__((constructor)) qemu_init_ ## function(void) { \ + register_module_init(function, priority); \ +} + +#define module_exit (function, priority) \ +static void __attribute__((constructor)) qemu_exit_ ## function(void) { \
constructor? ;-)
Best Regards,
J.
Quoted 23 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 23 lines
module.h new file +17
-0@@ -0,0 +1,41 @@ +/* +* QEMU Module Infrastructure +* +* Copyright IBM, Corp. 2009 +* +* Authors: +* Anthony Liguori <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +* +*/ + +#ifndef QEMU_MODULE_H +#define QEMU_MODULE_H + +#define module_init (function, priority) \
Quoted 9 lines
module.h line 23
Quoted 7 lines
module.h new file +6
-0+static void __attribute__((constructor)) qemu_init_ ## function(void) { \ +register_module_init (function, priority); \ +} + +#define module_exit (function, priority) \ +static void __attribute__((constructor)) qemu_exit_ ## function(void) { \constructor? ;-)
Yes, that's intentional. These functions just register functions, they don't actually call those functions. This allows us to explicitly invoke the constructors/destructors when we want to instead of relying on gcc doing it before and after main.
Signature · 3 lines
Regards, Anthony Liguori
module.h line 20
Quoted 7 lines
module.h new file +7
-0+#ifndef QEMU_MODULE_H +#define QEMU_MODULE_H + +#define module_init (function, priority) \ +static void __attribute__((constructor)) qemu_init_ ## function(void) { \ + register_module_init(function, priority); \ +}
why not use the constructor priority?
Best Regards,
J.
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
module.h line 20
Quoted 8 lines
module.h new file +7
-0+#ifndef QEMU_MODULE_H +#define QEMU_MODULE_H + +#define module_init (function, priority) \ +static void __attribute__((constructor)) qemu_init_ ## function(void) { \ + register_module_init(function, priority); \ +}why not use the constructor priority?
We're just using constructors to register our real constructors so priority wouldn't really help us in the gcc constructors.
Quoted 3 lines
Best Regards,
J.
Signature · 3 lines
Regards, Anthony Liguori
Quoted 5 lines · Anthony Liguori
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD
why not use the constructor priority?
We're just using constructors to register our real constructors so priority wouldn't really help us in the gcc constructors.
Hmm? Just call the real constructors in the order they are registered by the (prioritized) gcc constructors should do the trick, no?
cheers,
Gerd
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
why not use the constructor priority?
We're just using constructors to register our real constructors so priority wouldn't really help us in the gcc constructors.
Hmm? Just call the real constructors in the order they are registered by the (prioritized) gcc constructors should do the trick, no?
You're missing the point. The "priority" field is mis-named. It's actually defining different categories of init function that are invoked when the corresponding bit of qemu want them (e.g. registration of block backends v.s. registration of character backends).
Paul
Quoted 8 lines · Gerd Hoffmann
Quoted 5 lines · Anthony Liguori
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD
why not use the constructor priority?
We're just using constructors to register our real constructors so priority wouldn't really help us in the gcc constructors.
Hmm? Just call the real constructors in the order they are registered by the (prioritized) gcc constructors should do the trick, no?
You don't necessarily want to run all of the constructors at once. Eventually, it would be nice to be generic enough that we could do that but I think it would be a bit difficult today.
Quoted 3 lines
cheers,
Gerd
Signature · 3 lines
Regards, Anthony Liguori
A message that is not in the archive (sent off-list or not yet received): 9EE414CC7AEE4488A45A263DE5B82EFE@jupiter
Quoted 6 lines · Kazu
Hi,
I tried your patch on MinGW but there is a link error.
LINK i386-softmmu/qemu.exe
gcc.exe: osdep.o: No such file or directory
I've fixed the build issue.
Quoted 5 lines
make[1]: *** [qemu.exe] Error 1
make: *** [subdir-i386-softmmu] Error 2Regards,
kazu
Signature · 3 lines
Regards, Anthony Liguori
PATCH 2/4 Convert block infrastructure to use new module init functionality
In reply to Anthony Liguoriblock-bochs.c +10 -1
@@ -24,6 +24,7 @@*/ #include "qemu-common.h" #include "block_int.h" +#include "module.h" /**************************************************************/
@@ -241,7 +242,7 @@ static void bochs_close(BlockDriverState *bs)close (s->fd); } -BlockDriver bdrv_bochs = { +static BlockDriver bdrv_bochs = { .format_name ="bochs" , .instance_size =sizeof (BDRVBochsState), .bdrv_probe = bochs_probe,
@@ -249,3 +250,11 @@ BlockDriver bdrv_bochs = { .bdrv_read = bochs_read, .bdrv_close = bochs_close, }; + +static int bdrv_bochs_init (void ) +{ +bdrv_register (&bdrv_bochs); +return 0 ; +} + +block_init (bdrv_bochs_init);
block-cloop.c +10 -1
@@ -23,6 +23,7 @@*/ #include "qemu-common.h" #include "block_int.h" +#include "module.h" #include <zlib.h> typedef struct BDRVCloopState {
@@ -153,7 +154,7 @@ static void cloop_close(BlockDriverState *bs)inflateEnd (&s->zstream); } -BlockDriver bdrv_cloop = { +static BlockDriver bdrv_cloop = { .format_name ="cloop" , .instance_size =sizeof (BDRVCloopState), .bdrv_probe = cloop_probe,
@@ -161,3 +162,11 @@ BlockDriver bdrv_cloop = { .bdrv_read = cloop_read, .bdrv_close = cloop_close, }; + +static int bdrv_cloop_init (void ) +{ +bdrv_register (&bdrv_cloop); +return 0 ; +} + +block_init (bdrv_cloop_init);
block-cow.c +10 -1
@@ -24,6 +24,7 @@#ifndef _WIN32#include "qemu-common.h" #include "block_int.h" +#include "module.h" #include <sys/mman.h> /**************************************************************/
@@ -252,7 +253,7 @@ static void cow_flush(BlockDriverState *bs)fsync (s->fd); } -BlockDriver bdrv_cow = { +static BlockDriver bdrv_cow = { .format_name ="cow" , .instance_size =sizeof (BDRVCowState), .bdrv_probe = cow_probe,
@@ -264,4 +265,12 @@ BlockDriver bdrv_cow = { .bdrv_flush = cow_flush, .bdrv_is_allocated = cow_is_allocated, }; + +static int bdrv_cow_init (void ) +{ +bdrv_register (&bdrv_cow); +return 0 ; +} + +block_init (bdrv_cow_init);#endif
block-dmg.c +11 -2
@@ -24,6 +24,7 @@#include "qemu-common.h" #include "block_int.h" #include "bswap.h" +#include "module.h" #include <zlib.h> typedef struct BDRVDMGState {
@@ -92,7 +93,7 @@ static int dmg_open(BlockDriverState *bs, const char *filename, int flags) dmg_close:close (s->fd);/* open raw instead */ - bs->drv=&bdrv_raw; + bs->drv=bdrv_find_format ("raw" );return bs->drv->bdrv_open (bs, filename, flags); } info_begin=read_off (s->fd);
@@ -283,7 +284,7 @@ static void dmg_close(BlockDriverState *bs)inflateEnd (&s->zstream); } -BlockDriver bdrv_dmg = { +static BlockDriver bdrv_dmg = { .format_name ="dmg" , .instance_size =sizeof (BDRVDMGState), .bdrv_probe = dmg_probe,
@@ -291,3 +292,11 @@ BlockDriver bdrv_dmg = { .bdrv_read = dmg_read, .bdrv_close = dmg_close, }; + +static int bdrv_dmg_init (void ) +{ +bdrv_register (&bdrv_dmg); +return 0 ; +} + +block_init (bdrv_dmg_init);
block-nbd.c +10 -1
@@ -28,6 +28,7 @@#include "qemu-common.h" #include "nbd.h" +#include "module.h" #include <sys/types.h> #include <unistd.h>
@@ -176,7 +177,7 @@ static int64_t nbd_getlength(BlockDriverState *bs)return s->size; } -BlockDriver bdrv_nbd = { +static BlockDriver bdrv_nbd = { .format_name ="nbd" , .instance_size =sizeof (BDRVNBDState), .bdrv_open = nbd_open,
@@ -186,3 +187,11 @@ BlockDriver bdrv_nbd = { .bdrv_getlength = nbd_getlength, .protocol_name = "nbd", }; + +static int bdrv_nbd_init (void ) +{ +bdrv_register (&bdrv_nbd); +return 0 ; +} + +block_init (bdrv_nbd_init);
block-parallels.c +10 -1
@@ -25,6 +25,7 @@*/ #include "qemu-common.h" #include "block_int.h" +#include "module.h" /**************************************************************/
@@ -163,7 +164,7 @@ static void parallels_close(BlockDriverState *bs)close (s->fd); } -BlockDriver bdrv_parallels = { +static BlockDriver bdrv_parallels = { .format_name ="parallels" , .instance_size =sizeof (BDRVParallelsState), .bdrv_probe = parallels_probe,
@@ -171,3 +172,11 @@ BlockDriver bdrv_parallels = { .bdrv_read = parallels_read, .bdrv_close = parallels_close, }; + +static int bdrv_parallels_init (void ) +{ +bdrv_register (&bdrv_parallels); +return 0 ; +} + +block_init (bdrv_parallels_init);
block-qcow.c +10 -1
@@ -23,6 +23,7 @@*/ #include "qemu-common.h" #include "block_int.h" +#include "module.h" #include <zlib.h> #include "aes.h"
@@ -917,7 +918,7 @@ static int qcow_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)return 0 ; } -BlockDriver bdrv_qcow = { +static BlockDriver bdrv_qcow = { .format_name ="qcow" , .instance_size =sizeof (BDRVQcowState), .bdrv_probe = qcow_probe,
@@ -935,3 +936,11 @@ BlockDriver bdrv_qcow = { .bdrv_write_compressed = qcow_write_compressed, .bdrv_get_info = qcow_get_info, }; + +static int bdrv_qcow_init (void ) +{ +bdrv_register (&bdrv_qcow); +return 0 ; +} + +block_init (bdrv_qcow_init);
block-qcow2.c +10 -1
@@ -23,6 +23,7 @@*/ #include "qemu-common.h" #include "block_int.h" +#include "module.h" #include <zlib.h> #include "aes.h" #include <assert.h>
@@ -2892,7 +2893,7 @@ static int qcow_get_buffer(BlockDriverState *bs, uint8_t *buf,return ret; } -BlockDriver bdrv_qcow2 = { +static BlockDriver bdrv_qcow2 = { .format_name ="qcow2" , .instance_size =sizeof (BDRVQcowState), .bdrv_probe = qcow_probe,
@@ -2922,3 +2923,11 @@ BlockDriver bdrv_qcow2 = { .bdrv_create2 = qcow_create2, .bdrv_check = qcow_check, }; + +static int bdrv_qcow2_init (void ) +{ +bdrv_register (&bdrv_qcow2); +return 0 ; +} + +block_init (bdrv_qcow2_init);
block-raw-posix.c +12 -2
@@ -25,6 +25,7 @@#include "qemu-timer.h" #include "qemu-char.h" #include "block_int.h" +#include "module.h" #include <assert.h> #ifdef CONFIG_AIO #include "posix-aio-compat.h"
@@ -846,7 +847,7 @@ static void raw_flush(BlockDriverState *bs)fsync (s->fd); } -BlockDriver bdrv_raw = { +static BlockDriver bdrv_raw = { .format_name ="raw" , .instance_size =sizeof (BDRVRawState), .bdrv_probe =NULL ,/* no probe for protocols */
@@ -1398,7 +1399,7 @@ static int hdev_create(const char *filename, int64_t total_size, }#endif -BlockDriver bdrv_host_device = { +static BlockDriver bdrv_host_device = { .format_name ="host_device" , .instance_size =sizeof (BDRVRawState), .bdrv_open = hdev_open,
@@ -1428,3 +1429,12 @@ BlockDriver bdrv_host_device = { .bdrv_aio_ioctl = raw_aio_ioctl,#endif }; + +static int bdrv_raw_init (void ) +{ +bdrv_register (&bdrv_raw); +bdrv_register (&bdrv_host_device); +return 0 ; +} + +block_init (bdrv_raw_init);
block-raw-win32.c +11 -2
@@ -24,6 +24,7 @@#include "qemu-common.h" #include "qemu-timer.h" #include "block_int.h" +#include "module.h" #include <assert.h> #include <windows.h> #include <winioctl.h>
@@ -228,7 +229,7 @@ static int raw_create(const char *filename, int64_t total_size,return 0 ; } -BlockDriver bdrv_raw = { +static BlockDriver bdrv_raw = { .format_name ="raw" , .instance_size =sizeof (BDRVRawState), .bdrv_open = raw_open,
@@ -372,7 +373,7 @@ static int raw_set_locked(BlockDriverState *bs, int locked) }#endif -BlockDriver bdrv_host_device = { +static BlockDriver bdrv_host_device = { .format_name ="host_device" , .instance_size =sizeof (BDRVRawState), .bdrv_open = hdev_open,
@@ -383,3 +384,11 @@ BlockDriver bdrv_host_device = { .bdrv_write = raw_write, .bdrv_getlength = raw_getlength, }; + +static int bdrv_raw_init (void ) +{ +bdrv_register (&bdrv_raw); +bdrv_register (&bdrv_host_device); +} + +block_init (bdrv_raw_init);
block-vmdk.c +10 -1
@@ -25,6 +25,7 @@#include "qemu-common.h" #include "block_int.h" +#include "module.h" #define VMDK3_MAGIC (('C' << 24) | ('O' << 16) | ('W' << 8) | 'D')#define VMDK4_MAGIC (('K' << 24) | ('D' << 16) | ('M' << 8) | 'V')
@@ -811,7 +812,7 @@ static void vmdk_flush(BlockDriverState *bs)bdrv_flush (s->hd); } -BlockDriver bdrv_vmdk = { +static BlockDriver bdrv_vmdk = { .format_name ="vmdk" , .instance_size =sizeof (BDRVVmdkState), .bdrv_probe = vmdk_probe,
@@ -823,3 +824,11 @@ BlockDriver bdrv_vmdk = { .bdrv_flush = vmdk_flush, .bdrv_is_allocated = vmdk_is_allocated, }; + +static int bdrv_vmdk_init (void ) +{ +bdrv_register (&bdrv_vmdk); +return 0 ; +} + +block_init (bdrv_vmdk_init);
block-vpc.c +10 -1
@@ -24,6 +24,7 @@*/ #include "qemu-common.h" #include "block_int.h" +#include "module.h" /**************************************************************/
@@ -586,7 +587,7 @@ static void vpc_close(BlockDriverState *bs)bdrv_delete (s->hd); } -BlockDriver bdrv_vpc = { +static BlockDriver bdrv_vpc = { .format_name ="vpc" , .instance_size =sizeof (BDRVVPCState), .bdrv_probe = vpc_probe,
@@ -596,3 +597,11 @@ BlockDriver bdrv_vpc = { .bdrv_close = vpc_close, .bdrv_create = vpc_create, }; + +static int bdrv_vpc_init (void ) +{ +bdrv_register (&bdrv_vpc); +return 0 ; +} + +block_init (bdrv_vpc_init);
block-vvfat.c +11 -2
@@ -27,6 +27,7 @@#include <assert.h> #include "qemu-common.h" #include "block_int.h" +#include "module.h" #ifndef S_IWGRP #define S_IWGRP 0
@@ -2777,7 +2778,7 @@ static int enable_write_target(BDRVVVFATState *s) s->qcow_filename =qemu_malloc (1024 );get_tmp_filename (s->qcow_filename,1024 ); -if (bdrv_create (&bdrv_qcow, +if (bdrv_create (bdrv_find_format ("qcow" ), s->qcow_filename, s->sector_count,"fat:" ,0 ) <0 )return -1 ; s->qcow =bdrv_new ("" );
@@ -2807,7 +2808,7 @@ static void vvfat_close(BlockDriverState *bs)free (s->cluster_buffer); } -BlockDriver bdrv_vvfat = { +static BlockDriver bdrv_vvfat = { .format_name ="vvfat" , .instance_size =sizeof (BDRVVVFATState), .bdrv_open = vvfat_open,
@@ -2818,6 +2819,14 @@ BlockDriver bdrv_vvfat = { .protocol_name = "fat", }; +static int bdrv_vvfat_init (void ) +{ +bdrv_register (&bdrv_vvfat); +return 0 ; +} + +block_init (bdrv_vvfat_init); +#ifdef DEBUG static void checkpoint (void ) {assert (((mapping_t *)array_get (&(vvv->mapping),0 ))->end ==2 );
block.c +14 -24
@@ -30,6 +30,7 @@#include "qemu-common.h" #include "monitor.h" #include "block_int.h" +#include "module.h" #ifdef HOST_BSD #include <sys/types.h>
@@ -138,7 +139,7 @@ void path_combine(char *dest, int dest_size, } -static void bdrv_register (BlockDriver *bdrv) +void bdrv_register (BlockDriver *bdrv) {if (!bdrv->bdrv_aio_readv) {/* add AIO emulation layer */
@@ -259,11 +260,11 @@ static BlockDriver *find_protocol(const char *filename)#ifdef _WIN32if (is_windows_drive (filename) ||is_windows_drive_prefix (filename)) -return &bdrv_raw; +return bdrv_find_format ("raw" );#endif p =strchr (filename,':' );if (!p) -return &bdrv_raw; +return bdrv_find_format ("raw" ); len = p - filename;if (len >sizeof (protocol) -1 ) len =sizeof (protocol) -1 ;
@@ -289,23 +290,23 @@ static BlockDriver *find_image_format(const char *filename)/* detect host devices. By convention, /dev/cdrom[N] is always recognized as a host CDROM */ if (strstart (filename,"/dev/cdrom" ,NULL )) -return &bdrv_host_device; +return bdrv_find_format ("host_device" );#ifdef _WIN32if (is_windows_drive (filename)) -return &bdrv_host_device; +return bdrv_find_format ("host_device" );#else {struct stat st;if (stat (filename, &st) >=0 && (S_ISCHR (st.st_mode) ||S_ISBLK (st.st_mode))) { -return &bdrv_host_device; +return bdrv_find_format ("host_device" ); } }#endif drv =find_protocol (filename);/* no need to test disk image formats for vvfat */ -if (drv == &bdrv_vvfat) +if (strcmp (drv->format_name,"vvfat" ) ==0 )return drv; ret =bdrv_file_open (&bs, filename,BDRV_O_RDONLY );
@@ -396,14 +397,14 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,else realpath (filename, backing_filename); - ret =bdrv_create2 (&bdrv_qcow2, tmp_filename, + ret =bdrv_create2 (bdrv_find_format ("qcow2" ), tmp_filename, total_size, backing_filename, (drv ? drv->format_name :NULL ),0 );if (ret <0 ) {return ret; } filename = tmp_filename; - drv = &bdrv_qcow2; + drv =bdrv_find_format ("qcow2" ); bs->is_temporary =1 ; }
@@ -1494,21 +1495,10 @@ static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,void bdrv_init (void ) { -bdrv_register (&bdrv_raw); -bdrv_register (&bdrv_host_device); -#ifndef _WIN32 -bdrv_register (&bdrv_cow); -#endif -bdrv_register (&bdrv_qcow); -bdrv_register (&bdrv_vmdk); -bdrv_register (&bdrv_cloop); -bdrv_register (&bdrv_dmg); -bdrv_register (&bdrv_bochs); -bdrv_register (&bdrv_vpc); -bdrv_register (&bdrv_vvfat); -bdrv_register (&bdrv_qcow2); -bdrv_register (&bdrv_parallels); -bdrv_register (&bdrv_nbd); +if (module_call_init (MOD_PRI_BLOCK ) !=0 ) { +fprintf (stderr,"Failed to load one or more block drivers\n" ); +exit (1 ); + } } void aio_pool_init(AIOPool *pool, int aiocb_size,
block.h +2 -14
@@ -7,20 +7,6 @@/* block.c */ typedef struct BlockDriver BlockDriver ; -extern BlockDriver bdrv_raw; -extern BlockDriver bdrv_host_device; -extern BlockDriver bdrv_cow; -extern BlockDriver bdrv_qcow; -extern BlockDriver bdrv_vmdk; -extern BlockDriver bdrv_cloop; -extern BlockDriver bdrv_dmg; -extern BlockDriver bdrv_bochs; -extern BlockDriver bdrv_vpc; -extern BlockDriver bdrv_vvfat; -extern BlockDriver bdrv_qcow2; -extern BlockDriver bdrv_parallels; -extern BlockDriver bdrv_nbd; - typedef struct BlockDriverInfo { /* in bytes, 0 if irrelevant */ int cluster_size;
@@ -87,6 +73,8 @@ int64_t bdrv_getlength(BlockDriverState *bs);void bdrv_get_geometry (BlockDriverState *bs,uint64_t *nb_sectors_ptr);void bdrv_guess_geometry (BlockDriverState *bs,int *pcyls,int *pheads,int *psecs);int bdrv_commit (BlockDriverState *bs); +void bdrv_register (BlockDriver *bdrv); +/* async block I/O */ typedef struct BlockDriverAIOCB BlockDriverAIOCB ;typedef void BlockDriverCompletionFunc (void *opaque,int ret);
qemu-img.c +5 -5
@@ -543,11 +543,11 @@ static int img_convert(int argc, char **argv) drv =bdrv_find_format (out_fmt);if (!drv)error ("Unknown file format '%s'" , out_fmt); -if (flags &BLOCK_FLAG_COMPRESS && drv != &bdrv_qcow && drv != &bdrv_qcow2) +if (flags &BLOCK_FLAG_COMPRESS &&strcmp (drv->format_name,"qcow" ) &&strcmp (drv->format_name,"qcow2" ))error ("Compression not supported for this file format" ); -if (flags &BLOCK_FLAG_ENCRYPT && drv != &bdrv_qcow && drv != &bdrv_qcow2) +if (flags &BLOCK_FLAG_ENCRYPT &&strcmp (drv->format_name,"qcow" ) &&strcmp (drv->format_name,"qcow2" ))error ("Encryption not supported for this file format" ); -if (flags &BLOCK_FLAG_COMPAT6 && drv != &bdrv_vmdk) +if (flags &BLOCK_FLAG_COMPAT6 &&strcmp (drv->format_name,"vmdk" ))error ("Alternative compatibility level not supported for this file format" );if (flags &BLOCK_FLAG_ENCRYPT && flags &BLOCK_FLAG_COMPRESS )error ("Compression and encryption not supported at the same time" );
@@ -656,7 +656,7 @@ static int img_convert(int argc, char **argv)if (n > bs_offset + bs_sectors - sector_num) n = bs_offset + bs_sectors - sector_num; -if (drv != &bdrv_host_device) { +if (strcmp (drv->format_name,"host_device" )) {if (!bdrv_is_allocated (bs[bs_i], sector_num - bs_offset, n, &n1)) { sector_num += n1;
@@ -683,7 +683,7 @@ static int img_convert(int argc, char **argv)If the output is to a host device, we also write out sectors that are entirely 0, since whatever data was already there is garbage, not 0s. */ -if (drv == &bdrv_host_device || out_baseimg || +if (strcmp (drv->format_name,"host_device" ) ==0 || out_baseimg ||is_allocated_sectors (buf1, n, &n1)) {if (bdrv_write (out_bs, sector_num, buf1, n1) <0 )error ("error while writing" );
Signature · 1 line
1.6.0.6
PATCH 3/4 Move block drivers into their own directory
In reply to Anthony LiguoriMakefile +7 -7
@@ -64,18 +64,18 @@ recurse-all: $(SUBDIR_RULES) # BLOCK_OBJS is code used by both qemu system emulation and qemu-img BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o module.o -BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o -BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o -BLOCK_OBJS+=block-qcow2.o block-parallels.o block-nbd.o +BLOCK_OBJS+=block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o +BLOCK_OBJS+=block/dmg.o block/bochs.o block/vpc.o block/vvfat.o +BLOCK_OBJS+=block/qcow2.o block/parallels.o block/nbd.o BLOCK_OBJS+=nbd.o block.o aio.o ifdef CONFIG_WIN32 -BLOCK_OBJS += block-raw-win32.o +BLOCK_OBJS += block/raw-win32.o else ifdef CONFIG_AIO BLOCK_OBJS += posix-aio-compat.o endif -BLOCK_OBJS += block-raw-posix.o +BLOCK_OBJS += block/raw-posix.o endif ######################################################################
@@ -234,7 +234,7 @@ clean: # avoid old build problems by removing potentially incorrect old files rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~ - rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d + rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d $(MAKE) -C tests clean for d in $(TARGET_DIRS); do \ $(MAKE) -C $$d $@ || exit 1 ; \
@@ -408,4 +408,4 @@ tarbin: $(mandir)/man8/qemu-nbd.8 # Include automatically generated dependency files --include $(wildcard *.d audio/*.d slirp/*.d) +-include $(wildcard *.d audio/*.d slirp/*.d block/*.d)
block/bochs.c renamed from block-bochs.c +0 -0
block/cloop.c renamed from block-cloop.c +0 -0
block/cow.c renamed from block-cow.c +0 -0
block/dmg.c renamed from block-dmg.c +0 -0
block/nbd.c renamed from block-nbd.c +0 -0
block/parallels.c renamed from block-parallels.c +0 -0
block/qcow.c renamed from block-qcow.c +0 -0
block/qcow2.c renamed from block-qcow2.c +0 -0
block/raw-posix.c renamed from block-raw-posix.c +0 -0
block/raw-win32.c renamed from block-raw-win32.c +0 -0
block/vmdk.c renamed from block-vmdk.c +0 -0
block/vpc.c renamed from block-vpc.c +0 -0
block/vvfat.c renamed from block-vvfat.c +0 -0
configure +1 -1
@@ -2028,7 +2028,7 @@ done # for target in $targets # build tree in object directory if source path is different from current one if test "$source_path_used" = "yes" ; then - DIRS="tests tests/cris slirp audio" + DIRS="tests tests/cris slirp audio block" FILES="Makefile tests/Makefile" FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" FILES="$FILES tests/test-mmap.c"
Signature · 1 line
1.6.0.6
PATCH 4/4 Introduce global .config to selectively enable compile features
In reply to Anthony LiguoriMakefile +19 -10
@@ -41,7 +41,16 @@ ifdef CONFIG_WIN32 LIBS+=-lwinmm -lws2_32 -liphlpapi endif -all: $(TOOLS) $(DOCS) recurse-all +ifdef CONFIG_WIN32 +DEFCONFIG=$(SRC_PATH)/configs/win32/defconfig +else +DEFCONFIG=$(SRC_PATH)/configs/unix/defconfig +endif + +all: .config $(TOOLS) $(DOCS) recurse-all + +.config: $(DEFCONFIG) + $(call quiet-command,cp $< $@,) config-host.mak: configure ifneq ($(wildcard config-host.mak),)
@@ -60,22 +69,22 @@ $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a recurse-all: $(SUBDIR_RULES) +-include .config + ####################################################################### # BLOCK_OBJS is code used by both qemu system emulation and qemu-img -BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o module.o -BLOCK_OBJS+=block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o -BLOCK_OBJS+=block/dmg.o block/bochs.o block/vpc.o block/vvfat.o -BLOCK_OBJS+=block/qcow2.o block/parallels.o block/nbd.o -BLOCK_OBJS+=nbd.o block.o aio.o +BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o module.o aes.o nbd.o block.o +BLOCK_OBJS+=aio.o -ifdef CONFIG_WIN32 -BLOCK_OBJS += block/raw-win32.o -else +obj-y= +include $(SRC_PATH)/block/Makefile +BLOCK_OBJS+=$(addprefix block/, $(obj-y)) + +ifndef CONFIG_WIN32 ifdef CONFIG_AIO BLOCK_OBJS += posix-aio-compat.o endif -BLOCK_OBJS += block/raw-posix.o endif ######################################################################
block/Makefile new file +13 -0
@@ -0,0 +1,13 @@ +obj-$(CONFIG_BDRV_RAW_POSIX) += raw-posix.o +obj-$(CONFIG_BDRV_RAW_WIN32) += raw-win32.o +obj-$(CONFIG_BDRV_BOCHS) += bochs.o +obj-$(CONFIG_BDRV_CLOOP) += cloop.o +obj-$(CONFIG_BDRV_COW) += cow.o +obj-$(CONFIG_BDRV_DMG) += dmg.o +obj-$(CONFIG_BDRV_NBD) += nbd.o +obj-$(CONFIG_BDRV_PARALLELS) += parallels.o +obj-$(CONFIG_BDRV_QCOW2) += qcow2.o +obj-$(CONFIG_BDRV_QCOW) += qcow.o +obj-$(CONFIG_BDRV_VMDK) += vmdk.o +obj-$(CONFIG_BDRV_VPC) += vpc.o +obj-$(CONFIG_BDRV_VVFAT) += vvfat.o
block/cow.c +0 -2
@@ -21,7 +21,6 @@* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef _WIN32#include "qemu-common.h" #include "block_int.h" #include "module.h"
@@ -273,4 +272,3 @@ static int bdrv_cow_init(void) }block_init (bdrv_cow_init); -#endif
configs/unix/defconfig new file +13 -0
@@ -0,0 +1,13 @@ +CONFIG_BDRV_RAW_POSIX=y +# CONFIG_BDRV_RAW_WIN32 is not set +CONFIG_BDRV_BOCHS=y +CONFIG_BDRV_CLOOP=y +CONFIG_BDRV_COW=y +CONFIG_BDRV_DMG=y +CONFIG_BDRV_NBD=y +CONFIG_BDRV_PARALLELS=y +CONFIG_BDRV_QCOW2=y +CONFIG_BDRV_QCOW=y +CONFIG_BDRV_VMDK=y +CONFIG_BDRV_VPC=y +CONFIG_BDRV_VVFAT=y
configs/win32/defconfig new file +13 -0
@@ -0,0 +1,13 @@ +# CONFIG_BDRV_RAW_POSIX is not set +CONFIG_BDRV_RAW_WIN32=y +CONFIG_BDRV_BOCHS=y +CONFIG_BDRV_CLOOP=y +# CONFIG_BDRV_COW is not set +CONFIG_BDRV_DMG=y +CONFIG_BDRV_NBD=y +CONFIG_BDRV_PARALLELS=y +CONFIG_BDRV_QCOW2=y +CONFIG_BDRV_QCOW=y +CONFIG_BDRV_VMDK=y +CONFIG_BDRV_VPC=y +CONFIG_BDRV_VVFAT=y
Signature · 1 line
1.6.0.6
Re: [Qemu-devel] [PATCH 4/4] Introduce global .config to selectively enable compile features
Quoted 13 lines · Anthony Liguori
Signed-off-by Anthony Liguori <[email protected]>Makefile +2
-1@@ -41,7 +41,16 @@ ifdef CONFIG_WIN32 LIBS+=-lwinmm -lws2_32 -liphlpapi endif -all: $(TOOLS) $(DOCS) recurse-all +ifdef CONFIG_WIN32 +DEFCONFIG=$(SRC_PATH)/configs/win32/defconfig
Makefile ifdef CONFIG_WIN32 · line 55
Quoted 10 lines
Makefile +8
-0+else +DEFCONFIG=$(SRC_PATH)/configs/unix/defconfig +endif + +all: .config $(TOOLS) $(DOCS) recurse-all + +.config: $(DEFCONFIG) + $(call quiet-command,cp $< $@,)
Please let's not make this a hidden file.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [Qemu-devel] [PATCH 4/4] Introduce global .config to selectively enable compile features
Quoted 6 lines · Avi Kivity
Quoted 4 lines
+.config: $(DEFCONFIG)
+ $(call quiet-command,cp $< $@,)Please let's not make this a hidden file.
I'm happy to call it whatever you'd like :-)
Some variation of config-host.{mak,h} probably makes sense.
Regards,
Anthony Liguori
Re: [Qemu-devel] [PATCH 4/4] Introduce global .config to selectively enable compile features
Quoted 6 lines · Anthony Liguori
Quoted 5 lines · Avi Kivity
Quoted 4 lines
+.config: $(DEFCONFIG)
+ $(call quiet-command,cp $< $@,)
Quoted 6 lines
Quoted 1 line
Please let's not make this a hidden file.
I'm happy to call it whatever you'd like :-)
Some variation of config-host.{mak,h} probably makes sense.
components.mak?
build.mak?
modules.mak?
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 2 lines · Anthony Liguori
This is the current state of a patch set to introduce a module infrastructure to QEMU.
I don't think numeric priorities are a good idea. If we have dependencies then we should be dealing with them properly, not hacking round the problem.
Also, there's no reason to have destructors. The init function can register these at runtime.
Quoted 4 lines
2) Switch to using dynamic shared libraries. This has the benefit of reducing the QEMU install size. This is attractive except for the fact that creating dynamic shared libraries across multiple host architectures is a pain.
In practice I'd expect the shared library overhead (both disk and RAM) to be significantly larger than the saving form omitting a few devices. As you said before, if we're not using something, why build it in the first place?
There's also the issue that shared libraries imply it's OK for third parties to ship binary plugins.
Paul
Quoted 10 lines · Paul Brook
Quoted 3 lines · Anthony Liguori
This is the current state of a patch set to introduce a module infrastructure to QEMU.
I don't think numeric priorities are a good idea. If we have dependencies then we should be dealing with them properly, not hacking round the problem.
Also, there's no reason to have destructors. The init function can register these at runtime.
Agree to both.
Quoted 2 lines
There's also the issue that shared libraries imply it's OK for third parties to ship binary plugins.
Can't we add wording to LICENSE to address this? I'd really like to allow GPL plugins. Linux and now gcc allow this.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [Qemu-devel] Re: [PATCH 0/4][RFC] Add module infrastructure toQEMU
Quoted 4 lines · Avi Kivity
Quoted 2 lines
There's also the issue that shared libraries imply it's OK for third parties to ship binary plugins.
Can't we add wording to LICENSE to address this? I'd really like to allow GPL plugins. Linux and now gcc allow this.
There's a lot of technical work to actually support shared libraries on all the platforms QEMU supports. Even if we had that, and I expect a big flame war wrt reinventing autoconf here too, in order to realistically talk about plugins, we would need a much more modular infrastructure than we have today to allow a config file to specify a particular device without any core knowledge in QEMU of that device.
It's an admirable goal but we're far away from that. When we eventually get there, we still have the issue of stable ABI (and Linux has this too).
So, I don't think this is a debate that we need to have now. There's plenty of work to do before we get there :-)
Signature · 3 lines
Regards, Anthony Liguori
Re: [Qemu-devel] Re: [PATCH 0/4][RFC] Add module infrastructure toQEMU
Quoted 7 lines · Anthony Liguori
Quoted 4 lines · Avi Kivity
Quoted 2 lines
There's also the issue that shared libraries imply it's OK for third parties to ship binary plugins.
Can't we add wording to LICENSE to address this? I'd really like to allow GPL plugins. Linux and now gcc allow this.
There's a lot of technical work to actually support shared libraries on all the platforms QEMU supports.
We could enable that only on platforms that support it.
Quoted 1 line
Even if we had that, and I expect a big flame war wrt reinventing autoconf here too, in order to realistically talk about plugins, we would need a much more modular infrastructure than we have today to allow a config file to specify a particular device without any core knowledge in QEMU of that device.
No doubt. But taking the first step may encourage people to work towards it.
Quoted 2 lines
It's an admirable goal but we're far away from that. When we eventually get there, we still have the issue of stable ABI (and Linux has this too).
That's fine, I think. Not ideal but livable.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 8 lines · Paul Brook
Quoted 3 lines · Anthony Liguori
This is the current state of a patch set to introduce a module infrastructure to QEMU.
I don't think numeric priorities are a good idea. If we have dependencies then we should be dealing with them properly, not hacking round the problem.
The numeric priorities are an implementation detail. No one should ever consume module_init() directly and I should add appropriately scary comments to that affect.
The numeric priorities are currently used to implement a simple dependency tree with each level of the tree being an integer priority.
We do have dependencies. I'd like virtio to be a module, and I'd like virtio-net, virtio-blk, etc. to be modules. This gets exposed as virtio.c being a bus_init() and virtio-*.c being virtio_init(). We use the integer priorities in module.h to express this.
We could get fancier and have explicit dependencies by name or something like that. I'm not sure I think it's worth getting this complex though.
Quoted 2 lines
Also, there's no reason to have destructors. The init function can register these at runtime.
I don't feel strongly here.
The one case I think it could prove useful is that a number of things require atexit functions today. I think it would be good to use destructors to make these more standardized. Also, deregistering components has the advantage of making valgrind much happier.
We don't deregister the block drivers in this patch series, but I can certainly add it.
Quoted 10 lines
Quoted 5 lines
2) Switch to using dynamic shared libraries. This has the benefit of
reducing the QEMU install size. This is attractive except for the fact that creating dynamic shared libraries across multiple host architectures is a pain.In practice I'd expect the shared library overhead (both disk and RAM) to be significantly larger than the saving form omitting a few devices. As you said before, if we're not using something, why build it in the first place?
There's also the issue that shared libraries imply it's OK for third parties to ship binary plugins.
I'm strictly talking about libqemu_common.a and libqemu_user.a. However, I really don't want to do shared libraries in the absence of automake because shared libraries require a lot of per-platform foo to create.
I'm happy ruling this out.
Regards,
Anthony Liguori
Quoted 2 lines
Paul
Signature · 3 lines
Regards, Anthony Liguori
Quoted 5 lines · Anthony Liguori
Quoted 4 lines · Paul Brook
Quoted 2 lines · Anthony Liguori
This is the current state of a patch set to introduce a module infrastructure to QEMU.
Quoted 7 lines
Quoted 3 lines
I don't think numeric priorities are a good idea. If we have dependencies then we should be dealing with them properly, not hacking round the problem.
The numeric priorities are an implementation detail. No one should ever consume
module_init()directly and I should add appropriately scary comments to that affect.
Having looked a bit deeper, you're not actually implementing priorities. You're implementing different categories of init function. So this should be an enum, and be renames to something less confusing.
Quoted 4 lines
We do have dependencies. I'd like virtio to be a module, and I'd like virtio-net, virtio-blk, etc. to be modules. This gets exposed as
virtio.cbeing abus_init()and virtio-*.c beingvirtio_init(). We use the integer priorities inmodule.hto express this.
I'm not convinced virtio is as much of a separate entity as you think it is. It's certainly not a bus. It's an implementation detail that happens to be shared by several devices.
Paul
Quoted 9 lines · Paul Brook
Quoted 4 lines · Anthony Liguori
The numeric priorities are an implementation detail. No one should ever consume
module_init()directly and I should add appropriately scary comments to that affect.Having looked a bit deeper, you're not actually implementing priorities. You're implementing different categories of init function. So this should be an enum, and be renames to something less confusing.
Good point, will do.
Quoted 8 lines
Quoted 5 lines
We do have dependencies. I'd like virtio to be a module, and I'd like virtio-net, virtio-blk, etc. to be modules. This gets exposed as
virtio.cbeing abus_init()and virtio-*.c beingvirtio_init(). We use the integer priorities inmodule.hto express this.I'm not convinced virtio is as much of a separate entity as you think it is. It's certainly not a bus. It's an implementation detail that happens to be shared by several devices.
It is once you abstract out the transport API from the transport implementation. We fall short here in QEMU today mainly for better integration with how machines are created today. I'd like to refactor the QEMU virtio code though to be closer to the Linux side of things. I see a module mechanism like this as a prereq for doing such a refactoring.
s390 uses a different transport implementation (there is no PCI on s390)for virtio so if QEMU ever were to support KVM with s390, we would need a way to support this.
Quoted 2 lines
Paul
Signature · 3 lines
Regards, Anthony Liguori
Quoted 9 lines
Quoted 3 lines
I'm not convinced virtio is as much of a separate entity as you think it is. It's certainly not a bus. It's an implementation detail that happens to be shared by several devices.
It is once you abstract out the transport API from the transport implementation. We fall short here in QEMU today mainly for better integration with how machines are created today. I'd like to refactor the QEMU virtio code though to be closer to the Linux side of things. I see a module mechanism like this as a prereq for doing such a refactoring.
I think it's only a prerequisite if you want a single "virtio" device that then magically morphs into a specific device based on its config. In practice I don't think this is really useful, and the virtio init is driven directly from the host binding. i.e. you have separate virtio-net-pci, virtio-blk-pci, virtio-net-s390, etc. devices in the same way that other pci devices are top level entities.
I've already got a patch I'm hoping to push out soon that implements a different virtio binding.
Paul
A message that is not in the archive (sent off-list or not yet received): AEED36F4EA194EC2B57D5E4DB7D64896@jupiter
Quoted 4 lines · Kazu
Hi,
I think using GCC extension
__attribute__(constractor) has a problem on MinGW. Does this infrastructure have effects on Windows?
It works for me.
Quoted 4 lines
Also there is a project that ports QEMU to VisualC++.
http://sourceforge.net/projects/winqemu/What do you think of portability?
It's been discussed before. QEMU has no intention of supporting MSVC as a compiler.
Signature · 3 lines
Regards, Anthony Liguori