From 4d4545743f55b37d37535f7b32456b82c97efeb8 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 26 Nov 2012 16:03:42 +0100 Subject: [PATCH 01/27] qemu-option: move standard option definitions out of qemu-config.c Signed-off-by: Paolo Bonzini --- block/iscsi.c | 27 ++ blockdev.c | 118 +++++++ fsdev/Makefile.objs | 1 + fsdev/qemu-fsdev-dummy.c | 7 - fsdev/qemu-fsdev-opts.c | 85 +++++ fsdev/qemu-fsdev.c | 8 - hw/qdev-monitor.c | 51 +++ include/qemu/config-file.h | 5 - include/sysemu/sysemu.h | 8 + monitor.c | 22 ++ net/net.c | 26 ++ qemu-char.c | 72 ++++ qemu-config.c | 681 +------------------------------------ ui/spice-core.c | 84 +++++ vl.c | 205 +++++++++++ 15 files changed, 700 insertions(+), 700 deletions(-) create mode 100644 fsdev/qemu-fsdev-opts.c diff --git a/block/iscsi.c b/block/iscsi.c index 041ee07de3..f08cf9663b 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -980,9 +980,36 @@ static BlockDriver bdrv_iscsi = { #endif }; +static QemuOptsList qemu_iscsi_opts = { + .name = "iscsi", + .head = QTAILQ_HEAD_INITIALIZER(qemu_iscsi_opts.head), + .desc = { + { + .name = "user", + .type = QEMU_OPT_STRING, + .help = "username for CHAP authentication to target", + },{ + .name = "password", + .type = QEMU_OPT_STRING, + .help = "password for CHAP authentication to target", + },{ + .name = "header-digest", + .type = QEMU_OPT_STRING, + .help = "HeaderDigest setting. " + "{CRC32C|CRC32C-NONE|NONE-CRC32C|NONE}", + },{ + .name = "initiator-name", + .type = QEMU_OPT_STRING, + .help = "Initiator iqn name to use when connecting", + }, + { /* end of list */ } + }, +}; + static void iscsi_block_init(void) { bdrv_register(&bdrv_iscsi); + qemu_add_opts(&qemu_iscsi_opts); } block_init(iscsi_block_init); diff --git a/blockdev.c b/blockdev.c index d724e2dc5b..9126587c45 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1427,3 +1427,121 @@ BlockJobInfoList *qmp_query_block_jobs(Error **errp) bdrv_iterate(do_qmp_query_block_jobs_one, &prev); return dummy.next; } + +QemuOptsList qemu_drive_opts = { + .name = "drive", + .head = QTAILQ_HEAD_INITIALIZER(qemu_drive_opts.head), + .desc = { + { + .name = "bus", + .type = QEMU_OPT_NUMBER, + .help = "bus number", + },{ + .name = "unit", + .type = QEMU_OPT_NUMBER, + .help = "unit number (i.e. lun for scsi)", + },{ + .name = "if", + .type = QEMU_OPT_STRING, + .help = "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)", + },{ + .name = "index", + .type = QEMU_OPT_NUMBER, + .help = "index number", + },{ + .name = "cyls", + .type = QEMU_OPT_NUMBER, + .help = "number of cylinders (ide disk geometry)", + },{ + .name = "heads", + .type = QEMU_OPT_NUMBER, + .help = "number of heads (ide disk geometry)", + },{ + .name = "secs", + .type = QEMU_OPT_NUMBER, + .help = "number of sectors (ide disk geometry)", + },{ + .name = "trans", + .type = QEMU_OPT_STRING, + .help = "chs translation (auto, lba. none)", + },{ + .name = "media", + .type = QEMU_OPT_STRING, + .help = "media type (disk, cdrom)", + },{ + .name = "snapshot", + .type = QEMU_OPT_BOOL, + .help = "enable/disable snapshot mode", + },{ + .name = "file", + .type = QEMU_OPT_STRING, + .help = "disk image", + },{ + .name = "cache", + .type = QEMU_OPT_STRING, + .help = "host cache usage (none, writeback, writethrough, " + "directsync, unsafe)", + },{ + .name = "aio", + .type = QEMU_OPT_STRING, + .help = "host AIO implementation (threads, native)", + },{ + .name = "format", + .type = QEMU_OPT_STRING, + .help = "disk format (raw, qcow2, ...)", + },{ + .name = "serial", + .type = QEMU_OPT_STRING, + .help = "disk serial number", + },{ + .name = "rerror", + .type = QEMU_OPT_STRING, + .help = "read error action", + },{ + .name = "werror", + .type = QEMU_OPT_STRING, + .help = "write error action", + },{ + .name = "addr", + .type = QEMU_OPT_STRING, + .help = "pci address (virtio only)", + },{ + .name = "readonly", + .type = QEMU_OPT_BOOL, + .help = "open drive file as read-only", + },{ + .name = "iops", + .type = QEMU_OPT_NUMBER, + .help = "limit total I/O operations per second", + },{ + .name = "iops_rd", + .type = QEMU_OPT_NUMBER, + .help = "limit read operations per second", + },{ + .name = "iops_wr", + .type = QEMU_OPT_NUMBER, + .help = "limit write operations per second", + },{ + .name = "bps", + .type = QEMU_OPT_NUMBER, + .help = "limit total bytes per second", + },{ + .name = "bps_rd", + .type = QEMU_OPT_NUMBER, + .help = "limit read bytes per second", + },{ + .name = "bps_wr", + .type = QEMU_OPT_NUMBER, + .help = "limit write bytes per second", + },{ + .name = "copy-on-read", + .type = QEMU_OPT_BOOL, + .help = "copy read data from backing file into image file", + },{ + .name = "boot", + .type = QEMU_OPT_BOOL, + .help = "(deprecated, ignored)", + }, + { /* end of list */ } + }, +}; diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs index cb1e2500b9..ee16ca600c 100644 --- a/fsdev/Makefile.objs +++ b/fsdev/Makefile.objs @@ -7,3 +7,4 @@ extra-obj-y = qemu-fsdev-dummy.o else common-obj-y = qemu-fsdev-dummy.o endif +common-obj-y += qemu-fsdev-opts.o diff --git a/fsdev/qemu-fsdev-dummy.c b/fsdev/qemu-fsdev-dummy.c index 4bcf38fe4b..7dc2630a78 100644 --- a/fsdev/qemu-fsdev-dummy.c +++ b/fsdev/qemu-fsdev-dummy.c @@ -20,10 +20,3 @@ int qemu_fsdev_add(QemuOpts *opts) { return 0; } - -static void fsdev_register_config(void) -{ - qemu_add_opts(&qemu_fsdev_opts); - qemu_add_opts(&qemu_virtfs_opts); -} -machine_init(fsdev_register_config); diff --git a/fsdev/qemu-fsdev-opts.c b/fsdev/qemu-fsdev-opts.c new file mode 100644 index 0000000000..6311c7a7e5 --- /dev/null +++ b/fsdev/qemu-fsdev-opts.c @@ -0,0 +1,85 @@ +/* + * Virtio 9p + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * later. See the COPYING file in the top-level directory. + */ + +#include "qemu/config-file.h" +#include "qemu/option.h" +#include "qemu/module.h" + +static QemuOptsList qemu_fsdev_opts = { + .name = "fsdev", + .implied_opt_name = "fsdriver", + .head = QTAILQ_HEAD_INITIALIZER(qemu_fsdev_opts.head), + .desc = { + { + .name = "fsdriver", + .type = QEMU_OPT_STRING, + }, { + .name = "path", + .type = QEMU_OPT_STRING, + }, { + .name = "security_model", + .type = QEMU_OPT_STRING, + }, { + .name = "writeout", + .type = QEMU_OPT_STRING, + }, { + .name = "readonly", + .type = QEMU_OPT_BOOL, + + }, { + .name = "socket", + .type = QEMU_OPT_STRING, + }, { + .name = "sock_fd", + .type = QEMU_OPT_NUMBER, + }, + + { /*End of list */ } + }, +}; + +static QemuOptsList qemu_virtfs_opts = { + .name = "virtfs", + .implied_opt_name = "fsdriver", + .head = QTAILQ_HEAD_INITIALIZER(qemu_virtfs_opts.head), + .desc = { + { + .name = "fsdriver", + .type = QEMU_OPT_STRING, + }, { + .name = "path", + .type = QEMU_OPT_STRING, + }, { + .name = "mount_tag", + .type = QEMU_OPT_STRING, + }, { + .name = "security_model", + .type = QEMU_OPT_STRING, + }, { + .name = "writeout", + .type = QEMU_OPT_STRING, + }, { + .name = "readonly", + .type = QEMU_OPT_BOOL, + }, { + .name = "socket", + .type = QEMU_OPT_STRING, + }, { + .name = "sock_fd", + .type = QEMU_OPT_NUMBER, + }, + + { /*End of list */ } + }, +}; + +static void fsdev_register_config(void) +{ + qemu_add_opts(&qemu_fsdev_opts); + qemu_add_opts(&qemu_virtfs_opts); +} +machine_init(fsdev_register_config); diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c index 4cc04d4fde..6eaf36dbfa 100644 --- a/fsdev/qemu-fsdev.c +++ b/fsdev/qemu-fsdev.c @@ -97,11 +97,3 @@ FsDriverEntry *get_fsdev_fsentry(char *id) } return NULL; } - -static void fsdev_register_config(void) -{ - qemu_add_opts(&qemu_fsdev_opts); - qemu_add_opts(&qemu_virtfs_opts); -} -machine_init(fsdev_register_config); - diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c index b73986759b..93283ee57a 100644 --- a/hw/qdev-monitor.c +++ b/hw/qdev-monitor.c @@ -615,3 +615,54 @@ void qdev_machine_init(void) qdev_get_peripheral_anon(); qdev_get_peripheral(); } + +QemuOptsList qemu_device_opts = { + .name = "device", + .implied_opt_name = "driver", + .head = QTAILQ_HEAD_INITIALIZER(qemu_device_opts.head), + .desc = { + /* + * no elements => accept any + * sanity checking will happen later + * when setting device properties + */ + { /* end of list */ } + }, +}; + +QemuOptsList qemu_global_opts = { + .name = "global", + .head = QTAILQ_HEAD_INITIALIZER(qemu_global_opts.head), + .desc = { + { + .name = "driver", + .type = QEMU_OPT_STRING, + },{ + .name = "property", + .type = QEMU_OPT_STRING, + },{ + .name = "value", + .type = QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + +int qemu_global_option(const char *str) +{ + char driver[64], property[64]; + QemuOpts *opts; + int rc, offset; + + rc = sscanf(str, "%63[^.].%63[^=]%n", driver, property, &offset); + if (rc < 2 || str[offset] != '=') { + error_report("can't parse: \"%s\"", str); + return -1; + } + + opts = qemu_opts_create_nofail(&qemu_global_opts); + qemu_opt_set(opts, "driver", driver); + qemu_opt_set(opts, "property", property); + qemu_opt_set(opts, "value", str+offset+1); + return 0; +} diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index 486c77cad4..ccfccae2b4 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -6,11 +6,6 @@ #include "qapi/error.h" #include "qemu/option.h" -extern QemuOptsList qemu_fsdev_opts; -extern QemuOptsList qemu_virtfs_opts; -extern QemuOptsList qemu_spice_opts; -extern QemuOptsList qemu_sandbox_opts; - QemuOptsList *qemu_find_opts(const char *group); QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); void qemu_add_opts(QemuOptsList *list); diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 28a783e2be..c07d4ee458 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -183,4 +183,12 @@ char *get_boot_devices_list(uint32_t *size); bool usb_enabled(bool default_usb); +extern QemuOptsList qemu_drive_opts; +extern QemuOptsList qemu_chardev_opts; +extern QemuOptsList qemu_device_opts; +extern QemuOptsList qemu_netdev_opts; +extern QemuOptsList qemu_net_opts; +extern QemuOptsList qemu_global_opts; +extern QemuOptsList qemu_mon_opts; + #endif diff --git a/monitor.c b/monitor.c index 9cf419bb1d..7b7221999c 100644 --- a/monitor.c +++ b/monitor.c @@ -4790,3 +4790,25 @@ int monitor_read_block_device_key(Monitor *mon, const char *device, return monitor_read_bdrv_key_start(mon, bs, completion_cb, opaque); } + +QemuOptsList qemu_mon_opts = { + .name = "mon", + .implied_opt_name = "chardev", + .head = QTAILQ_HEAD_INITIALIZER(qemu_mon_opts.head), + .desc = { + { + .name = "mode", + .type = QEMU_OPT_STRING, + },{ + .name = "chardev", + .type = QEMU_OPT_STRING, + },{ + .name = "default", + .type = QEMU_OPT_BOOL, + },{ + .name = "pretty", + .type = QEMU_OPT_BOOL, + }, + { /* end of list */ } + }, +}; diff --git a/net/net.c b/net/net.c index dbf3e1b003..02b5458a1b 100644 --- a/net/net.c +++ b/net/net.c @@ -1054,3 +1054,29 @@ unsigned compute_mcast_idx(const uint8_t *ep) } return crc >> 26; } + +QemuOptsList qemu_netdev_opts = { + .name = "netdev", + .implied_opt_name = "type", + .head = QTAILQ_HEAD_INITIALIZER(qemu_netdev_opts.head), + .desc = { + /* + * no elements => accept any params + * validation will happen later + */ + { /* end of list */ } + }, +}; + +QemuOptsList qemu_net_opts = { + .name = "net", + .implied_opt_name = "type", + .head = QTAILQ_HEAD_INITIALIZER(qemu_net_opts.head), + .desc = { + /* + * no elements => accept any params + * validation will happen later + */ + { /* end of list */ } + }, +}; diff --git a/qemu-char.c b/qemu-char.c index f41788c9ef..3be4970423 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2924,3 +2924,75 @@ CharDriverState *qemu_char_get_next_serial(void) return serial_hds[next_serial++]; } +QemuOptsList qemu_chardev_opts = { + .name = "chardev", + .implied_opt_name = "backend", + .head = QTAILQ_HEAD_INITIALIZER(qemu_chardev_opts.head), + .desc = { + { + .name = "backend", + .type = QEMU_OPT_STRING, + },{ + .name = "path", + .type = QEMU_OPT_STRING, + },{ + .name = "host", + .type = QEMU_OPT_STRING, + },{ + .name = "port", + .type = QEMU_OPT_STRING, + },{ + .name = "localaddr", + .type = QEMU_OPT_STRING, + },{ + .name = "localport", + .type = QEMU_OPT_STRING, + },{ + .name = "to", + .type = QEMU_OPT_NUMBER, + },{ + .name = "ipv4", + .type = QEMU_OPT_BOOL, + },{ + .name = "ipv6", + .type = QEMU_OPT_BOOL, + },{ + .name = "wait", + .type = QEMU_OPT_BOOL, + },{ + .name = "server", + .type = QEMU_OPT_BOOL, + },{ + .name = "delay", + .type = QEMU_OPT_BOOL, + },{ + .name = "telnet", + .type = QEMU_OPT_BOOL, + },{ + .name = "width", + .type = QEMU_OPT_NUMBER, + },{ + .name = "height", + .type = QEMU_OPT_NUMBER, + },{ + .name = "cols", + .type = QEMU_OPT_NUMBER, + },{ + .name = "rows", + .type = QEMU_OPT_NUMBER, + },{ + .name = "mux", + .type = QEMU_OPT_BOOL, + },{ + .name = "signal", + .type = QEMU_OPT_BOOL, + },{ + .name = "name", + .type = QEMU_OPT_STRING, + },{ + .name = "debug", + .type = QEMU_OPT_NUMBER, + }, + { /* end of list */ } + }, +}; diff --git a/qemu-config.c b/qemu-config.c index 2188c3e5ec..47c81f72d3 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -5,667 +5,7 @@ #include "hw/qdev.h" #include "qapi/error.h" -static QemuOptsList qemu_drive_opts = { - .name = "drive", - .head = QTAILQ_HEAD_INITIALIZER(qemu_drive_opts.head), - .desc = { - { - .name = "bus", - .type = QEMU_OPT_NUMBER, - .help = "bus number", - },{ - .name = "unit", - .type = QEMU_OPT_NUMBER, - .help = "unit number (i.e. lun for scsi)", - },{ - .name = "if", - .type = QEMU_OPT_STRING, - .help = "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)", - },{ - .name = "index", - .type = QEMU_OPT_NUMBER, - .help = "index number", - },{ - .name = "cyls", - .type = QEMU_OPT_NUMBER, - .help = "number of cylinders (ide disk geometry)", - },{ - .name = "heads", - .type = QEMU_OPT_NUMBER, - .help = "number of heads (ide disk geometry)", - },{ - .name = "secs", - .type = QEMU_OPT_NUMBER, - .help = "number of sectors (ide disk geometry)", - },{ - .name = "trans", - .type = QEMU_OPT_STRING, - .help = "chs translation (auto, lba. none)", - },{ - .name = "media", - .type = QEMU_OPT_STRING, - .help = "media type (disk, cdrom)", - },{ - .name = "snapshot", - .type = QEMU_OPT_BOOL, - .help = "enable/disable snapshot mode", - },{ - .name = "file", - .type = QEMU_OPT_STRING, - .help = "disk image", - },{ - .name = "cache", - .type = QEMU_OPT_STRING, - .help = "host cache usage (none, writeback, writethrough, " - "directsync, unsafe)", - },{ - .name = "aio", - .type = QEMU_OPT_STRING, - .help = "host AIO implementation (threads, native)", - },{ - .name = "format", - .type = QEMU_OPT_STRING, - .help = "disk format (raw, qcow2, ...)", - },{ - .name = "serial", - .type = QEMU_OPT_STRING, - .help = "disk serial number", - },{ - .name = "rerror", - .type = QEMU_OPT_STRING, - .help = "read error action", - },{ - .name = "werror", - .type = QEMU_OPT_STRING, - .help = "write error action", - },{ - .name = "addr", - .type = QEMU_OPT_STRING, - .help = "pci address (virtio only)", - },{ - .name = "readonly", - .type = QEMU_OPT_BOOL, - .help = "open drive file as read-only", - },{ - .name = "iops", - .type = QEMU_OPT_NUMBER, - .help = "limit total I/O operations per second", - },{ - .name = "iops_rd", - .type = QEMU_OPT_NUMBER, - .help = "limit read operations per second", - },{ - .name = "iops_wr", - .type = QEMU_OPT_NUMBER, - .help = "limit write operations per second", - },{ - .name = "bps", - .type = QEMU_OPT_NUMBER, - .help = "limit total bytes per second", - },{ - .name = "bps_rd", - .type = QEMU_OPT_NUMBER, - .help = "limit read bytes per second", - },{ - .name = "bps_wr", - .type = QEMU_OPT_NUMBER, - .help = "limit write bytes per second", - },{ - .name = "copy-on-read", - .type = QEMU_OPT_BOOL, - .help = "copy read data from backing file into image file", - },{ - .name = "boot", - .type = QEMU_OPT_BOOL, - .help = "(deprecated, ignored)", - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_iscsi_opts = { - .name = "iscsi", - .head = QTAILQ_HEAD_INITIALIZER(qemu_iscsi_opts.head), - .desc = { - { - .name = "user", - .type = QEMU_OPT_STRING, - .help = "username for CHAP authentication to target", - },{ - .name = "password", - .type = QEMU_OPT_STRING, - .help = "password for CHAP authentication to target", - },{ - .name = "header-digest", - .type = QEMU_OPT_STRING, - .help = "HeaderDigest setting. " - "{CRC32C|CRC32C-NONE|NONE-CRC32C|NONE}", - },{ - .name = "initiator-name", - .type = QEMU_OPT_STRING, - .help = "Initiator iqn name to use when connecting", - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_chardev_opts = { - .name = "chardev", - .implied_opt_name = "backend", - .head = QTAILQ_HEAD_INITIALIZER(qemu_chardev_opts.head), - .desc = { - { - .name = "backend", - .type = QEMU_OPT_STRING, - },{ - .name = "path", - .type = QEMU_OPT_STRING, - },{ - .name = "host", - .type = QEMU_OPT_STRING, - },{ - .name = "port", - .type = QEMU_OPT_STRING, - },{ - .name = "localaddr", - .type = QEMU_OPT_STRING, - },{ - .name = "localport", - .type = QEMU_OPT_STRING, - },{ - .name = "to", - .type = QEMU_OPT_NUMBER, - },{ - .name = "ipv4", - .type = QEMU_OPT_BOOL, - },{ - .name = "ipv6", - .type = QEMU_OPT_BOOL, - },{ - .name = "wait", - .type = QEMU_OPT_BOOL, - },{ - .name = "server", - .type = QEMU_OPT_BOOL, - },{ - .name = "delay", - .type = QEMU_OPT_BOOL, - },{ - .name = "telnet", - .type = QEMU_OPT_BOOL, - },{ - .name = "width", - .type = QEMU_OPT_NUMBER, - },{ - .name = "height", - .type = QEMU_OPT_NUMBER, - },{ - .name = "cols", - .type = QEMU_OPT_NUMBER, - },{ - .name = "rows", - .type = QEMU_OPT_NUMBER, - },{ - .name = "mux", - .type = QEMU_OPT_BOOL, - },{ - .name = "signal", - .type = QEMU_OPT_BOOL, - },{ - .name = "name", - .type = QEMU_OPT_STRING, - },{ - .name = "debug", - .type = QEMU_OPT_NUMBER, - }, - { /* end of list */ } - }, -}; - -QemuOptsList qemu_fsdev_opts = { - .name = "fsdev", - .implied_opt_name = "fsdriver", - .head = QTAILQ_HEAD_INITIALIZER(qemu_fsdev_opts.head), - .desc = { - { - .name = "fsdriver", - .type = QEMU_OPT_STRING, - }, { - .name = "path", - .type = QEMU_OPT_STRING, - }, { - .name = "security_model", - .type = QEMU_OPT_STRING, - }, { - .name = "writeout", - .type = QEMU_OPT_STRING, - }, { - .name = "readonly", - .type = QEMU_OPT_BOOL, - - }, { - .name = "socket", - .type = QEMU_OPT_STRING, - }, { - .name = "sock_fd", - .type = QEMU_OPT_NUMBER, - }, - - { /*End of list */ } - }, -}; - -QemuOptsList qemu_virtfs_opts = { - .name = "virtfs", - .implied_opt_name = "fsdriver", - .head = QTAILQ_HEAD_INITIALIZER(qemu_virtfs_opts.head), - .desc = { - { - .name = "fsdriver", - .type = QEMU_OPT_STRING, - }, { - .name = "path", - .type = QEMU_OPT_STRING, - }, { - .name = "mount_tag", - .type = QEMU_OPT_STRING, - }, { - .name = "security_model", - .type = QEMU_OPT_STRING, - }, { - .name = "writeout", - .type = QEMU_OPT_STRING, - }, { - .name = "readonly", - .type = QEMU_OPT_BOOL, - }, { - .name = "socket", - .type = QEMU_OPT_STRING, - }, { - .name = "sock_fd", - .type = QEMU_OPT_NUMBER, - }, - - { /*End of list */ } - }, -}; - -static QemuOptsList qemu_device_opts = { - .name = "device", - .implied_opt_name = "driver", - .head = QTAILQ_HEAD_INITIALIZER(qemu_device_opts.head), - .desc = { - /* - * no elements => accept any - * sanity checking will happen later - * when setting device properties - */ - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_netdev_opts = { - .name = "netdev", - .implied_opt_name = "type", - .head = QTAILQ_HEAD_INITIALIZER(qemu_netdev_opts.head), - .desc = { - /* - * no elements => accept any params - * validation will happen later - */ - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_net_opts = { - .name = "net", - .implied_opt_name = "type", - .head = QTAILQ_HEAD_INITIALIZER(qemu_net_opts.head), - .desc = { - /* - * no elements => accept any params - * validation will happen later - */ - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_rtc_opts = { - .name = "rtc", - .head = QTAILQ_HEAD_INITIALIZER(qemu_rtc_opts.head), - .desc = { - { - .name = "base", - .type = QEMU_OPT_STRING, - },{ - .name = "clock", - .type = QEMU_OPT_STRING, - },{ - .name = "driftfix", - .type = QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_global_opts = { - .name = "global", - .head = QTAILQ_HEAD_INITIALIZER(qemu_global_opts.head), - .desc = { - { - .name = "driver", - .type = QEMU_OPT_STRING, - },{ - .name = "property", - .type = QEMU_OPT_STRING, - },{ - .name = "value", - .type = QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - -QemuOptsList qemu_sandbox_opts = { - .name = "sandbox", - .implied_opt_name = "enable", - .head = QTAILQ_HEAD_INITIALIZER(qemu_sandbox_opts.head), - .desc = { - { - .name = "enable", - .type = QEMU_OPT_BOOL, - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_mon_opts = { - .name = "mon", - .implied_opt_name = "chardev", - .head = QTAILQ_HEAD_INITIALIZER(qemu_mon_opts.head), - .desc = { - { - .name = "mode", - .type = QEMU_OPT_STRING, - },{ - .name = "chardev", - .type = QEMU_OPT_STRING, - },{ - .name = "default", - .type = QEMU_OPT_BOOL, - },{ - .name = "pretty", - .type = QEMU_OPT_BOOL, - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_trace_opts = { - .name = "trace", - .implied_opt_name = "trace", - .head = QTAILQ_HEAD_INITIALIZER(qemu_trace_opts.head), - .desc = { - { - .name = "events", - .type = QEMU_OPT_STRING, - },{ - .name = "file", - .type = QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - -QemuOptsList qemu_spice_opts = { - .name = "spice", - .head = QTAILQ_HEAD_INITIALIZER(qemu_spice_opts.head), - .desc = { - { - .name = "port", - .type = QEMU_OPT_NUMBER, - },{ - .name = "tls-port", - .type = QEMU_OPT_NUMBER, - },{ - .name = "addr", - .type = QEMU_OPT_STRING, - },{ - .name = "ipv4", - .type = QEMU_OPT_BOOL, - },{ - .name = "ipv6", - .type = QEMU_OPT_BOOL, - },{ - .name = "password", - .type = QEMU_OPT_STRING, - },{ - .name = "disable-ticketing", - .type = QEMU_OPT_BOOL, - },{ - .name = "disable-copy-paste", - .type = QEMU_OPT_BOOL, - },{ - .name = "sasl", - .type = QEMU_OPT_BOOL, - },{ - .name = "x509-dir", - .type = QEMU_OPT_STRING, - },{ - .name = "x509-key-file", - .type = QEMU_OPT_STRING, - },{ - .name = "x509-key-password", - .type = QEMU_OPT_STRING, - },{ - .name = "x509-cert-file", - .type = QEMU_OPT_STRING, - },{ - .name = "x509-cacert-file", - .type = QEMU_OPT_STRING, - },{ - .name = "x509-dh-key-file", - .type = QEMU_OPT_STRING, - },{ - .name = "tls-ciphers", - .type = QEMU_OPT_STRING, - },{ - .name = "tls-channel", - .type = QEMU_OPT_STRING, - },{ - .name = "plaintext-channel", - .type = QEMU_OPT_STRING, - },{ - .name = "image-compression", - .type = QEMU_OPT_STRING, - },{ - .name = "jpeg-wan-compression", - .type = QEMU_OPT_STRING, - },{ - .name = "zlib-glz-wan-compression", - .type = QEMU_OPT_STRING, - },{ - .name = "streaming-video", - .type = QEMU_OPT_STRING, - },{ - .name = "agent-mouse", - .type = QEMU_OPT_BOOL, - },{ - .name = "playback-compression", - .type = QEMU_OPT_BOOL, - }, { - .name = "seamless-migration", - .type = QEMU_OPT_BOOL, - }, - { /* end of list */ } - }, -}; - -QemuOptsList qemu_option_rom_opts = { - .name = "option-rom", - .implied_opt_name = "romfile", - .head = QTAILQ_HEAD_INITIALIZER(qemu_option_rom_opts.head), - .desc = { - { - .name = "bootindex", - .type = QEMU_OPT_NUMBER, - }, { - .name = "romfile", - .type = QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_machine_opts = { - .name = "machine", - .implied_opt_name = "type", - .merge_lists = true, - .head = QTAILQ_HEAD_INITIALIZER(qemu_machine_opts.head), - .desc = { - { - .name = "type", - .type = QEMU_OPT_STRING, - .help = "emulated machine" - }, { - .name = "accel", - .type = QEMU_OPT_STRING, - .help = "accelerator list", - }, { - .name = "kernel_irqchip", - .type = QEMU_OPT_BOOL, - .help = "use KVM in-kernel irqchip", - }, { - .name = "kvm_shadow_mem", - .type = QEMU_OPT_SIZE, - .help = "KVM shadow MMU size", - }, { - .name = "kernel", - .type = QEMU_OPT_STRING, - .help = "Linux kernel image file", - }, { - .name = "initrd", - .type = QEMU_OPT_STRING, - .help = "Linux initial ramdisk file", - }, { - .name = "append", - .type = QEMU_OPT_STRING, - .help = "Linux kernel command line", - }, { - .name = "dtb", - .type = QEMU_OPT_STRING, - .help = "Linux kernel device tree file", - }, { - .name = "dumpdtb", - .type = QEMU_OPT_STRING, - .help = "Dump current dtb to a file and quit", - }, { - .name = "phandle_start", - .type = QEMU_OPT_STRING, - .help = "The first phandle ID we may generate dynamically", - }, { - .name = "dt_compatible", - .type = QEMU_OPT_STRING, - .help = "Overrides the \"compatible\" property of the dt root node", - }, { - .name = "dump-guest-core", - .type = QEMU_OPT_BOOL, - .help = "Include guest memory in a core dump", - }, { - .name = "mem-merge", - .type = QEMU_OPT_BOOL, - .help = "enable/disable memory merge support", - },{ - .name = "usb", - .type = QEMU_OPT_BOOL, - .help = "Set on/off to enable/disable usb", - }, { - .name = "nvram", - .type = QEMU_OPT_STRING, - .help = "Drive backing persistent NVRAM", - }, - { /* End of list */ } - }, -}; - -QemuOptsList qemu_boot_opts = { - .name = "boot-opts", - .head = QTAILQ_HEAD_INITIALIZER(qemu_boot_opts.head), - .desc = { - /* the three names below are not used now */ - { - .name = "order", - .type = QEMU_OPT_STRING, - }, { - .name = "once", - .type = QEMU_OPT_STRING, - }, { - .name = "menu", - .type = QEMU_OPT_STRING, - /* following are really used */ - }, { - .name = "splash", - .type = QEMU_OPT_STRING, - }, { - .name = "splash-time", - .type = QEMU_OPT_STRING, - }, { - .name = "reboot-timeout", - .type = QEMU_OPT_STRING, - }, - { /*End of list */ } - }, -}; - -static QemuOptsList qemu_add_fd_opts = { - .name = "add-fd", - .head = QTAILQ_HEAD_INITIALIZER(qemu_add_fd_opts.head), - .desc = { - { - .name = "fd", - .type = QEMU_OPT_NUMBER, - .help = "file descriptor of which a duplicate is added to fd set", - },{ - .name = "set", - .type = QEMU_OPT_NUMBER, - .help = "ID of the fd set to add fd to", - },{ - .name = "opaque", - .type = QEMU_OPT_STRING, - .help = "free-form string used to describe fd", - }, - { /* end of list */ } - }, -}; - -static QemuOptsList qemu_object_opts = { - .name = "object", - .implied_opt_name = "qom-type", - .head = QTAILQ_HEAD_INITIALIZER(qemu_object_opts.head), - .desc = { - { } - }, -}; - -static QemuOptsList *vm_config_groups[32] = { - &qemu_drive_opts, - &qemu_chardev_opts, - &qemu_device_opts, - &qemu_netdev_opts, - &qemu_net_opts, - &qemu_rtc_opts, - &qemu_global_opts, - &qemu_mon_opts, - &qemu_trace_opts, - &qemu_option_rom_opts, - &qemu_machine_opts, - &qemu_boot_opts, - &qemu_iscsi_opts, - &qemu_sandbox_opts, - &qemu_add_fd_opts, - &qemu_object_opts, - NULL, -}; +static QemuOptsList *vm_config_groups[32]; static QemuOptsList *find_list(QemuOptsList **lists, const char *group, Error **errp) @@ -748,25 +88,6 @@ int qemu_set_option(const char *str) return 0; } -int qemu_global_option(const char *str) -{ - char driver[64], property[64]; - QemuOpts *opts; - int rc, offset; - - rc = sscanf(str, "%63[^.].%63[^=]%n", driver, property, &offset); - if (rc < 2 || str[offset] != '=') { - error_report("can't parse: \"%s\"", str); - return -1; - } - - opts = qemu_opts_create_nofail(&qemu_global_opts); - qemu_opt_set(opts, "driver", driver); - qemu_opt_set(opts, "property", property); - qemu_opt_set(opts, "value", str+offset+1); - return 0; -} - struct ConfigWriteData { QemuOptsList *list; FILE *fp; diff --git a/ui/spice-core.c b/ui/spice-core.c index d83de2a46e..3f2c5650cd 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -417,6 +417,90 @@ static SpiceChannelList *qmp_query_spice_channels(void) return head; } +static QemuOptsList qemu_spice_opts = { + .name = "spice", + .head = QTAILQ_HEAD_INITIALIZER(qemu_spice_opts.head), + .desc = { + { + .name = "port", + .type = QEMU_OPT_NUMBER, + },{ + .name = "tls-port", + .type = QEMU_OPT_NUMBER, + },{ + .name = "addr", + .type = QEMU_OPT_STRING, + },{ + .name = "ipv4", + .type = QEMU_OPT_BOOL, + },{ + .name = "ipv6", + .type = QEMU_OPT_BOOL, + },{ + .name = "password", + .type = QEMU_OPT_STRING, + },{ + .name = "disable-ticketing", + .type = QEMU_OPT_BOOL, + },{ + .name = "disable-copy-paste", + .type = QEMU_OPT_BOOL, + },{ + .name = "sasl", + .type = QEMU_OPT_BOOL, + },{ + .name = "x509-dir", + .type = QEMU_OPT_STRING, + },{ + .name = "x509-key-file", + .type = QEMU_OPT_STRING, + },{ + .name = "x509-key-password", + .type = QEMU_OPT_STRING, + },{ + .name = "x509-cert-file", + .type = QEMU_OPT_STRING, + },{ + .name = "x509-cacert-file", + .type = QEMU_OPT_STRING, + },{ + .name = "x509-dh-key-file", + .type = QEMU_OPT_STRING, + },{ + .name = "tls-ciphers", + .type = QEMU_OPT_STRING, + },{ + .name = "tls-channel", + .type = QEMU_OPT_STRING, + },{ + .name = "plaintext-channel", + .type = QEMU_OPT_STRING, + },{ + .name = "image-compression", + .type = QEMU_OPT_STRING, + },{ + .name = "jpeg-wan-compression", + .type = QEMU_OPT_STRING, + },{ + .name = "zlib-glz-wan-compression", + .type = QEMU_OPT_STRING, + },{ + .name = "streaming-video", + .type = QEMU_OPT_STRING, + },{ + .name = "agent-mouse", + .type = QEMU_OPT_BOOL, + },{ + .name = "playback-compression", + .type = QEMU_OPT_BOOL, + }, { + .name = "seamless-migration", + .type = QEMU_OPT_BOOL, + }, + { /* end of list */ } + }, +}; + SpiceInfo *qmp_query_spice(Error **errp) { QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head); diff --git a/vl.c b/vl.c index e5da31cf4a..59ce063601 100644 --- a/vl.c +++ b/vl.c @@ -299,6 +299,195 @@ static struct { { .driver = "qxl-vga", .flag = &default_vga }, }; +static QemuOptsList qemu_rtc_opts = { + .name = "rtc", + .head = QTAILQ_HEAD_INITIALIZER(qemu_rtc_opts.head), + .desc = { + { + .name = "base", + .type = QEMU_OPT_STRING, + },{ + .name = "clock", + .type = QEMU_OPT_STRING, + },{ + .name = "driftfix", + .type = QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + +static QemuOptsList qemu_sandbox_opts = { + .name = "sandbox", + .implied_opt_name = "enable", + .head = QTAILQ_HEAD_INITIALIZER(qemu_sandbox_opts.head), + .desc = { + { + .name = "enable", + .type = QEMU_OPT_BOOL, + }, + { /* end of list */ } + }, +}; + +static QemuOptsList qemu_trace_opts = { + .name = "trace", + .implied_opt_name = "trace", + .head = QTAILQ_HEAD_INITIALIZER(qemu_trace_opts.head), + .desc = { + { + .name = "events", + .type = QEMU_OPT_STRING, + },{ + .name = "file", + .type = QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + +static QemuOptsList qemu_option_rom_opts = { + .name = "option-rom", + .implied_opt_name = "romfile", + .head = QTAILQ_HEAD_INITIALIZER(qemu_option_rom_opts.head), + .desc = { + { + .name = "bootindex", + .type = QEMU_OPT_NUMBER, + }, { + .name = "romfile", + .type = QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + +static QemuOptsList qemu_machine_opts = { + .name = "machine", + .implied_opt_name = "type", + .merge_lists = true, + .head = QTAILQ_HEAD_INITIALIZER(qemu_machine_opts.head), + .desc = { + { + .name = "type", + .type = QEMU_OPT_STRING, + .help = "emulated machine" + }, { + .name = "accel", + .type = QEMU_OPT_STRING, + .help = "accelerator list", + }, { + .name = "kernel_irqchip", + .type = QEMU_OPT_BOOL, + .help = "use KVM in-kernel irqchip", + }, { + .name = "kvm_shadow_mem", + .type = QEMU_OPT_SIZE, + .help = "KVM shadow MMU size", + }, { + .name = "kernel", + .type = QEMU_OPT_STRING, + .help = "Linux kernel image file", + }, { + .name = "initrd", + .type = QEMU_OPT_STRING, + .help = "Linux initial ramdisk file", + }, { + .name = "append", + .type = QEMU_OPT_STRING, + .help = "Linux kernel command line", + }, { + .name = "dtb", + .type = QEMU_OPT_STRING, + .help = "Linux kernel device tree file", + }, { + .name = "dumpdtb", + .type = QEMU_OPT_STRING, + .help = "Dump current dtb to a file and quit", + }, { + .name = "phandle_start", + .type = QEMU_OPT_STRING, + .help = "The first phandle ID we may generate dynamically", + }, { + .name = "dt_compatible", + .type = QEMU_OPT_STRING, + .help = "Overrides the \"compatible\" property of the dt root node", + }, { + .name = "dump-guest-core", + .type = QEMU_OPT_BOOL, + .help = "Include guest memory in a core dump", + }, { + .name = "mem-merge", + .type = QEMU_OPT_BOOL, + .help = "enable/disable memory merge support", + },{ + .name = "usb", + .type = QEMU_OPT_BOOL, + .help = "Set on/off to enable/disable usb", + }, + { /* End of list */ } + }, +}; + +static QemuOptsList qemu_boot_opts = { + .name = "boot-opts", + .head = QTAILQ_HEAD_INITIALIZER(qemu_boot_opts.head), + .desc = { + /* the three names below are not used now */ + { + .name = "order", + .type = QEMU_OPT_STRING, + }, { + .name = "once", + .type = QEMU_OPT_STRING, + }, { + .name = "menu", + .type = QEMU_OPT_STRING, + /* following are really used */ + }, { + .name = "splash", + .type = QEMU_OPT_STRING, + }, { + .name = "splash-time", + .type = QEMU_OPT_STRING, + }, { + .name = "reboot-timeout", + .type = QEMU_OPT_STRING, + }, + { /*End of list */ } + }, +}; + +static QemuOptsList qemu_add_fd_opts = { + .name = "add-fd", + .head = QTAILQ_HEAD_INITIALIZER(qemu_add_fd_opts.head), + .desc = { + { + .name = "fd", + .type = QEMU_OPT_NUMBER, + .help = "file descriptor of which a duplicate is added to fd set", + },{ + .name = "set", + .type = QEMU_OPT_NUMBER, + .help = "ID of the fd set to add fd to", + },{ + .name = "opaque", + .type = QEMU_OPT_STRING, + .help = "free-form string used to describe fd", + }, + { /* end of list */ } + }, +}; + +static QemuOptsList qemu_object_opts = { + .name = "object", + .implied_opt_name = "qom-type", + .head = QTAILQ_HEAD_INITIALIZER(qemu_object_opts.head), + .desc = { + { } + }, +}; + const char *qemu_get_vm_name(void) { return qemu_name; @@ -2566,6 +2755,22 @@ int main(int argc, char **argv, char **envp) module_call_init(MODULE_INIT_QOM); + qemu_add_opts(&qemu_drive_opts); + qemu_add_opts(&qemu_chardev_opts); + qemu_add_opts(&qemu_device_opts); + qemu_add_opts(&qemu_netdev_opts); + qemu_add_opts(&qemu_net_opts); + qemu_add_opts(&qemu_rtc_opts); + qemu_add_opts(&qemu_global_opts); + qemu_add_opts(&qemu_mon_opts); + qemu_add_opts(&qemu_trace_opts); + qemu_add_opts(&qemu_option_rom_opts); + qemu_add_opts(&qemu_machine_opts); + qemu_add_opts(&qemu_boot_opts); + qemu_add_opts(&qemu_sandbox_opts); + qemu_add_opts(&qemu_add_fd_opts); + qemu_add_opts(&qemu_object_opts); + runstate_init(); init_clocks(); From 5708fc665524c5218076388504d078441fb3940c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 26 Nov 2012 15:36:40 +0100 Subject: [PATCH 02/27] stubs: fully replace qemu-tool.c and qemu-user.c Signed-off-by: Paolo Bonzini --- Makefile | 2 +- Makefile.objs | 3 +- exec.c | 2 +- qemu-tool.c | 115 ------------------------------------- qemu-user.c | 37 ------------ stubs/Makefile.objs | 17 +++++- stubs/clock-warp.c | 7 +++ stubs/cpu-get-clock.c | 7 +++ stubs/cpu-get-icount.c | 9 +++ stubs/get-vm-name.c | 7 +++ stubs/iothread-lock.c | 10 ++++ stubs/migr-blocker.c | 10 ++++ stubs/mon-is-qmp.c | 7 +++ stubs/mon-print-filename.c | 6 ++ stubs/mon-printf.c | 10 ++++ stubs/mon-protocol-event.c | 6 ++ stubs/mon-set-error.c | 8 +++ stubs/slirp.c | 17 ++++++ stubs/vm-stop.c | 7 +++ tests/Makefile | 18 +++--- 20 files changed, 138 insertions(+), 167 deletions(-) delete mode 100644 qemu-tool.c delete mode 100644 qemu-user.c create mode 100644 stubs/clock-warp.c create mode 100644 stubs/cpu-get-clock.c create mode 100644 stubs/cpu-get-icount.c create mode 100644 stubs/get-vm-name.c create mode 100644 stubs/iothread-lock.c create mode 100644 stubs/migr-blocker.c create mode 100644 stubs/mon-is-qmp.c create mode 100644 stubs/mon-print-filename.c create mode 100644 stubs/mon-printf.c create mode 100644 stubs/mon-protocol-event.c create mode 100644 stubs/mon-set-error.c create mode 100644 stubs/slirp.c create mode 100644 stubs/vm-stop.c diff --git a/Makefile b/Makefile index 0200bf345c..3c960a166f 100644 --- a/Makefile +++ b/Makefile @@ -171,7 +171,7 @@ install-libcacard: libcacard.la qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \ +tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-timer.o \ main-loop.o iohandler.o error.o tools-obj-$(CONFIG_POSIX) += compatfd.o diff --git a/Makefile.objs b/Makefile.objs index 12a314e3fb..c64c0c69da 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -130,7 +130,6 @@ user-obj-y += envlist.o path.o user-obj-y += tcg-runtime.o host-utils.o user-obj-y += cache-utils.o user-obj-y += module.o -user-obj-y += qemu-user.o user-obj-y += qom/ ###################################################################### @@ -171,7 +170,7 @@ universal-obj-y += $(qapi-obj-y) ###################################################################### # guest agent -qga-obj-y = qga/ module.o qemu-tool.o +qga-obj-y = qga/ module.o qga-obj-$(CONFIG_POSIX) += qemu-sockets.o qemu-option.o vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) diff --git a/exec.c b/exec.c index a6923addd4..34353f7527 100644 --- a/exec.c +++ b/exec.c @@ -78,7 +78,7 @@ DEFINE_TLS(CPUArchState *,cpu_single_env); /* 0 = Do not count executed instructions. 1 = Precise instruction counting. 2 = Adaptive rate instruction counting. */ -int use_icount = 0; +int use_icount; #if !defined(CONFIG_USER_ONLY) diff --git a/qemu-tool.c b/qemu-tool.c deleted file mode 100644 index 1a474c45bc..0000000000 --- a/qemu-tool.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Compatibility for qemu-img/qemu-nbd - * - * Copyright IBM, Corp. 2008 - * - * Authors: - * Anthony Liguori - * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - */ - -#include "qemu-common.h" -#include "monitor/monitor.h" -#include "qemu/timer.h" -#include "qemu/log.h" -#include "migration/migration.h" -#include "qemu/main-loop.h" -#include "sysemu/sysemu.h" -#include "qemu/sockets.h" -#include "slirp/libslirp.h" - -#include - -struct QEMUBH -{ - QEMUBHFunc *cb; - void *opaque; -}; - -const char *qemu_get_vm_name(void) -{ - return NULL; -} - -Monitor *cur_mon; - -void vm_stop(RunState state) -{ - abort(); -} - -int monitor_cur_is_qmp(void) -{ - return 0; -} - -void monitor_set_error(Monitor *mon, QError *qerror) -{ -} - -void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) -{ -} - -void monitor_printf(Monitor *mon, const char *fmt, ...) -{ -} - -void monitor_print_filename(Monitor *mon, const char *filename) -{ -} - -void monitor_protocol_event(MonitorEvent event, QObject *data) -{ -} - -int64_t cpu_get_clock(void) -{ - return get_clock_realtime(); -} - -int64_t cpu_get_icount(void) -{ - abort(); -} - -void qemu_mutex_lock_iothread(void) -{ -} - -void qemu_mutex_unlock_iothread(void) -{ -} - -int use_icount; - -void qemu_clock_warp(QEMUClock *clock) -{ -} - -void slirp_update_timeout(uint32_t *timeout) -{ -} - -void slirp_select_fill(int *pnfds, fd_set *readfds, - fd_set *writefds, fd_set *xfds) -{ -} - -void slirp_select_poll(fd_set *readfds, fd_set *writefds, - fd_set *xfds, int select_error) -{ -} - -void migrate_add_blocker(Error *reason) -{ -} - -void migrate_del_blocker(Error *reason) -{ -} diff --git a/qemu-user.c b/qemu-user.c deleted file mode 100644 index f8b450c03d..0000000000 --- a/qemu-user.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Stubs for QEMU user emulation - * - * Copyright (c) 2012 SUSE LINUX Products GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * - */ - -#include "qemu-common.h" -#include "monitor/monitor.h" - -Monitor *cur_mon; - -int monitor_cur_is_qmp(void) -{ - return 0; -} - -void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) -{ -} - -void monitor_set_error(Monitor *mon, QError *qerror) -{ -} diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 7672c69a29..a2603947db 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,11 +1,24 @@ stub-obj-y += arch-query-cpu-def.o +stub-obj-y += clock-warp.o +stub-obj-y += cpu-get-clock.o +stub-obj-y += cpu-get-icount.o stub-obj-y += fdset-add-fd.o stub-obj-y += fdset-find-fd.o stub-obj-y += fdset-get-fd.o stub-obj-y += fdset-remove-fd.o stub-obj-y += get-fd.o -stub-obj-y += set-fd-handler.o +stub-obj-y += get-vm-name.o +stub-obj-y += iothread-lock.o +stub-obj-y += migr-blocker.o +stub-obj-y += mon-is-qmp.o +stub-obj-y += mon-printf.o +stub-obj-y += mon-print-filename.o +stub-obj-y += mon-protocol-event.o +stub-obj-y += mon-set-error.o stub-obj-y += reset.o -stub-obj-y += vmstate.o +stub-obj-y += set-fd-handler.o +stub-obj-y += slirp.o stub-obj-y += sysbus.o +stub-obj-y += vm-stop.o +stub-obj-y += vmstate.o stub-obj-$(CONFIG_WIN32) += fd-register.o diff --git a/stubs/clock-warp.c b/stubs/clock-warp.c new file mode 100644 index 0000000000..b64c462e73 --- /dev/null +++ b/stubs/clock-warp.c @@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "qemu/timer.h" + +void qemu_clock_warp(QEMUClock *clock) +{ +} + diff --git a/stubs/cpu-get-clock.c b/stubs/cpu-get-clock.c new file mode 100644 index 0000000000..5b34c976d9 --- /dev/null +++ b/stubs/cpu-get-clock.c @@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "qemu/timer.h" + +int64_t cpu_get_clock(void) +{ + return get_clock_realtime(); +} diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c new file mode 100644 index 0000000000..d68585965f --- /dev/null +++ b/stubs/cpu-get-icount.c @@ -0,0 +1,9 @@ +#include "qemu-common.h" +#include "qemu/timer.h" + +int use_icount; + +int64_t cpu_get_icount(void) +{ + abort(); +} diff --git a/stubs/get-vm-name.c b/stubs/get-vm-name.c new file mode 100644 index 0000000000..e5f619ffab --- /dev/null +++ b/stubs/get-vm-name.c @@ -0,0 +1,7 @@ +#include "qemu-common.h" + +const char *qemu_get_vm_name(void) +{ + return NULL; +} + diff --git a/stubs/iothread-lock.c b/stubs/iothread-lock.c new file mode 100644 index 0000000000..5d8aca1b37 --- /dev/null +++ b/stubs/iothread-lock.c @@ -0,0 +1,10 @@ +#include "qemu-common.h" +#include "qemu/main-loop.h" + +void qemu_mutex_lock_iothread(void) +{ +} + +void qemu_mutex_unlock_iothread(void) +{ +} diff --git a/stubs/migr-blocker.c b/stubs/migr-blocker.c new file mode 100644 index 0000000000..300df6e205 --- /dev/null +++ b/stubs/migr-blocker.c @@ -0,0 +1,10 @@ +#include "qemu-common.h" +#include "migration/migration.h" + +void migrate_add_blocker(Error *reason) +{ +} + +void migrate_del_blocker(Error *reason) +{ +} diff --git a/stubs/mon-is-qmp.c b/stubs/mon-is-qmp.c new file mode 100644 index 0000000000..1f0a8fd98a --- /dev/null +++ b/stubs/mon-is-qmp.c @@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +int monitor_cur_is_qmp(void) +{ + return 0; +} diff --git a/stubs/mon-print-filename.c b/stubs/mon-print-filename.c new file mode 100644 index 0000000000..9c939641ff --- /dev/null +++ b/stubs/mon-print-filename.c @@ -0,0 +1,6 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +void monitor_print_filename(Monitor *mon, const char *filename) +{ +} diff --git a/stubs/mon-printf.c b/stubs/mon-printf.c new file mode 100644 index 0000000000..0ce2ca6925 --- /dev/null +++ b/stubs/mon-printf.c @@ -0,0 +1,10 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +void monitor_printf(Monitor *mon, const char *fmt, ...) +{ +} + +void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) +{ +} diff --git a/stubs/mon-protocol-event.c b/stubs/mon-protocol-event.c new file mode 100644 index 0000000000..0946e94724 --- /dev/null +++ b/stubs/mon-protocol-event.c @@ -0,0 +1,6 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +void monitor_protocol_event(MonitorEvent event, QObject *data) +{ +} diff --git a/stubs/mon-set-error.c b/stubs/mon-set-error.c new file mode 100644 index 0000000000..d0411f97fa --- /dev/null +++ b/stubs/mon-set-error.c @@ -0,0 +1,8 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +Monitor *cur_mon; + +void monitor_set_error(Monitor *mon, QError *qerror) +{ +} diff --git a/stubs/slirp.c b/stubs/slirp.c new file mode 100644 index 0000000000..9a3309a2b9 --- /dev/null +++ b/stubs/slirp.c @@ -0,0 +1,17 @@ +#include "qemu-common.h" +#include "slirp/slirp.h" + +void slirp_update_timeout(uint32_t *timeout) +{ +} + +void slirp_select_fill(int *pnfds, fd_set *readfds, + fd_set *writefds, fd_set *xfds) +{ +} + +void slirp_select_poll(fd_set *readfds, fd_set *writefds, + fd_set *xfds, int select_error) +{ +} + diff --git a/stubs/vm-stop.c b/stubs/vm-stop.c new file mode 100644 index 0000000000..45689354f6 --- /dev/null +++ b/stubs/vm-stop.c @@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "sysemu/sysemu.h" + +void vm_stop(RunState state) +{ + abort(); +} diff --git a/tests/Makefile b/tests/Makefile index b09a3437cd..cfd2d6aebd 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -70,7 +70,7 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ tests/test-qmp-commands.o tests/test-visitor-serialization.o -test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) qemu-tool.o +test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o test-qapi-obj-y += module.o @@ -81,7 +81,7 @@ tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o -tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o +tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemustub.a tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a @@ -98,13 +98,13 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@") -tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) -tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) -tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) -tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) -tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) -tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) -tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) +tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemustub.a +tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemustub.a tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y) From f141ccfa15096a7610b9973ae5ebae6562625a8d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 18:32:53 +0100 Subject: [PATCH 03/27] build: make libtool verbose when making with V=1 Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 2 +- rules.mak | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index c26aac65c3..9fa109f8ae 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -36,7 +36,7 @@ install-libcacard: @echo "libtool is missing, please install and rerun configure"; exit 1 else libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) - $(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") + $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") libcacard_srcpath=$(SRC_PATH)/libcacard libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in diff --git a/rules.mak b/rules.mak index fe0c881a3a..927301251e 100644 --- a/rules.mak +++ b/rules.mak @@ -24,8 +24,9 @@ ifeq ($(LIBTOOL),) %.lo: %.c @echo "missing libtool. please install and rerun configure"; exit 1 else +LIBTOOL += $(if $(V),,--quiet) %.lo: %.c - $(call quiet-command,$(LIBTOOL) --mode=compile --quiet --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") + $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") endif %.asm: %.S From 2165588274332e9f08891d5b22d56f4c0b7dc437 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 18:57:45 +0100 Subject: [PATCH 04/27] build: support linking with libtool objects/libraries This patch moves the complication of using libtool to the generic rules.mak file. Signed-off-by: Paolo Bonzini --- configure | 8 +++++++- libcacard/Makefile | 11 +++++++---- rules.mak | 10 ++++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/configure b/configure index ea42fe2457..5ae203df08 100755 --- a/configure +++ b/configure @@ -3721,7 +3721,13 @@ echo "MAKE=$make" >> $config_host_mak echo "INSTALL=$install" >> $config_host_mak echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak -echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak +if test -n "$libtool"; then + echo "INSTALL_PROG=\$(LIBTOOL) --mode=install $install -c -m 0755" >> $config_host_mak + echo "INSTALL_LIB=\$(LIBTOOL) --mode=install $install -c -m 0644" >> $config_host_mak +else + echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak + echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak +fi echo "PYTHON=$python" >> $config_host_mak echo "CC=$cc" >> $config_host_mak echo "CC_I386=$cc_i386" >> $config_host_mak diff --git a/libcacard/Makefile b/libcacard/Makefile index 9fa109f8ae..34d503b8cc 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -10,6 +10,9 @@ $(call set-vpath, $(SRC_PATH)) QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(stub-obj-y) QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS)) +# libtool will build the .o files, too +$(libcacard-obj-y): | $(libcacard-lobj-y) + QEMU_CFLAGS+=-I../ libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y)) @@ -54,10 +57,10 @@ install-libcacard: libcacard.pc libcacard.la vscclient $(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig" $(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)" $(INSTALL_DIR) "$(DESTDIR)$(bindir)" - $(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" - $(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)" - $(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" + $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" + $(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)" + $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" for inc in *.h; do \ - $(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ + $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ done endif diff --git a/rules.mak b/rules.mak index 927301251e..4673aada07 100644 --- a/rules.mak +++ b/rules.mak @@ -23,10 +23,18 @@ QEMU_CFLAGS += -I$( Date: Fri, 21 Dec 2012 09:23:18 +0100 Subject: [PATCH 05/27] build: move dtrace rules to rules.mak Signed-off-by: Paolo Bonzini --- rules.mak | 9 +++++++++ trace/Makefile.objs | 12 ------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/rules.mak b/rules.mak index 4673aada07..5865e9ba93 100644 --- a/rules.mak +++ b/rules.mak @@ -23,6 +23,9 @@ QEMU_CFLAGS += -I$( Date: Thu, 20 Dec 2012 20:39:36 +0100 Subject: [PATCH 06/27] build: remove CONFIG_SMARTCARD The passthru smartcard does not have the shared library dependency, build it unconditionally. Signed-off-by: Paolo Bonzini --- configure | 69 +++++++++++++++++--------------------------- hw/Makefile.objs | 2 +- hw/usb/Makefile.objs | 2 +- 3 files changed, 28 insertions(+), 45 deletions(-) diff --git a/configure b/configure index 5ae203df08..35762f5b5d 100755 --- a/configure +++ b/configure @@ -214,7 +214,6 @@ trace_backend="nop" trace_file="trace" spice="" rbd="" -smartcard="" smartcard_nss="" usb_redir="" opengl="" @@ -861,10 +860,6 @@ for opt do ;; --enable-xfsctl) xfs="yes" ;; - --disable-smartcard) smartcard="no" - ;; - --enable-smartcard) smartcard="yes" - ;; --disable-smartcard-nss) smartcard_nss="no" ;; --enable-smartcard-nss) smartcard_nss="yes" @@ -1128,8 +1123,6 @@ echo " --enable-spice enable spice" echo " --enable-rbd enable building the rados block device (rbd)" echo " --disable-libiscsi disable iscsi support" echo " --enable-libiscsi enable iscsi support" -echo " --disable-smartcard disable smartcard support" -echo " --enable-smartcard enable smartcard support" echo " --disable-smartcard-nss disable smartcard nss support" echo " --enable-smartcard-nss enable smartcard nss support" echo " --disable-usb-redir disable usb network redirection support" @@ -2813,42 +2806,36 @@ EOF fi # check for libcacard for smartcard support -if test "$smartcard" != "no" ; then - smartcard="yes" - smartcard_cflags="" - # TODO - what's the minimal nss version we support? - if test "$smartcard_nss" != "no"; then - cat > $TMPC << EOF +smartcard_cflags="" +# TODO - what's the minimal nss version we support? +if test "$smartcard_nss" != "no"; then + cat > $TMPC << EOF #include int main(void) { PK11_FreeSlot(0); return 0; } EOF - smartcard_includes="-I\$(SRC_PATH)/libcacard" - libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" - libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" - test_cflags="$libcacard_cflags" - # The header files in nss < 3.13.3 have a bug which causes them to - # emit a warning. If we're going to compile QEMU with -Werror, then - # test that the headers don't have this bug. Otherwise we would pass - # the configure test but fail to compile QEMU later. - if test "$werror" = "yes"; then - test_cflags="-Werror $test_cflags" - fi - if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ - compile_prog "$test_cflags" "$libcacard_libs"; then - smartcard_nss="yes" - QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" - QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" - libs_softmmu="$libcacard_libs $libs_softmmu" - else - if test "$smartcard_nss" = "yes"; then - feature_not_found "nss" - fi - smartcard_nss="no" - fi + smartcard_includes="-I\$(SRC_PATH)/libcacard" + libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" + libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" + test_cflags="$libcacard_cflags" + # The header files in nss < 3.13.3 have a bug which causes them to + # emit a warning. If we're going to compile QEMU with -Werror, then + # test that the headers don't have this bug. Otherwise we would pass + # the configure test but fail to compile QEMU later. + if test "$werror" = "yes"; then + test_cflags="-Werror $test_cflags" + fi + if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + compile_prog "$test_cflags" "$libcacard_libs"; then + smartcard_nss="yes" + QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" + QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" + libs_softmmu="$libcacard_libs $libs_softmmu" + else + if test "$smartcard_nss" = "yes"; then + feature_not_found "nss" + fi + smartcard_nss="no" fi -fi -if test "$smartcard" = "no" ; then - smartcard_nss="no" fi # check for usbredirparser for usb network redirection support @@ -3594,10 +3581,6 @@ if test "$spice" = "yes" ; then echo "CONFIG_SPICE=y" >> $config_host_mak fi -if test "$smartcard" = "yes" ; then - echo "CONFIG_SMARTCARD=y" >> $config_host_mak -fi - if test "$smartcard_nss" = "yes" ; then echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak echo "libcacard_libs=$libcacard_libs" >> $config_host_mak diff --git a/hw/Makefile.objs b/hw/Makefile.objs index d8671847fe..6fdd25e4b0 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -37,7 +37,7 @@ common-obj-$(CONFIG_DMA) += dma.o common-obj-$(CONFIG_I82374) += i82374.o common-obj-$(CONFIG_HPET) += hpet.o common-obj-$(CONFIG_APPLESMC) += applesmc.o -common-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o +common-obj-y += ccid-card-passthru.o common-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o common-obj-y += fifo.o diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index dad4cb9f3c..d1bbbc06e7 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -4,11 +4,11 @@ common-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o hcd-ehci-pci.o hcd-ehci-sysbus.o common-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o common-obj-y += libhw.o -common-obj-$(CONFIG_SMARTCARD) += dev-smartcard-reader.o common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o common-obj-y += core.o combined-packet.o bus.o desc.o dev-hub.o common-obj-y += host-$(HOST_USB).o dev-bluetooth.o common-obj-y += dev-hid.o dev-storage.o dev-wacom.o common-obj-y += dev-serial.o dev-network.o dev-audio.o +common-obj-y += dev-smartcard-reader.o common-obj-y += dev-uas.o From e832341bde5448a6a1392ea903a553497a13763b Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 28 Nov 2012 11:16:26 +0200 Subject: [PATCH 07/27] libcacard: fix missing symbol in libcacard.so Before patch: $ make libcacard.la $ nm ./libcacard/.libs/libcacard.so.0.0.0 | grep " U " | \ egrep -v "(g_)|(GLIBC)|(SECMOD)|(PK11)|(CERT)|(NSS)|(PORT)|(PR)" U error_set Signed-off-by: Alon Levy Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index 34d503b8cc..08a47e0207 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -7,7 +7,7 @@ libcacard_includedir=$(includedir)/cacard $(call set-vpath, $(SRC_PATH)) # objects linked into a shared library, built with libtool with -fPIC if required -QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(stub-obj-y) +QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o error.o $(trace-obj-y) $(stub-obj-y) QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS)) # libtool will build the .o files, too From b6fc675b25d32f018870e202eb4b2a6eb509f88b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 20:40:35 +0100 Subject: [PATCH 08/27] libcacard: require libtool to build it Do not fail at build time, instead just disable the library if libtool is not present. Signed-off-by: Paolo Bonzini --- Makefile | 2 ++ configure | 3 ++- libcacard/Makefile | 8 -------- rules.mak | 6 +----- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 3c960a166f..f035a61ce3 100644 --- a/Makefile +++ b/Makefile @@ -160,12 +160,14 @@ libqemustub.a: $(stub-obj-y) ###################################################################### # Support building shared library libcacard +ifeq ($(CONFIG_SMARTCARD_NSS),y) .PHONY: libcacard.la install-libcacard libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,) install-libcacard: libcacard.la $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,) +endif ###################################################################### diff --git a/configure b/configure index 35762f5b5d..39358add77 100755 --- a/configure +++ b/configure @@ -2824,7 +2824,8 @@ EOF if test "$werror" = "yes"; then test_cflags="-Werror $test_cflags" fi - if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + if test -n "$libtool" && + $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ compile_prog "$test_cflags" "$libcacard_libs"; then smartcard_nss="yes" QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" diff --git a/libcacard/Makefile b/libcacard/Makefile index 08a47e0207..a526eaeabd 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -31,13 +31,6 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -ifeq ($(LIBTOOL),) -libcacard.la: - @echo "libtool is missing, please install and rerun configure"; exit 1 - -install-libcacard: - @echo "libtool is missing, please install and rerun configure"; exit 1 -else libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") @@ -63,4 +56,3 @@ install-libcacard: libcacard.pc libcacard.la vscclient for inc in *.h; do \ $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ done -endif diff --git a/rules.mak b/rules.mak index 5865e9ba93..4297345474 100644 --- a/rules.mak +++ b/rules.mak @@ -21,11 +21,7 @@ QEMU_CFLAGS += -I$( Date: Fri, 21 Dec 2012 09:16:33 +0100 Subject: [PATCH 09/27] libcacard: prepare to use -y trick in the Makefile Rename variables to follow the conventions of the rest of the build systems. Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index a526eaeabd..ddab5d8297 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -7,17 +7,15 @@ libcacard_includedir=$(includedir)/cacard $(call set-vpath, $(SRC_PATH)) # objects linked into a shared library, built with libtool with -fPIC if required -QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o error.o $(trace-obj-y) $(stub-obj-y) -QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS)) +libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) # libtool will build the .o files, too $(libcacard-obj-y): | $(libcacard-lobj-y) QEMU_CFLAGS+=-I../ -libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y)) - -vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o cutils.o +vscclient: vscclient.o $(libcacard-obj-y) $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@") clean: @@ -31,7 +29,7 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) +libcacard.la: $(libcacard-lobj-y) $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") libcacard_srcpath=$(SRC_PATH)/libcacard From af0c8e9f3c75a23905b97be6f6e530acaa7bedc3 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 21 Dec 2012 09:13:10 +0100 Subject: [PATCH 10/27] libcacard: use per-target variable definitions This lets the libcacard Makefile use more rules.mak magic. Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index ddab5d8297..7fc6a06b8d 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -15,8 +15,9 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) QEMU_CFLAGS+=-I../ +vscclient: LIBS += $(libcacard_libs) vscclient: vscclient.o $(libcacard-obj-y) - $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@") + $(call LINK,$^) clean: rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc @@ -29,8 +30,10 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library +libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined +libcacard.la: LIBS += $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) - $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") + $(call LINK,$^) libcacard_srcpath=$(SRC_PATH)/libcacard libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in From 5018f1cc9f9e2b68c12671e83cd1e3c6a12ec2b5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 18:19:51 +0100 Subject: [PATCH 11/27] libcacard: add list of exported symbols Do not export internal QEMU symbols. Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 3 +- libcacard/libcacard.syms | 77 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 libcacard/libcacard.syms diff --git a/libcacard/Makefile b/libcacard/Makefile index 7fc6a06b8d..73fc817759 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -30,7 +30,8 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined +libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \ + -export-syms $(SRC_PATH)/libcacard/libcacard.syms libcacard.la: LIBS += $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) $(call LINK,$^) diff --git a/libcacard/libcacard.syms b/libcacard/libcacard.syms new file mode 100644 index 0000000000..1697515a7f --- /dev/null +++ b/libcacard/libcacard.syms @@ -0,0 +1,77 @@ +cac_card_init +cac_is_cac_card +vcard_add_applet +vcard_apdu_delete +vcard_apdu_new +vcard_applet_get_aid +vcard_buffer_response_delete +vcard_buffer_response_new +vcard_delete_applet +vcard_emul_delete_key +vcard_emul_force_card_insert +vcard_emul_force_card_remove +vcard_emul_get_atr +vcard_emul_get_login_count +vcard_emul_init +vcard_emul_login +vcard_emul_options +vcard_emul_replay_insertion_events +vcard_emul_reset +vcard_emul_rsa_op +vcard_emul_type_from_string +vcard_emul_type_select +vcard_emul_usage +vcard_find_applet +vcard_free +vcard_get_atr +vcard_get_buffer_response +vcard_get_current_applet_private +vcard_get_private +vcard_get_type +vcard_init +vcard_make_response +vcard_new +vcard_new_applet +vcard_process_apdu +vcard_process_applet_apdu +vcard_reference +vcard_reset +vcard_response_delete +vcard_response_new +vcard_response_new_bytes +vcard_response_new_data +vcard_response_new_status_bytes +vcard_select_applet +vcard_set_applet_private +vcard_set_atr_func +vcard_set_buffer_response +vcard_set_type +vevent_delete +vevent_get_next_vevent +vevent_new +vevent_queue_init +vevent_queue_vevent +vevent_wait_next_vevent +vreader_add_reader +vreader_card_is_present +vreader_free +vreader_get_id +vreader_get_name +vreader_get_private +vreader_get_reader_by_id +vreader_get_reader_by_name +vreader_get_reader_list +vreader_init +vreader_insert_card +vreader_list_delete +vreader_list_get_first +vreader_list_get_next +vreader_list_get_reader +vreader_new +vreader_power_off +vreader_power_on +vreader_queue_card_event +vreader_reference +vreader_remove_reader +vreader_set_id +vreader_xfr_bytes From 992aeb8eb53e5846a957cf333f2e1ec8cb6e0c04 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 21 Dec 2012 08:34:49 +0100 Subject: [PATCH 12/27] libcacard: rewrite Makefile in non-recursive style Signed-off-by: Paolo Bonzini --- Makefile | 35 +++++++++-------------------------- configure | 9 +-------- libcacard/Makefile | 37 +++++++++++-------------------------- 3 files changed, 21 insertions(+), 60 deletions(-) diff --git a/Makefile b/Makefile index f035a61ce3..039d07011b 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,14 @@ defconfig: -include config-all-devices.mak -include config-all-disas.mak +ifneq ($(wildcard config-host.mak),) +include $(SRC_PATH)/Makefile.objs +include $(SRC_PATH)/tests/Makefile +endif +ifeq ($(CONFIG_SMARTCARD_NSS),y) +include $(SRC_PATH)/libcacard/Makefile +endif + all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all config-host.h: config-host.h-timestamp @@ -116,12 +124,6 @@ SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) subdir-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,) -ifneq ($(wildcard config-host.mak),) -include $(SRC_PATH)/Makefile.objs -endif - -subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o - subdir-pixman: pixman/Makefile $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,) @@ -157,18 +159,6 @@ version-obj-$(CONFIG_WIN32) += version.o libqemustub.a: $(stub-obj-y) -###################################################################### -# Support building shared library libcacard - -ifeq ($(CONFIG_SMARTCARD_NSS),y) -.PHONY: libcacard.la install-libcacard -libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,) - -install-libcacard: libcacard.la - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,) -endif - ###################################################################### qemu-img.o: qemu-img-cmds.h @@ -183,10 +173,6 @@ qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o -vscclient$(EXESUF): LIBS += $(libcacard_libs) -vscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) $(trace-obj-y) libcacard/vscclient.o libqemustub.a - $(call LINK, $^) - fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y) fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap @@ -198,10 +184,6 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated gen-out-type = $(subst .,-,$(suffix $@)) -ifneq ($(wildcard config-host.mak),) -include $(SRC_PATH)/tests/Makefile -endif - qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ @@ -236,6 +218,7 @@ clean: rm -f qemu-options.def find . -name '*.[od]' -type f -exec rm -f {} + rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~ + rm -f *.la rm -Rf .libs rm -f qemu-img-cmds.h @# May not be present in GENERATED_HEADERS diff --git a/configure b/configure index 39358add77..27ef38c6a3 100755 --- a/configure +++ b/configure @@ -3191,9 +3191,6 @@ if test "$softmmu" = yes ; then tools="qemu-ga\$(EXESUF) $tools" fi fi - if test "$smartcard_nss" = "yes" ; then - tools="vscclient\$(EXESUF) $tools" - fi fi # Mac OS X ships with a broken assembler @@ -4039,9 +4036,6 @@ fi if test "$target_softmmu" = "yes" ; then echo "CONFIG_SOFTMMU=y" >> $config_target_mak echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak - if test "$smartcard_nss" = "yes" ; then - echo "subdir-$target: subdir-libcacard" >> $config_host_mak - fi case "$target_arch2" in i386|x86_64) echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak @@ -4242,10 +4236,9 @@ DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas" DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS qapi-generated" -DIRS="$DIRS libcacard libcacard/libcacard libcacard/trace" FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" -FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile" +FILES="$FILES tests/tcg/lm32/Makefile" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" diff --git a/libcacard/Makefile b/libcacard/Makefile index 73fc817759..734065eff8 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -1,10 +1,6 @@ --include ../config-host.mak --include $(SRC_PATH)/rules.mak --include $(SRC_PATH)/Makefile.objs - libcacard_includedir=$(includedir)/cacard -$(call set-vpath, $(SRC_PATH)) +TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y) @@ -13,19 +9,11 @@ libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) # libtool will build the .o files, too $(libcacard-obj-y): | $(libcacard-lobj-y) -QEMU_CFLAGS+=-I../ - -vscclient: LIBS += $(libcacard_libs) -vscclient: vscclient.o $(libcacard-obj-y) - $(call LINK,$^) - -clean: - rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc - rm -Rf .libs */.libs - all: libcacard.la libcacard.pc -# Dummy command so that make thinks it has done something - @true + +vscclient$(EXESUF): LIBS += $(libcacard_libs) +vscclient$(EXESUF): libcacard/vscclient.o $(libcacard-obj-y) + $(call LINK,$^) ######################################################################### # Rules for building libcacard standalone library @@ -36,25 +24,22 @@ libcacard.la: LIBS += $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) $(call LINK,$^) -libcacard_srcpath=$(SRC_PATH)/libcacard -libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in +libcacard.pc: $(SRC_PATH)/libcacard/libcacard.pc.in $(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \ -e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \ -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \ - -e 's|@PREFIX@|$(prefix)|' \ - < $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc,\ + -e 's|@PREFIX@|$(prefix)|' $< > libcacard.pc,\ " GEN $@") .PHONY: install-libcacard -install-libcacard: libcacard.pc libcacard.la vscclient +install: install-libcacard +install-libcacard: libcacard.pc libcacard.la $(INSTALL_DIR) "$(DESTDIR)$(libdir)" $(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig" $(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)" - $(INSTALL_DIR) "$(DESTDIR)$(bindir)" - $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" $(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)" $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" - for inc in *.h; do \ - $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ + for inc in $(SRC_PATH)/libcacard/*.h; do \ + $(INSTALL_DATA) $$inc "$(DESTDIR)$(libcacard_includedir)"; \ done From 26ca8c06d2e4fb43903c9d5e8ebe27792ffc461b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 21 Dec 2012 08:42:03 +0100 Subject: [PATCH 13/27] libcacard: link vscclient to dynamic library There is no reason for vscclient to duplicate the code. rules.mak takes care of invoking libtool to do the link. Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index 734065eff8..259ecf257d 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -11,8 +11,7 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) all: libcacard.la libcacard.pc -vscclient$(EXESUF): LIBS += $(libcacard_libs) -vscclient$(EXESUF): libcacard/vscclient.o $(libcacard-obj-y) +vscclient$(EXESUF): libcacard/vscclient.o libcacard.la $(call LINK,$^) ######################################################################### From d9dc91ace82d1c4ca6f2c6f10a9cfcacf988662e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 18:24:27 +0100 Subject: [PATCH 14/27] libcacard: list oslib-obj-y file explicitly We will grow the list of files in the next patches, but libcacard should remain slim. Signed-off-by: Paolo Bonzini --- libcacard/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index 259ecf257d..63295f5ae6 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -3,7 +3,11 @@ libcacard_includedir=$(includedir)/cacard TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required -libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-obj-y = $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-obj-y += osdep.o cutils.o qemu-timer-common.o error.o +libcacard-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o +libcacard-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o + libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) # libtool will build the .o files, too From e4b42e6ebc2442f5ae9885d62171599cc682b4f5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 14:34:31 +0100 Subject: [PATCH 15/27] build: rename oslib-obj-y to util-obj-y This prepares the creation of libqemuutil.a in the next patch. Signed-off-by: Paolo Bonzini --- Makefile | 4 ++-- Makefile.objs | 10 +++++----- Makefile.target | 4 ++-- tests/Makefile | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 039d07011b..965ffebce2 100644 --- a/Makefile +++ b/Makefile @@ -163,7 +163,7 @@ libqemustub.a: $(stub-obj-y) qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-timer.o \ +tools-obj-y = $(util-obj-y) $(trace-obj-y) qemu-timer.o \ main-loop.o iohandler.o error.o tools-obj-$(CONFIG_POSIX) += compatfd.o @@ -209,7 +209,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(oslib-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(util-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a $(call LINK, $^) clean: diff --git a/Makefile.objs b/Makefile.objs index c64c0c69da..56d95e5d8e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -29,10 +29,10 @@ hw-core-obj-y += qemu-option.o universal-obj-y += $(hw-core-obj-y) ####################################################################### -# oslib-obj-y is code depending on the OS (win32 vs posix) -oslib-obj-y = osdep.o cutils.o qemu-timer-common.o -oslib-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o -oslib-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o +# util-obj-y is code depending on the OS (win32 vs posix) +util-obj-y = osdep.o cutils.o qemu-timer-common.o +util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o +util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o ####################################################################### # coroutines @@ -78,7 +78,7 @@ common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/ common-obj-y += net/ common-obj-y += qom/ common-obj-y += readline.o -common-obj-y += $(oslib-obj-y) +common-obj-y += $(util-obj-y) common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o diff --git a/Makefile.target b/Makefile.target index 5bfa496080..2534e77a11 100644 --- a/Makefile.target +++ b/Makefile.target @@ -83,7 +83,7 @@ ifdef CONFIG_LINUX_USER QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user obj-y += linux-user/ -obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y) +obj-y += gdbstub.o thunk.o user-exec.o $(util-obj-y) endif #CONFIG_LINUX_USER @@ -95,7 +95,7 @@ ifdef CONFIG_BSD_USER QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) obj-y += bsd-user/ -obj-y += gdbstub.o user-exec.o $(oslib-obj-y) +obj-y += gdbstub.o user-exec.o $(util-obj-y) endif #CONFIG_BSD_USER diff --git a/tests/Makefile b/tests/Makefile index cfd2d6aebd..693d137760 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -117,7 +117,7 @@ TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y)) -qtest-obj-y = tests/libqtest.o $(oslib-obj-y) libqemustub.a +qtest-obj-y = tests/libqtest.o $(util-obj-y) libqemustub.a $(check-qtest-y): $(qtest-obj-y) .PHONY: check-help From 8a090705b4485eaed602632963cc53acaf3ba12e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 15:40:20 +0100 Subject: [PATCH 16/27] build: move util-obj-y to libqemuutil.a Use a static library to eliminate repetition in the linking rules. Signed-off-by: Paolo Bonzini --- Makefile | 17 +++++++++-------- Makefile.objs | 1 - Makefile.target | 8 ++++---- tests/Makefile | 17 ++++++++--------- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 965ffebce2..0b470ecac7 100644 --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure $(SRC_PATH)/pixman/configure: (cd $(SRC_PATH)/pixman; autoreconf -v --install) -$(SUBDIR_RULES): libqemustub.a +$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y) @@ -155,25 +155,26 @@ version.o: $(SRC_PATH)/version.rc config-host.h version-obj-$(CONFIG_WIN32) += version.o ###################################################################### -# Build library with stubs +# Build libraries libqemustub.a: $(stub-obj-y) +libqemuutil.a: $(util-obj-y) ###################################################################### qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(util-obj-y) $(trace-obj-y) qemu-timer.o \ +tools-obj-y = $(trace-obj-y) qemu-timer.o \ main-loop.o iohandler.o error.o tools-obj-$(CONFIG_POSIX) += compatfd.o -qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemustub.a -qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemustub.a -qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a +qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o -fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y) +fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o $(trace-obj-y) libqemuutil.a libqemustub.a fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx @@ -209,7 +210,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(util-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean: diff --git a/Makefile.objs b/Makefile.objs index 56d95e5d8e..a5bfc7da8e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -78,7 +78,6 @@ common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/ common-obj-y += net/ common-obj-y += qom/ common-obj-y += readline.o -common-obj-y += $(util-obj-y) common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o diff --git a/Makefile.target b/Makefile.target index 2534e77a11..0a12873ff0 100644 --- a/Makefile.target +++ b/Makefile.target @@ -83,7 +83,7 @@ ifdef CONFIG_LINUX_USER QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user obj-y += linux-user/ -obj-y += gdbstub.o thunk.o user-exec.o $(util-obj-y) +obj-y += gdbstub.o thunk.o user-exec.o endif #CONFIG_LINUX_USER @@ -95,7 +95,7 @@ ifdef CONFIG_BSD_USER QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) obj-y += bsd-user/ -obj-y += gdbstub.o user-exec.o $(util-obj-y) +obj-y += gdbstub.o user-exec.o endif #CONFIG_BSD_USER @@ -155,12 +155,12 @@ endif #CONFIG_LINUX_USER ifdef QEMU_PROGW # The linker builds a windows executable. Make also a console executable. -$(QEMU_PROGW): $(all-obj-y) ../libqemustub.a +$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a $(call LINK,$^) $(QEMU_PROG): $(QEMU_PROGW) $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)") else -$(QEMU_PROG): $(all-obj-y) ../libqemustub.a +$(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a $(call LINK,$^) endif diff --git a/tests/Makefile b/tests/Makefile index 693d137760..329c912a0d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -72,7 +72,6 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o -test-qapi-obj-y += module.o $(test-obj-y): QEMU_INCLUDES += -Itests @@ -98,13 +97,13 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@") -tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemustub.a -tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemustub.a +tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y) @@ -117,7 +116,7 @@ TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y)) -qtest-obj-y = tests/libqtest.o $(util-obj-y) libqemustub.a +qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a $(check-qtest-y): $(qtest-obj-y) .PHONY: check-help From f157ebba2de4a6225679e13cc1ce01ff5d147c76 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 16:09:36 +0100 Subject: [PATCH 17/27] build: move files away from tools-obj-y, common-obj-y, user-obj-y Split them between libqemuutil.a and, for those used by qemu-img/io/nbd, block-obj-y. Static libraries ensure that binaries such as qemu-ga do not include unused modules. Signed-off-by: Paolo Bonzini --- Makefile | 10 +++------- Makefile.objs | 41 +++++++++++++++++++---------------------- tests/Makefile | 10 +++++----- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 0b470ecac7..989cb1f6a5 100644 --- a/Makefile +++ b/Makefile @@ -164,13 +164,9 @@ libqemuutil.a: $(util-obj-y) qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(trace-obj-y) qemu-timer.o \ - main-loop.o iohandler.o error.o -tools-obj-$(CONFIG_POSIX) += compatfd.o - -qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-img$(EXESUF): qemu-img.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-nbd$(EXESUF): qemu-nbd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-io$(EXESUF): qemu-io.o cmd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o diff --git a/Makefile.objs b/Makefile.objs index a5bfc7da8e..1c88fc1451 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -11,7 +11,7 @@ universal-obj-y += qemu-log.o # QObject qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o -qobject-obj-y += qerror.o error.o qemu-error.o +qobject-obj-y += qerror.o universal-obj-y += $(qobject-obj-y) @@ -24,15 +24,21 @@ universal-obj-y += $(qom-obj-y) ####################################################################### # Core hw code (qdev core) hw-core-obj-y += hw/ -hw-core-obj-y += qemu-option.o universal-obj-y += $(hw-core-obj-y) ####################################################################### # util-obj-y is code depending on the OS (win32 vs posix) util-obj-y = osdep.o cutils.o qemu-timer-common.o -util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o -util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o +util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win32.o +util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o +util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o +util-obj-y += bitmap.o bitops.o +util-obj-y += acl.o +util-obj-y += error.o qemu-error.o +util-obj-$(CONFIG_POSIX) += compatfd.o +util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o +util-obj-y += qemu-option.o qemu-progress.o ####################################################################### # coroutines @@ -54,12 +60,12 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img -block-obj-y = iov.o cache-utils.o qemu-option.o module.o async.o -block-obj-y += nbd.o block.o blockjob.o aes.o qemu-config.o -block-obj-y += thread-pool.o qemu-progress.o qemu-sockets.o uri.o notify.o +block-obj-y = async.o thread-pool.o +block-obj-y += nbd.o block.o blockjob.o block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y) -block-obj-$(CONFIG_POSIX) += event_notifier-posix.o aio-posix.o -block-obj-$(CONFIG_WIN32) += event_notifier-win32.o aio-win32.o +block-obj-y += main-loop.o iohandler.o qemu-timer.o +block-obj-$(CONFIG_POSIX) += aio-posix.o +block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ block-obj-y += $(qapi-obj-y) qapi-types.o qapi-visit.o @@ -84,12 +90,10 @@ common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ extra-obj-$(CONFIG_LINUX) += fsdev/ -common-obj-y += tcg-runtime.o host-utils.o main-loop.o -common-obj-y += migration.o migration-tcp.o +common-obj-y += tcg-runtime.o common-obj-y += migration.o migration-tcp.o common-obj-y += qemu-char.o #aio.o -common-obj-y += block-migration.o iohandler.o -common-obj-y += bitmap.o bitops.o +common-obj-y += block-migration.o common-obj-y += page_cache.o common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o @@ -105,9 +109,6 @@ common-obj-y += ui/ common-obj-y += bt-host.o bt-vhci.o common-obj-y += dma-helpers.o -common-obj-y += acl.o -common-obj-$(CONFIG_POSIX) += compatfd.o -common-obj-y += qemu-timer.o qemu-timer-common.o common-obj-y += qtest.o common-obj-y += vl.o @@ -125,10 +126,7 @@ endif # libuser user-obj-y = -user-obj-y += envlist.o path.o -user-obj-y += tcg-runtime.o host-utils.o -user-obj-y += cache-utils.o -user-obj-y += module.o +user-obj-y += tcg-runtime.o user-obj-y += qom/ ###################################################################### @@ -169,8 +167,7 @@ universal-obj-y += $(qapi-obj-y) ###################################################################### # guest agent -qga-obj-y = qga/ module.o -qga-obj-$(CONFIG_POSIX) += qemu-sockets.o qemu-option.o +qga-obj-y = qga/ vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) diff --git a/tests/Makefile b/tests/Makefile index 329c912a0d..a398b4afb9 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -80,11 +80,11 @@ tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o -tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemustub.a -tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a -tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a -tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a -tests/test-iov$(EXESUF): tests/test-iov.o iov.o +tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemuutil.a libqemustub.a +tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-iov$(EXESUF): tests/test-iov.o libqemuutil.a tests/test-qapi-types.c tests/test-qapi-types.h :\ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py From baacf04799ace72a9c735dd9306a1ceaf305e7cf Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 15:58:44 +0100 Subject: [PATCH 18/27] build: move libqemuutil.a components to util/ Signed-off-by: Paolo Bonzini --- Makefile.objs | 12 ++---------- libcacard/Makefile | 6 +++--- util/Makefile.objs | 10 ++++++++++ acl.c => util/acl.c | 0 aes.c => util/aes.c | 0 bitmap.c => util/bitmap.c | 0 bitops.c => util/bitops.c | 0 cache-utils.c => util/cache-utils.c | 0 compatfd.c => util/compatfd.c | 0 cutils.c => util/cutils.c | 0 envlist.c => util/envlist.c | 0 error.c => util/error.c | 0 .../event_notifier-posix.c | 0 .../event_notifier-win32.c | 0 host-utils.c => util/host-utils.c | 0 iov.c => util/iov.c | 0 module.c => util/module.c | 0 notify.c => util/notify.c | 0 osdep.c => util/osdep.c | 0 oslib-posix.c => util/oslib-posix.c | 0 oslib-win32.c => util/oslib-win32.c | 0 path.c => util/path.c | 0 qemu-config.c => util/qemu-config.c | 0 qemu-error.c => util/qemu-error.c | 0 qemu-option.c => util/qemu-option.c | 0 qemu-progress.c => util/qemu-progress.c | 0 qemu-sockets.c => util/qemu-sockets.c | 0 qemu-thread-posix.c => util/qemu-thread-posix.c | 0 qemu-thread-win32.c => util/qemu-thread-win32.c | 0 qemu-timer-common.c => util/qemu-timer-common.c | 0 uri.c => util/uri.c | 0 31 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 util/Makefile.objs rename acl.c => util/acl.c (100%) rename aes.c => util/aes.c (100%) rename bitmap.c => util/bitmap.c (100%) rename bitops.c => util/bitops.c (100%) rename cache-utils.c => util/cache-utils.c (100%) rename compatfd.c => util/compatfd.c (100%) rename cutils.c => util/cutils.c (100%) rename envlist.c => util/envlist.c (100%) rename error.c => util/error.c (100%) rename event_notifier-posix.c => util/event_notifier-posix.c (100%) rename event_notifier-win32.c => util/event_notifier-win32.c (100%) rename host-utils.c => util/host-utils.c (100%) rename iov.c => util/iov.c (100%) rename module.c => util/module.c (100%) rename notify.c => util/notify.c (100%) rename osdep.c => util/osdep.c (100%) rename oslib-posix.c => util/oslib-posix.c (100%) rename oslib-win32.c => util/oslib-win32.c (100%) rename path.c => util/path.c (100%) rename qemu-config.c => util/qemu-config.c (100%) rename qemu-error.c => util/qemu-error.c (100%) rename qemu-option.c => util/qemu-option.c (100%) rename qemu-progress.c => util/qemu-progress.c (100%) rename qemu-sockets.c => util/qemu-sockets.c (100%) rename qemu-thread-posix.c => util/qemu-thread-posix.c (100%) rename qemu-thread-win32.c => util/qemu-thread-win32.c (100%) rename qemu-timer-common.c => util/qemu-timer-common.c (100%) rename uri.c => util/uri.c (100%) diff --git a/Makefile.objs b/Makefile.objs index 1c88fc1451..3b777c822e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -29,16 +29,7 @@ universal-obj-y += $(hw-core-obj-y) ####################################################################### # util-obj-y is code depending on the OS (win32 vs posix) -util-obj-y = osdep.o cutils.o qemu-timer-common.o -util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win32.o -util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o -util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o -util-obj-y += bitmap.o bitops.o -util-obj-y += acl.o -util-obj-y += error.o qemu-error.o -util-obj-$(CONFIG_POSIX) += compatfd.o -util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o -util-obj-y += qemu-option.o qemu-progress.o +util-obj-y += util/ ####################################################################### # coroutines @@ -177,6 +168,7 @@ QEMU_CFLAGS+=$(GLIB_CFLAGS) nested-vars += \ stub-obj-y \ + util-obj-y \ qga-obj-y \ qom-obj-y \ qapi-obj-y \ diff --git a/libcacard/Makefile b/libcacard/Makefile index 63295f5ae6..c658d3a9b7 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -4,9 +4,9 @@ TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required libcacard-obj-y = $(trace-obj-y) $(stub-obj-y) $(libcacard-y) -libcacard-obj-y += osdep.o cutils.o qemu-timer-common.o error.o -libcacard-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o -libcacard-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o +libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o util/error.o +libcacard-obj-$(CONFIG_WIN32) += util/oslib-win32.o util/qemu-thread-win32.o +libcacard-obj-$(CONFIG_POSIX) += util/oslib-posix.o util/qemu-thread-posix.o libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) diff --git a/util/Makefile.objs b/util/Makefile.objs new file mode 100644 index 0000000000..5baeb53af6 --- /dev/null +++ b/util/Makefile.objs @@ -0,0 +1,10 @@ +util-obj-y = osdep.o cutils.o qemu-timer-common.o +util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win32.o +util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o +util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o +util-obj-y += bitmap.o bitops.o +util-obj-y += acl.o +util-obj-y += error.o qemu-error.o +util-obj-$(CONFIG_POSIX) += compatfd.o +util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o +util-obj-y += qemu-option.o qemu-progress.o diff --git a/acl.c b/util/acl.c similarity index 100% rename from acl.c rename to util/acl.c diff --git a/aes.c b/util/aes.c similarity index 100% rename from aes.c rename to util/aes.c diff --git a/bitmap.c b/util/bitmap.c similarity index 100% rename from bitmap.c rename to util/bitmap.c diff --git a/bitops.c b/util/bitops.c similarity index 100% rename from bitops.c rename to util/bitops.c diff --git a/cache-utils.c b/util/cache-utils.c similarity index 100% rename from cache-utils.c rename to util/cache-utils.c diff --git a/compatfd.c b/util/compatfd.c similarity index 100% rename from compatfd.c rename to util/compatfd.c diff --git a/cutils.c b/util/cutils.c similarity index 100% rename from cutils.c rename to util/cutils.c diff --git a/envlist.c b/util/envlist.c similarity index 100% rename from envlist.c rename to util/envlist.c diff --git a/error.c b/util/error.c similarity index 100% rename from error.c rename to util/error.c diff --git a/event_notifier-posix.c b/util/event_notifier-posix.c similarity index 100% rename from event_notifier-posix.c rename to util/event_notifier-posix.c diff --git a/event_notifier-win32.c b/util/event_notifier-win32.c similarity index 100% rename from event_notifier-win32.c rename to util/event_notifier-win32.c diff --git a/host-utils.c b/util/host-utils.c similarity index 100% rename from host-utils.c rename to util/host-utils.c diff --git a/iov.c b/util/iov.c similarity index 100% rename from iov.c rename to util/iov.c diff --git a/module.c b/util/module.c similarity index 100% rename from module.c rename to util/module.c diff --git a/notify.c b/util/notify.c similarity index 100% rename from notify.c rename to util/notify.c diff --git a/osdep.c b/util/osdep.c similarity index 100% rename from osdep.c rename to util/osdep.c diff --git a/oslib-posix.c b/util/oslib-posix.c similarity index 100% rename from oslib-posix.c rename to util/oslib-posix.c diff --git a/oslib-win32.c b/util/oslib-win32.c similarity index 100% rename from oslib-win32.c rename to util/oslib-win32.c diff --git a/path.c b/util/path.c similarity index 100% rename from path.c rename to util/path.c diff --git a/qemu-config.c b/util/qemu-config.c similarity index 100% rename from qemu-config.c rename to util/qemu-config.c diff --git a/qemu-error.c b/util/qemu-error.c similarity index 100% rename from qemu-error.c rename to util/qemu-error.c diff --git a/qemu-option.c b/util/qemu-option.c similarity index 100% rename from qemu-option.c rename to util/qemu-option.c diff --git a/qemu-progress.c b/util/qemu-progress.c similarity index 100% rename from qemu-progress.c rename to util/qemu-progress.c diff --git a/qemu-sockets.c b/util/qemu-sockets.c similarity index 100% rename from qemu-sockets.c rename to util/qemu-sockets.c diff --git a/qemu-thread-posix.c b/util/qemu-thread-posix.c similarity index 100% rename from qemu-thread-posix.c rename to util/qemu-thread-posix.c diff --git a/qemu-thread-win32.c b/util/qemu-thread-win32.c similarity index 100% rename from qemu-thread-win32.c rename to util/qemu-thread-win32.c diff --git a/qemu-timer-common.c b/util/qemu-timer-common.c similarity index 100% rename from qemu-timer-common.c rename to util/qemu-timer-common.c diff --git a/uri.c b/util/uri.c similarity index 100% rename from uri.c rename to util/uri.c From a372823a14461c454feaa86373bd672fd518847a Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 16:10:26 +0100 Subject: [PATCH 19/27] build: move qobject files to qobject/ and libqemuutil.a Signed-off-by: Paolo Bonzini --- Makefile | 2 +- Makefile.objs | 17 +++-------------- qobject/Makefile.objs | 3 +++ json-lexer.c => qobject/json-lexer.c | 0 json-parser.c => qobject/json-parser.c | 0 json-streamer.c => qobject/json-streamer.c | 0 qbool.c => qobject/qbool.c | 0 qdict.c => qobject/qdict.c | 0 qerror.c => qobject/qerror.c | 0 qfloat.c => qobject/qfloat.c | 0 qint.c => qobject/qint.c | 0 qjson.c => qobject/qjson.c | 0 qlist.c => qobject/qlist.c | 0 qstring.c => qobject/qstring.c | 0 tests/Makefile | 14 +++++++------- 15 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 qobject/Makefile.objs rename json-lexer.c => qobject/json-lexer.c (100%) rename json-parser.c => qobject/json-parser.c (100%) rename json-streamer.c => qobject/json-streamer.c (100%) rename qbool.c => qobject/qbool.c (100%) rename qdict.c => qobject/qdict.c (100%) rename qerror.c => qobject/qerror.c (100%) rename qfloat.c => qobject/qfloat.c (100%) rename qint.c => qobject/qint.c (100%) rename qjson.c => qobject/qjson.c (100%) rename qlist.c => qobject/qlist.c (100%) rename qstring.c => qobject/qstring.c (100%) diff --git a/Makefile b/Makefile index 989cb1f6a5..ee39b364fb 100644 --- a/Makefile +++ b/Makefile @@ -206,7 +206,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean: diff --git a/Makefile.objs b/Makefile.objs index 3b777c822e..d412d8c6a8 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -1,20 +1,13 @@ ####################################################################### -# Stub library, linked in tools +# Common libraries for tools and emulators stub-obj-y = stubs/ +util-obj-y = util/ qobject/ ####################################################################### # Target-independent parts used in system and user emulation universal-obj-y = universal-obj-y += qemu-log.o -####################################################################### -# QObject -qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o -qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o -qobject-obj-y += qerror.o - -universal-obj-y += $(qobject-obj-y) - ####################################################################### # QOM qom-obj-y = qom/ @@ -27,10 +20,6 @@ hw-core-obj-y += hw/ universal-obj-y += $(hw-core-obj-y) -####################################################################### -# util-obj-y is code depending on the OS (win32 vs posix) -util-obj-y += util/ - ####################################################################### # coroutines coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o @@ -53,7 +42,7 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o block-obj-y = async.o thread-pool.o block-obj-y += nbd.o block.o blockjob.o -block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y) +block-obj-y += $(coroutine-obj-y) $(version-obj-y) block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o diff --git a/qobject/Makefile.objs b/qobject/Makefile.objs new file mode 100644 index 0000000000..c9ff59c6cc --- /dev/null +++ b/qobject/Makefile.objs @@ -0,0 +1,3 @@ +util-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o +util-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o +util-obj-y += qerror.o diff --git a/json-lexer.c b/qobject/json-lexer.c similarity index 100% rename from json-lexer.c rename to qobject/json-lexer.c diff --git a/json-parser.c b/qobject/json-parser.c similarity index 100% rename from json-parser.c rename to qobject/json-parser.c diff --git a/json-streamer.c b/qobject/json-streamer.c similarity index 100% rename from json-streamer.c rename to qobject/json-streamer.c diff --git a/qbool.c b/qobject/qbool.c similarity index 100% rename from qbool.c rename to qobject/qbool.c diff --git a/qdict.c b/qobject/qdict.c similarity index 100% rename from qdict.c rename to qobject/qdict.c diff --git a/qerror.c b/qobject/qerror.c similarity index 100% rename from qerror.c rename to qobject/qerror.c diff --git a/qfloat.c b/qobject/qfloat.c similarity index 100% rename from qfloat.c rename to qobject/qfloat.c diff --git a/qint.c b/qobject/qint.c similarity index 100% rename from qint.c rename to qobject/qint.c diff --git a/qjson.c b/qobject/qjson.c similarity index 100% rename from qjson.c rename to qobject/qjson.c diff --git a/qlist.c b/qobject/qlist.c similarity index 100% rename from qlist.c rename to qobject/qlist.c diff --git a/qstring.c b/qobject/qstring.c similarity index 100% rename from qstring.c rename to qobject/qstring.c diff --git a/tests/Makefile b/tests/Makefile index a398b4afb9..837f769433 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -70,17 +70,17 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ tests/test-qmp-commands.o tests/test-visitor-serialization.o -test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) +test-qapi-obj-y = $(qapi-obj-y) test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o $(test-obj-y): QEMU_INCLUDES += -Itests -tests/check-qint$(EXESUF): tests/check-qint.o qint.o -tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o -tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o -tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o -tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o -tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemuutil.a libqemustub.a +tests/check-qint$(EXESUF): tests/check-qint.o libqemuutil.a +tests/check-qstring$(EXESUF): tests/check-qstring.o libqemuutil.a +tests/check-qdict$(EXESUF): tests/check-qdict.o libqemuutil.a +tests/check-qlist$(EXESUF): tests/check-qlist.o libqemuutil.a +tests/check-qfloat$(EXESUF): tests/check-qfloat.o libqemuutil.a +tests/check-qjson$(EXESUF): tests/check-qjson.o libqemuutil.a libqemustub.a tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a From 9444e9e640d56039253d885ba88c3fa818a00149 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 15:24:49 +0100 Subject: [PATCH 20/27] build: consolidate multiple variables into universal-obj-y The directory descent mechanism, and a less-flat tree both helped in making some *-obj-y definitions very short. Many of these often end up in universal-obj-y, and used to be separate only because of libuser (which is now part of history...). Consolidate these variables in a single one. Signed-off-by: Paolo Bonzini --- Makefile.objs | 46 +++++++++------------------------------------- Makefile.target | 7 +------ hw/Makefile.objs | 5 ++--- qom/Makefile.objs | 6 ++---- 4 files changed, 14 insertions(+), 50 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index d412d8c6a8..f2f43b2385 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -3,23 +3,6 @@ stub-obj-y = stubs/ util-obj-y = util/ qobject/ -####################################################################### -# Target-independent parts used in system and user emulation -universal-obj-y = -universal-obj-y += qemu-log.o - -####################################################################### -# QOM -qom-obj-y = qom/ - -universal-obj-y += $(qom-obj-y) - -####################################################################### -# Core hw code (qdev core) -hw-core-obj-y += hw/ - -universal-obj-y += $(hw-core-obj-y) - ####################################################################### # coroutines coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o @@ -62,7 +45,6 @@ endif common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/ common-obj-y += net/ -common-obj-y += qom/ common-obj-y += readline.o common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o @@ -70,7 +52,6 @@ common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ extra-obj-$(CONFIG_LINUX) += fsdev/ -common-obj-y += tcg-runtime.o common-obj-y += migration.o migration-tcp.o common-obj-y += qemu-char.o #aio.o common-obj-y += block-migration.o @@ -102,26 +83,11 @@ ifeq ($(CONFIG_SECCOMP),y) common-obj-y += qemu-seccomp.o endif -###################################################################### -# libuser - -user-obj-y = -user-obj-y += tcg-runtime.o -user-obj-y += qom/ - -###################################################################### -# disassemblers -# NOTE: the disassembler code is only needed for debugging - -universal-obj-y += disas/ - ###################################################################### # trace trace-obj-y += trace/ -universal-obj-y += $(trace-obj-y) - ###################################################################### # smartcard @@ -142,6 +108,15 @@ qapi-obj-y += qapi-types.o qapi-visit.o common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o +####################################################################### +# Target-independent parts used in system and user emulation +universal-obj-y = +universal-obj-y += qemu-log.o +universal-obj-y += tcg-runtime.o +universal-obj-y += hw/ +universal-obj-y += qom/ +universal-obj-y += disas/ +universal-obj-y += $(trace-obj-y) universal-obj-y += $(qapi-obj-y) ###################################################################### @@ -159,13 +134,10 @@ nested-vars += \ stub-obj-y \ util-obj-y \ qga-obj-y \ - qom-obj-y \ qapi-obj-y \ block-obj-y \ - user-obj-y \ common-obj-y \ universal-obj-y \ - hw-core-obj-y \ extra-obj-y \ trace-obj-y dummy := $(call unnest-vars) diff --git a/Makefile.target b/Makefile.target index 0a12873ff0..d55134c12f 100644 --- a/Makefile.target +++ b/Makefile.target @@ -146,12 +146,7 @@ include $(SRC_PATH)/Makefile.objs all-obj-y = $(obj-y) all-obj-y += $(addprefix ../, $(universal-obj-y)) - -ifdef CONFIG_SOFTMMU -all-obj-y += $(addprefix ../, $(common-obj-y)) -else -all-obj-y += $(addprefix ../, $(user-obj-y)) -endif #CONFIG_LINUX_USER +all-obj-$(CONFIG_SOFTMMU) += $(addprefix ../, $(common-obj-y)) ifdef QEMU_PROGW # The linker builds a windows executable. Make also a console executable. diff --git a/hw/Makefile.objs b/hw/Makefile.objs index 6fdd25e4b0..aa55ce9873 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -1,8 +1,7 @@ # core qdev-related obj files, also used by *-user: -hw-core-obj-y += qdev.o qdev-properties.o +universal-obj-y += qdev.o qdev-properties.o # irq.o needed for qdev GPIO handling: -hw-core-obj-y += irq.o - +universal-obj-y += irq.o common-obj-y = usb/ ide/ pci/ common-obj-y += loader.o diff --git a/qom/Makefile.objs b/qom/Makefile.objs index 5ef060a401..1899a4ce42 100644 --- a/qom/Makefile.objs +++ b/qom/Makefile.objs @@ -1,4 +1,2 @@ -qom-obj-y = object.o container.o qom-qobject.o -qom-obj-twice-y = cpu.o -common-obj-y = $(qom-obj-twice-y) -user-obj-y = $(qom-obj-twice-y) +universal-obj-y = object.o container.o qom-qobject.o +universal-obj-y += cpu.o From 59cacde8cdf2e85de9b1aff63e456e89a8a5c59d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 15:03:18 +0100 Subject: [PATCH 21/27] build: move QAPI definitions for QEMU out of qapi-obj-y There is no reason why for example qemu-ga should include all the definitions for the QEMU monitor. However, there are a few that are needed (qapi_free_SocketAddress, qapi_free_InetSocketAddress, ErrorClass_lookup). These should be moved to a separate "core" .json schema that goes into libqemuutil.a. For now, make this clearer by moving the qapi-*.o definitions out of libqemuutil.a. Once the above refactoring is done, qga-obj-y should not include anymore qapi-types.o and qapi-visit.o. Signed-off-by: Paolo Bonzini --- Makefile.objs | 6 ++++-- tests/Makefile | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index f2f43b2385..48a7173e68 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -103,7 +103,6 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y) # qapi qapi-obj-y = qapi/ -qapi-obj-y += qapi-types.o qapi-visit.o common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o @@ -118,11 +117,14 @@ universal-obj-y += qom/ universal-obj-y += disas/ universal-obj-y += $(trace-obj-y) universal-obj-y += $(qapi-obj-y) +universal-obj-y += qapi-types.o qapi-visit.o ###################################################################### # guest agent -qga-obj-y = qga/ +# FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed +# by libqemuutil.a. These should be moved to a separate .json schema. +qga-obj-y = qga/ qapi-types.o qapi-visit.o vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) diff --git a/tests/Makefile b/tests/Makefile index 837f769433..9017fead15 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -102,7 +102,7 @@ tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(te tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a -tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) qapi-types.o qapi-visit.o libqemuutil.a libqemustub.a tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) From 576d55068d210c7316297af4194a10f729efe742 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 15:27:51 +0100 Subject: [PATCH 22/27] build: move base QAPI files to libqemuutil.a Signed-off-by: Paolo Bonzini --- Makefile | 2 +- Makefile.objs | 9 ++------- qapi/Makefile.objs | 8 ++++---- tests/Makefile | 3 +-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index ee39b364fb..8c3b13e4be 100644 --- a/Makefile +++ b/Makefile @@ -206,7 +206,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean: diff --git a/Makefile.objs b/Makefile.objs index 48a7173e68..eed27df106 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -1,7 +1,7 @@ ####################################################################### # Common libraries for tools and emulators stub-obj-y = stubs/ -util-obj-y = util/ qobject/ +util-obj-y = util/ qobject/ qapi/ ####################################################################### # coroutines @@ -30,7 +30,7 @@ block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ -block-obj-y += $(qapi-obj-y) qapi-types.o qapi-visit.o +block-obj-y += qapi-types.o qapi-visit.o ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add. @@ -102,8 +102,6 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y) ###################################################################### # qapi -qapi-obj-y = qapi/ - common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o @@ -116,8 +114,6 @@ universal-obj-y += hw/ universal-obj-y += qom/ universal-obj-y += disas/ universal-obj-y += $(trace-obj-y) -universal-obj-y += $(qapi-obj-y) -universal-obj-y += qapi-types.o qapi-visit.o ###################################################################### # guest agent @@ -136,7 +132,6 @@ nested-vars += \ stub-obj-y \ util-obj-y \ qga-obj-y \ - qapi-obj-y \ block-obj-y \ common-obj-y \ universal-obj-y \ diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs index f9bd3b9910..1f9c97342c 100644 --- a/qapi/Makefile.objs +++ b/qapi/Makefile.objs @@ -1,5 +1,5 @@ -qapi-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o -qapi-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o -qapi-obj-y += string-input-visitor.o string-output-visitor.o +util-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o +util-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o +util-obj-y += string-input-visitor.o string-output-visitor.o -common-obj-y += opts-visitor.o +util-obj-y += opts-visitor.o diff --git a/tests/Makefile b/tests/Makefile index 9017fead15..f224eb2390 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -70,8 +70,7 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ tests/test-qmp-commands.o tests/test-visitor-serialization.o -test-qapi-obj-y = $(qapi-obj-y) -test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o +test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o $(test-obj-y): QEMU_INCLUDES += -Itests From bf0842b71f581e0c60f4bbfbebf37ff999a22b88 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 17:36:35 +0100 Subject: [PATCH 23/27] build: move version-obj-y to the generic LINK rule There is no reason for it to be in block-obj-y, in particular. Signed-off-by: Paolo Bonzini --- Makefile | 2 +- Makefile.objs | 3 +-- rules.mak | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8c3b13e4be..ad85e5ba8d 100644 --- a/Makefile +++ b/Makefile @@ -206,7 +206,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean: diff --git a/Makefile.objs b/Makefile.objs index eed27df106..aae2696b79 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -25,7 +25,7 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o block-obj-y = async.o thread-pool.o block-obj-y += nbd.o block.o blockjob.o -block-obj-y += $(coroutine-obj-y) $(version-obj-y) +block-obj-y += $(coroutine-obj-y) block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o @@ -58,7 +58,6 @@ common-obj-y += block-migration.o common-obj-y += page_cache.o common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o -common-obj-$(CONFIG_WIN32) += version.o common-obj-$(CONFIG_SPICE) += spice-qemu-char.o diff --git a/rules.mak b/rules.mak index 4297345474..6d82c0d5a0 100644 --- a/rules.mak +++ b/rules.mak @@ -23,7 +23,7 @@ QEMU_CFLAGS += -I$( Date: Thu, 20 Dec 2012 17:38:14 +0100 Subject: [PATCH 24/27] build: remove coroutine-obj-y Just fold it into block-obj-y. Signed-off-by: Paolo Bonzini --- Makefile.objs | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index aae2696b79..bc56c61af6 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -3,35 +3,30 @@ stub-obj-y = stubs/ util-obj-y = util/ qobject/ qapi/ -####################################################################### -# coroutines -coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o -coroutine-obj-y += qemu-coroutine-sleep.o - -# If you change this logic, please also check tests/Makefile -ifeq ($(CONFIG_UCONTEXT_COROUTINE),y) -coroutine-obj-$(CONFIG_POSIX) += coroutine-ucontext.o -else -ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y) -coroutine-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o -else -coroutine-obj-$(CONFIG_POSIX) += coroutine-gthread.o -endif -endif -coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o - ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img block-obj-y = async.o thread-pool.o block-obj-y += nbd.o block.o blockjob.o -block-obj-y += $(coroutine-obj-y) block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ block-obj-y += qapi-types.o qapi-visit.o +block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o +block-obj-y += qemu-coroutine-sleep.o +ifeq ($(CONFIG_UCONTEXT_COROUTINE),y) +block-obj-$(CONFIG_POSIX) += coroutine-ucontext.o +else +ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y) +block-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o +else +block-obj-$(CONFIG_POSIX) += coroutine-gthread.o +endif +endif +block-obj-$(CONFIG_WIN32) += coroutine-win32.o + ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add. # only pull in the actual virtio-9p device if we also enabled virtio. From 0e848f482bce75f4d9cbac9f495fa45e51d08c9a Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 24 Dec 2012 14:06:27 +0100 Subject: [PATCH 25/27] build: some simplifications for "trace/Makefile.objs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: LluĂ­s Vilanova Signed-off-by: Paolo Bonzini --- trace.h => include/trace.h | 0 trace/Makefile.objs | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) rename trace.h => include/trace.h (100%) diff --git a/trace.h b/include/trace.h similarity index 100% rename from trace.h rename to include/trace.h diff --git a/trace/Makefile.objs b/trace/Makefile.objs index 40febce5a1..ed2e30b001 100644 --- a/trace/Makefile.objs +++ b/trace/Makefile.objs @@ -1,12 +1,9 @@ # -*- mode: makefile -*- ###################################################################### -# Auto-generated tracing routines +# Auto-generated header for tracing routines -ifeq ($(TRACE_BACKEND),dtrace) -TRACE_H_EXTRA_DEPS=$(obj)/generated-tracers-dtrace.h -endif -$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp $(TRACE_H_EXTRA_DEPS) +$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(call quiet-command,$(TRACETOOL) \ --format=h \ @@ -14,6 +11,10 @@ $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf < $< > $@," GEN $(patsubst %-timestamp,%,$@)") @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@) +###################################################################### +# Auto-generated tracing routines (non-DTrace) + +ifneq ($(TRACE_BACKEND),dtrace) $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(call quiet-command,$(TRACETOOL) \ @@ -23,9 +24,6 @@ $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@) $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h - -ifneq ($(TRACE_BACKEND),dtrace) -trace-obj-y += generated-tracers.o endif @@ -35,19 +33,20 @@ endif # Normal practice is to name DTrace probe file with a '.d' extension # but that gets picked up by QEMU's Makefile as an external dependency # rule file. So we use '.dtrace' instead -$(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp -$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak +ifeq ($(TRACE_BACKEND),dtrace) +$(obj)/generated-tracers.dtrace: $(obj)/generated-tracers.dtrace-timestamp +$(obj)/generated-tracers.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(call quiet-command,$(TRACETOOL) \ --format=d \ --backend=$(TRACE_BACKEND) \ < $< > $@," GEN $(patsubst %-timestamp,%,$@)") @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@) -$(obj)/generated-tracers-dtrace.h: trace/generated-tracers-dtrace.dtrace +$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers.dtrace $(call quiet-command,dtrace -o $@ -h -s $<, " GEN $@") -trace-obj-$(CONFIG_TRACE_DTRACE) += generated-tracers-dtrace.o - +$(obj)/generated-tracers.o: $(obj)/generated-tracers.dtrace +endif ###################################################################### # Backend code @@ -56,3 +55,4 @@ trace-obj-$(CONFIG_TRACE_DEFAULT) += default.o trace-obj-$(CONFIG_TRACE_SIMPLE) += simple.o trace-obj-$(CONFIG_TRACE_STDERR) += stderr.o trace-obj-y += control.o +trace-obj-y += generated-tracers.o From ff667e2e9b86fdc36e3b143483526f4c4fe80049 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 21 Dec 2012 09:45:20 +0100 Subject: [PATCH 26/27] build: fold trace-obj-y into libqemuutil.a Signed-off-by: Paolo Bonzini --- Makefile | 14 +++++++------- Makefile.objs | 11 ++--------- libcacard/Makefile | 3 ++- tests/Makefile | 8 ++++---- trace/Makefile.objs | 10 +++++----- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index ad85e5ba8d..2b737d57b7 100644 --- a/Makefile +++ b/Makefile @@ -135,9 +135,9 @@ $(SRC_PATH)/pixman/configure: $(SUBDIR_RULES): libqemuutil.a libqemustub.a -$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y) +$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(common-obj-y) $(extra-obj-y) -$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(user-obj-y) +$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(user-obj-y) ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) romsubdir-%: @@ -164,13 +164,13 @@ libqemuutil.a: $(util-obj-y) qemu-img.o: qemu-img-cmds.h -qemu-img$(EXESUF): qemu-img.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-nbd$(EXESUF): qemu-nbd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-io$(EXESUF): qemu-io.o cmd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a +qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a +qemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o -fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o $(trace-obj-y) libqemuutil.a libqemustub.a +fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx @@ -206,7 +206,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean: diff --git a/Makefile.objs b/Makefile.objs index bc56c61af6..d465a72030 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -1,7 +1,7 @@ ####################################################################### # Common libraries for tools and emulators stub-obj-y = stubs/ -util-obj-y = util/ qobject/ qapi/ +util-obj-y = util/ qobject/ qapi/ trace/ ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img @@ -77,11 +77,6 @@ ifeq ($(CONFIG_SECCOMP),y) common-obj-y += qemu-seccomp.o endif -###################################################################### -# trace - -trace-obj-y += trace/ - ###################################################################### # smartcard @@ -107,7 +102,6 @@ universal-obj-y += tcg-runtime.o universal-obj-y += hw/ universal-obj-y += qom/ universal-obj-y += disas/ -universal-obj-y += $(trace-obj-y) ###################################################################### # guest agent @@ -129,6 +123,5 @@ nested-vars += \ block-obj-y \ common-obj-y \ universal-obj-y \ - extra-obj-y \ - trace-obj-y + extra-obj-y dummy := $(call unnest-vars) diff --git a/libcacard/Makefile b/libcacard/Makefile index c658d3a9b7..47827a0eb8 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -3,10 +3,11 @@ libcacard_includedir=$(includedir)/cacard TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required -libcacard-obj-y = $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-obj-y = $(stub-obj-y) $(libcacard-y) libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o util/error.o libcacard-obj-$(CONFIG_WIN32) += util/oslib-win32.o util/qemu-thread-win32.o libcacard-obj-$(CONFIG_POSIX) += util/oslib-posix.o util/qemu-thread-posix.o +libcacard-obj-y += $(filter trace/%, $(util-obj-y)) libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) diff --git a/tests/Makefile b/tests/Makefile index f224eb2390..d97a571c8b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -104,10 +104,10 @@ tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi- tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) qapi-types.o qapi-visit.o libqemuutil.a libqemustub.a tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a -tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) -tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y) -tests/fdc-test$(EXESUF): tests/fdc-test.o tests/libqtest.o $(trace-obj-y) -tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o tests/libqtest.o $(trace-obj-y) +tests/rtc-test$(EXESUF): tests/rtc-test.o +tests/m48t59-test$(EXESUF): tests/m48t59-test.o +tests/fdc-test$(EXESUF): tests/fdc-test.o +tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o # QTest rules diff --git a/trace/Makefile.objs b/trace/Makefile.objs index ed2e30b001..27fe26b5c2 100644 --- a/trace/Makefile.objs +++ b/trace/Makefile.objs @@ -51,8 +51,8 @@ endif ###################################################################### # Backend code -trace-obj-$(CONFIG_TRACE_DEFAULT) += default.o -trace-obj-$(CONFIG_TRACE_SIMPLE) += simple.o -trace-obj-$(CONFIG_TRACE_STDERR) += stderr.o -trace-obj-y += control.o -trace-obj-y += generated-tracers.o +util-obj-$(CONFIG_TRACE_DEFAULT) += default.o +util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o +util-obj-$(CONFIG_TRACE_STDERR) += stderr.o +util-obj-y += control.o +util-obj-y += generated-tracers.o From aaf821fde35f2ac5cf509ebd83a7d40704ea8d48 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 21 Dec 2012 10:45:20 +0100 Subject: [PATCH 27/27] build: improve quiet output for .stp rules Mention the directory in which the .stp file is being generated. Signed-off-by: Paolo Bonzini --- Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.target b/Makefile.target index d55134c12f..eb84b1f8e3 100644 --- a/Makefile.target +++ b/Makefile.target @@ -54,7 +54,7 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events --binary=$(bindir)/$(QEMU_PROG) \ --target-arch=$(TARGET_ARCH) \ --target-type=$(TARGET_TYPE) \ - < $< > $@," GEN $(QEMU_PROG).stp") + < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp") else stap: endif