Skip to content

Commit

Permalink
Move include qemu/option.h from qemu-common.h to actual users
Browse files Browse the repository at this point in the history
qemu-common.h includes qemu/option.h, but most places that include the
former don't actually need the latter.  Drop the include, and add it
to the places that actually need it.

While there, drop superfluous includes of both headers, and
separate #include from file comment with a blank line.

This cleanup makes the number of objects depending on qemu/option.h
drop from 4545 (out of 4743) to 284 in my "build everything" tree.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180201111846.21846-20-armbru@redhat.com>
[Semantic conflict with commit bdd6a90 in block/nvme.c resolved]
  • Loading branch information
Markus Armbruster committed Feb 9, 2018
1 parent bbcad96 commit 922a01a
Show file tree
Hide file tree
Showing 104 changed files with 99 additions and 54 deletions.
2 changes: 1 addition & 1 deletion accel/accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
#include "qemu/osdep.h"
#include "sysemu/accel.h"
#include "hw/boards.h"
#include "qemu-common.h"
#include "sysemu/arch_init.h"
#include "sysemu/sysemu.h"
#include "sysemu/kvm.h"
#include "sysemu/qtest.h"
#include "hw/xen/xen.h"
#include "qom/object.h"
#include "qemu/error-report.h"
#include "qemu/option.h"

static const TypeInfo accel_type = {
.name = TYPE_ACCEL,
Expand Down
1 change: 1 addition & 0 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "sysemu/block-backend.h"
#include "sysemu/sysemu.h"
#include "qemu/notify.h"
#include "qemu/option.h"
#include "qemu/coroutine.h"
#include "block/qapi.h"
#include "qemu/timer.h"
Expand Down
1 change: 1 addition & 0 deletions block/blkdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "qemu/config-file.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "sysemu/qtest.h"
Expand Down
1 change: 1 addition & 0 deletions block/blkverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qemu/cutils.h"
#include "qemu/option.h"

typedef struct {
BdrvChild *test_file;
Expand Down
1 change: 1 addition & 0 deletions block/block-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "qapi-event.h"
#include "qapi/error.h"
#include "qemu/id.h"
#include "qemu/option.h"
#include "trace.h"
#include "migration/misc.h"

Expand Down
1 change: 1 addition & 0 deletions block/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qemu/option.h"
#include "block/crypto.h"

typedef struct BlockCrypto BlockCrypto;
Expand Down
2 changes: 1 addition & 1 deletion block/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "block/block_int.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
Expand Down
2 changes: 2 additions & 0 deletions block/file-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "trace.h"
#include "block/thread-pool.h"
#include "qemu/iov.h"
Expand Down
2 changes: 2 additions & 0 deletions block/file-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/cutils.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "block/raw-aio.h"
#include "trace.h"
#include "block/thread-pool.h"
Expand Down
2 changes: 2 additions & 0 deletions block/gluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* See the COPYING file in the top-level directory.
*
*/

#include "qemu/osdep.h"
#include <glusterfs/api/glfs.h>
#include "block/block_int.h"
Expand All @@ -15,6 +16,7 @@
#include "qapi/qmp/qerror.h"
#include "qemu/uri.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/cutils.h"

#define GLUSTER_OPT_FILENAME "filename"
Expand Down
1 change: 1 addition & 0 deletions block/iscsi-opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/config-file.h"
#include "qemu/option.h"

static QemuOptsList qemu_iscsi_opts = {
.name = "iscsi",
Expand Down
2 changes: 1 addition & 1 deletion block/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
#include <poll.h>
#include <math.h>
#include <arpa/inet.h>
#include "qemu-common.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qemu/bitops.h"
#include "qemu/bitmap.h"
#include "block/block_int.h"
#include "scsi/constants.h"
#include "qemu/iov.h"
#include "qemu/option.h"
#include "qemu/uuid.h"
#include "qmp-commands.h"
#include "qapi/error.h"
Expand Down
1 change: 1 addition & 0 deletions block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "qemu/uri.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qapi-visit.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h"
Expand Down
2 changes: 1 addition & 1 deletion block/nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
#include "qemu/osdep.h"

#include <poll.h>
#include "qemu-common.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "block/block_int.h"
#include "trace.h"
#include "qemu/iov.h"
#include "qemu/option.h"
#include "qemu/uri.h"
#include "qemu/cutils.h"
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions block/null.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qemu/option.h"
#include "block/block_int.h"

#define NULL_OPT_LATENCY "latency-ns"
Expand Down
1 change: 1 addition & 0 deletions block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qapi/qmp/qstring.h"
#include "qemu/error-report.h"
#include "qemu/cutils.h"
#include "qemu/option.h"
#include "qemu/vfio-helpers.h"
#include "block/block_int.h"
#include "trace.h"
Expand Down
3 changes: 2 additions & 1 deletion block/parallels.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/bswap.h"
#include "qemu/bitmap.h"
#include "migration/blocker.h"
Expand Down
2 changes: 1 addition & 1 deletion block/qcow.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/bswap.h"
#include <zlib.h>
#include "qapi/qmp/qdict.h"
Expand Down
1 change: 1 addition & 0 deletions block/qed.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "qapi/error.h"
#include "qemu/timer.h"
#include "qemu/bswap.h"
#include "qemu/option.h"
#include "trace.h"
#include "qed.h"
#include "sysemu/block-backend.h"
Expand Down
1 change: 1 addition & 0 deletions block/quorum.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "qemu/option.h"
#include "block/block_int.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
Expand Down
1 change: 1 addition & 0 deletions block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <rbd/librbd.h>
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "block/block_int.h"
#include "crypto/secret.h"
#include "qemu/cutils.h"
Expand Down
2 changes: 1 addition & 1 deletion block/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/option.h"
#include "block/nbd.h"
#include "block/blockjob.h"
#include "block/block_int.h"
Expand Down
1 change: 1 addition & 0 deletions block/sheepdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qemu/uri.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/sockets.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
Expand Down
1 change: 1 addition & 0 deletions block/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qstring.h"
#include "qemu/option.h"

QemuOptsList internal_snapshot_opts = {
.name = "snapshot",
Expand Down
1 change: 1 addition & 0 deletions block/ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "block/block_int.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/cutils.h"
#include "qemu/sockets.h"
#include "qemu/uri.h"
Expand Down
1 change: 1 addition & 0 deletions block/throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "qemu/osdep.h"
#include "block/throttle-groups.h"
#include "qemu/option.h"
#include "qemu/throttle-options.h"
#include "qapi/error.h"

Expand Down
1 change: 1 addition & 0 deletions block/vdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/bswap.h"
#include "migration/blocker.h"
#include "qemu/coroutine.h"
Expand Down
2 changes: 1 addition & 1 deletion block/vhdx.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/crc32c.h"
#include "qemu/bswap.h"
#include "block/vhdx.h"
Expand Down
1 change: 1 addition & 0 deletions block/vmdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/bswap.h"
#include "migration/blocker.h"
#include "qemu/cutils.h"
Expand Down
3 changes: 2 additions & 1 deletion block/vpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "migration/blocker.h"
#include "qemu/bswap.h"
#include "qemu/uuid.h"
Expand Down
1 change: 1 addition & 0 deletions block/vvfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "qapi/error.h"
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/bswap.h"
#include "migration/blocker.h"
#include "qapi/qmp/qdict.h"
Expand Down
3 changes: 2 additions & 1 deletion chardev/char-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/option.h"
#include "chardev/char.h"

#ifdef _WIN32
Expand Down
3 changes: 2 additions & 1 deletion chardev/char-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/option.h"
#include "chardev/char.h"
#include "sysemu/block-backend.h"
#include "chardev/char-mux.h"
Expand Down
2 changes: 2 additions & 0 deletions chardev/char-parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "chardev/char.h"
#include "qapi/error.h"
#include "qemu/option.h"
#include <sys/ioctl.h>

#ifdef CONFIG_BSD
Expand Down
2 changes: 2 additions & 0 deletions chardev/char-pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/option.h"
#include "chardev/char.h"

#ifdef _WIN32
Expand Down
1 change: 1 addition & 0 deletions chardev/char-ringbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "qmp-commands.h"
#include "qapi/error.h"
#include "qemu/base64.h"
#include "qemu/option.h"

/* Ring buffer chardev */

Expand Down
2 changes: 2 additions & 0 deletions chardev/char-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qemu/option.h"
#include "qemu/sockets.h"
#include "io/channel-file.h"
#include "qapi/error.h"
Expand Down
2 changes: 2 additions & 0 deletions chardev/char-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "chardev/char.h"
#include "io/channel-socket.h"
#include "io/channel-tls.h"
#include "io/net-listener.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qapi/error.h"
#include "qapi/clone-visitor.h"

Expand Down
Loading

0 comments on commit 922a01a

Please sign in to comment.