Skip to contentSkip to conversation

include cleanups

PATCH In review Michael S. Tsirkin 6 participants 45 messages May 25, 2018 – Jun 1, 2018

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover include cleanups

Right now, a local header can be included with either

#include "foo.h"
or
#include "dir/foo.h"

since the later doesn't tell you where the header is (in source or include directory), the former is preferable.

I intend to look for ways to prevent the second way from working, but that will take time. For now, fix all instances for the later way I could find.

In a couple of places I just dropped the include instead.

Finally, arch_init huge list of includes is sorted, which will be helpful in future cleanups.

This was part of the include path cleanup patchset
(https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg00739.html).

Changes from v1
drop patches not dealing with local headers
stop saying include through root works by accident -
it's not by accident, just not how we'd like code to look like
address comments by eric, philip, others

Michael S. Tsirkin (20):
block: use local path for local headers
crypto: use local path for local headers
hppa: use local path for local headers
migration: drop an unused include
trace: use local path for local headers
display: use local path for local headers
ide: use local path for local headers
ioapic: fix up includes
e1000e: use local path for local headers
rocker: drop an unused include
ppc: use local path for local headers
vhost-scsi: drop an unused include
sd: fix up include
usb: use local path for local headers
migration: use local path for local headers
colo: use local path for local headers
qga: use local path for local headers
trace: use local path for local headers
ui: use local path for local headers
arch_init: sort architectures

 crypto/block-luks.h             |  2 +-
 crypto/block-qcow.h             |  2 +-
 crypto/ivgen-essiv.h            |  2 +-
 crypto/ivgen-plain.h            |  2 +-
 crypto/ivgen-plain64.h          |  2 +-
 hw/hppa/hppa_sys.h              |  2 +-
 include/migration/vmstate.h     |  2 +-
 trace/control.h                 |  2 +-
 arch_init.c                     | 16 ++++++++--------
 block/crypto.c                  |  2 +-
 block/nbd.c                     |  2 +-
 block/qcow.c                    |  2 +-
 block/qcow2-bitmap.c            |  2 +-
 block/qcow2-cluster.c           |  2 +-
 block/qcow2-refcount.c          |  2 +-
 block/qcow2-snapshot.c          |  2 +-
 block/qcow2.c                   |  4 ++--
 block/vhdx-endian.c             |  2 +-
 block/vhdx-log.c                |  2 +-
 block/vhdx.c                    |  2 +-
 crypto/block-luks.c             |  2 +-
 crypto/block-qcow.c             |  2 +-
 crypto/block.c                  |  6 +++---
 crypto/cipher.c                 |  6 +++---
 crypto/ivgen-essiv.c            |  2 +-
 crypto/ivgen-plain.c            |  2 +-
 crypto/ivgen-plain64.c          |  2 +-
 crypto/ivgen.c                  |  8 ++++----
 crypto/tlscreds.c               |  2 +-
 crypto/tlscredsanon.c           |  2 +-
 crypto/tlscredsx509.c           |  2 +-
 hw/display/bcm2835_fb.c         |  2 +-
 hw/hppa/machine.c               |  2 +-
 hw/ide/ahci-allwinner.c         |  2 +-
 hw/ide/ahci.c                   |  2 +-
 hw/ide/ich.c                    |  2 +-
 hw/intc/ioapic.c                |  3 +--
 hw/net/e1000e.c                 |  2 +-
 hw/net/rocker/rocker_fp.c       |  1 -
 hw/ppc/ppc440_uc.c              |  2 +-
 hw/ppc/sam460ex.c               |  4 ++--
 hw/scsi/vhost-scsi-common.c     |  1 -
 hw/sd/milkymist-memcard.c       |  2 +-
 hw/usb/desc-msos.c              |  2 +-
 hw/usb/desc.c                   |  2 +-
 hw/usb/dev-audio.c              |  2 +-
 hw/usb/dev-bluetooth.c          |  2 +-
 hw/usb/dev-hid.c                |  2 +-
 hw/usb/dev-hub.c                |  2 +-
 hw/usb/dev-mtp.c                |  2 +-
 hw/usb/dev-network.c            |  2 +-
 hw/usb/dev-serial.c             |  2 +-
 hw/usb/dev-smartcard-reader.c   |  2 +-
 hw/usb/dev-storage.c            |  2 +-
 hw/usb/dev-uas.c                |  2 +-
 hw/usb/dev-wacom.c              |  2 +-
 migration/block-dirty-bitmap.c  |  2 +-
 migration/page_cache.c          |  2 +-
 migration/ram.c                 |  4 ++--
 migration/savevm.c              |  1 +
 migration/vmstate.c             |  2 +-
 net/colo-compare.c              |  2 +-
 net/colo.c                      |  2 +-
 net/filter-rewriter.c           |  2 +-
 qga/channel-posix.c             |  2 +-
 qga/channel-win32.c             |  4 ++--
 qga/commands-posix.c            |  2 +-
 qga/commands-win32.c            |  4 ++--
 qga/commands.c                  |  2 +-
 qga/guest-agent-command-state.c |  2 +-
 qga/main.c                      |  4 ++--
 qga/vss-win32.c                 |  6 +++---
 trace/qmp.c                     |  2 +-
 ui/gtk.c                        |  2 +-
 ui/input-keymap.c               |  2 +-
 ui/input-legacy.c               |  2 +-
 ui/spice-input.c                |  2 +-
 77 files changed, 97 insertions(+), 99 deletions(-)
Signature · 1 line
MST
#4 lore raw

PATCH v2 2/20 crypto: use local path for local headers

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 crypto/block-luks.h    | 2 +-
 crypto/block-qcow.h    | 2 +-
 crypto/ivgen-essiv.h   | 2 +-
 crypto/ivgen-plain.h   | 2 +-
 crypto/ivgen-plain64.h | 2 +-
 crypto/block-luks.c    | 2 +-
 crypto/block-qcow.c    | 2 +-
 crypto/block.c         | 6 +++---
 crypto/cipher.c        | 6 +++---
 crypto/ivgen-essiv.c   | 2 +-
 crypto/ivgen-plain.c   | 2 +-
 crypto/ivgen-plain64.c | 2 +-
 crypto/ivgen.c         | 8 ++++----
 crypto/tlscreds.c      | 2 +-
 crypto/tlscredsanon.c  | 2 +-
 crypto/tlscredsx509.c  | 2 +-
 16 files changed, 23 insertions(+), 23 deletions(-)
crypto/block-luks.h +1 -1
index b2d8a35..befd8b2 100644
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_BLOCK_LUKS_H
 #define QCRYPTO_BLOCK_LUKS_H
 
-#include "crypto/blockpriv.h"
+#include "blockpriv.h"
 
 extern const QCryptoBlockDriver qcrypto_block_driver_luks;
 
crypto/block-qcow.h +1 -1
index 3e2c0a8..6988fb2 100644
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_BLOCK_QCOW_H
 #define QCRYPTO_BLOCK_QCOW_H
 
-#include "crypto/blockpriv.h"
+#include "blockpriv.h"
 
 extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
 
crypto/ivgen-essiv.h +1 -1
index 4a00af8..f34dbab 100644
@@ -18,7 +18,7 @@
  *
  */
 
-#include "crypto/ivgenpriv.h"
+#include "ivgenpriv.h"
 
 #ifndef QCRYPTO_IVGEN_ESSIV_H__
 #define QCRYPTO_IVGEN_ESSIV_H__
crypto/ivgen-plain.h +1 -1
index 0fe8835..16e1ae5 100644
@@ -18,7 +18,7 @@
  *
  */
 
-#include "crypto/ivgenpriv.h"
+#include "ivgenpriv.h"
 
 #ifndef QCRYPTO_IVGEN_PLAIN_H__
 #define QCRYPTO_IVGEN_PLAIN_H__
crypto/ivgen-plain64.h +1 -1
index c410445..f8611bd 100644
@@ -18,7 +18,7 @@
  *
  */
 
-#include "crypto/ivgenpriv.h"
+#include "ivgenpriv.h"
 
 #ifndef QCRYPTO_IVGEN_PLAIN64_H__
 #define QCRYPTO_IVGEN_PLAIN64_H__
crypto/block-luks.c +1 -1
index d418ac3..5738124 100644
@@ -22,7 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/bswap.h"
 
-#include "crypto/block-luks.h"
+#include "block-luks.h"
 
 #include "crypto/hash.h"
 #include "crypto/afsplit.h"
crypto/block-qcow.c +1 -1
index 8817d6a..4284e05 100644
@@ -27,7 +27,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 
-#include "crypto/block-qcow.h"
+#include "block-qcow.h"
 #include "crypto/secret.h"
 
 #define QCRYPTO_BLOCK_QCOW_SECTOR_SIZE 512
crypto/block.c +3 -3
index f206d5e..e59d114 100644
@@ -20,9 +20,9 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "crypto/blockpriv.h"
-#include "crypto/block-qcow.h"
-#include "crypto/block-luks.h"
+#include "blockpriv.h"
+#include "block-qcow.h"
+#include "block-luks.h"
 
 static const QCryptoBlockDriver *qcrypto_block_drivers[] = {
     [Q_CRYPTO_BLOCK_FORMAT_QCOW] = &qcrypto_block_driver_qcow,
crypto/cipher.c +3 -3
index bcbfb3d..b3af579 100644
@@ -150,11 +150,11 @@ qcrypto_cipher_munge_des_rfb_key(const uint8_t *key,
 #endif /* CONFIG_GCRYPT || CONFIG_NETTLE */
 
 #ifdef CONFIG_GCRYPT
-#include "crypto/cipher-gcrypt.c"
+#include "cipher-gcrypt.c"
 #elif defined CONFIG_NETTLE
-#include "crypto/cipher-nettle.c"
+#include "cipher-nettle.c"
 #else
-#include "crypto/cipher-builtin.c"
+#include "cipher-builtin.c"
 #endif
 
 QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
crypto/ivgen-essiv.c +1 -1
index aeaa8fc..43e258c 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "crypto/ivgen-essiv.h"
+#include "ivgen-essiv.h"
 
 typedef struct QCryptoIVGenESSIV QCryptoIVGenESSIV;
 struct QCryptoIVGenESSIV {
crypto/ivgen-plain.c +1 -1
index bf2fb7a..06f4145 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "crypto/ivgen-plain.h"
+#include "ivgen-plain.h"
 
 static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen,
                                     const uint8_t *key, size_t nkey,
crypto/ivgen-plain64.c +1 -1
index e4679a1..fbb7724 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "crypto/ivgen-plain.h"
+#include "ivgen-plain.h"
 
 static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen,
                                     const uint8_t *key, size_t nkey,
crypto/ivgen.c +4 -4
index f664351..6a2b3ad 100644
@@ -21,10 +21,10 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 
-#include "crypto/ivgenpriv.h"
-#include "crypto/ivgen-plain.h"
-#include "crypto/ivgen-plain64.h"
-#include "crypto/ivgen-essiv.h"
+#include "ivgenpriv.h"
+#include "ivgen-plain.h"
+#include "ivgen-plain64.h"
+#include "ivgen-essiv.h"
 
 
 QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgorithm alg,
crypto/tlscreds.c +1 -1
index 3cd4103..02255a6 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "crypto/tlscredspriv.h"
+#include "tlscredspriv.h"
 #include "trace.h"
 
 #define DH_BITS 2048
crypto/tlscredsanon.c +1 -1
index 1464220..7ad66d1 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "crypto/tlscredsanon.h"
-#include "crypto/tlscredspriv.h"
+#include "tlscredspriv.h"
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "trace.h"
crypto/tlscredsx509.c +1 -1
index 50eb54f..98ee042 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "crypto/tlscredsx509.h"
-#include "crypto/tlscredspriv.h"
+#include "tlscredspriv.h"
 #include "crypto/secret.h"
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
Signature · 1 line
MST
#1 lore raw

PATCH v2 1/20 block: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 block/crypto.c         | 2 +-
 block/nbd.c            | 2 +-
 block/qcow.c           | 2 +-
 block/qcow2-bitmap.c   | 2 +-
 block/qcow2-cluster.c  | 2 +-
 block/qcow2-refcount.c | 2 +-
 block/qcow2-snapshot.c | 2 +-
 block/qcow2.c          | 4 ++--
 block/vhdx-endian.c    | 2 +-
 block/vhdx-log.c       | 2 +-
 block/vhdx.c           | 2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)
block/crypto.c +1 -1
index 7e7ad2d..bc322b5 100644
@@ -29,7 +29,7 @@
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/error.h"
 #include "qemu/option.h"
-#include "block/crypto.h"
+#include "crypto.h"
 
 typedef struct BlockCrypto BlockCrypto;
 
block/nbd.c +1 -1
index 3e1693c..ff8333e 100644
@@ -27,7 +27,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "block/nbd-client.h"
+#include "nbd-client.h"
 #include "qapi/error.h"
 #include "qemu/uri.h"
 #include "block/block_int.h"
block/qcow.c +1 -1
index 3ba2ca2..1f866af 100644
@@ -37,7 +37,7 @@
 #include "qapi/qapi-visit-block-core.h"
 #include "crypto/block.h"
 #include "migration/blocker.h"
-#include "block/crypto.h"
+#include "crypto.h"
 
 /**************************************************************/
 /* QEMU COW block driver with compression and encryption support */
block/qcow2-bitmap.c +1 -1
index 6e93ec4..60d5290 100644
@@ -30,7 +30,7 @@
 #include "qemu/cutils.h"
 
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 
 /* NOTICE: BME here means Bitmaps Extension and used as a namespace for
  * _internal_ constants. Please do not use this _internal_ abbreviation for
block/qcow2-cluster.c +1 -1
index 1aee726..0d74584 100644
@@ -28,7 +28,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/bswap.h"
 #include "trace.h"
 
block/qcow2-refcount.c +1 -1
index 2dc2300..4032362 100644
@@ -26,7 +26,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/range.h"
 #include "qemu/bswap.h"
 #include "qemu/cutils.h"
block/qcow2-snapshot.c +1 -1
index 74293be..bb6a5b7 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/bswap.h"
 #include "qemu/error-report.h"
 #include "qemu/cutils.h"
block/qcow2.c +2 -2
index 6d53247..db13109 100644
@@ -27,7 +27,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
 #include <zlib.h>
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "qapi/qapi-events-block-core.h"
@@ -39,7 +39,7 @@
 #include "qemu/bswap.h"
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/qapi-visit-block-core.h"
-#include "block/crypto.h"
+#include "crypto.h"
 
 /*
   Differences with QCOW:
block/vhdx-endian.c +1 -1
index 429d755..41fbdd2 100644
@@ -19,7 +19,7 @@
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/bswap.h"
-#include "block/vhdx.h"
+#include "vhdx.h"
 
 /*
  * All the VHDX formats on disk are little endian - the following
block/vhdx-log.c +1 -1
index 0ac4863..d2f1b98 100644
@@ -24,7 +24,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/bswap.h"
-#include "block/vhdx.h"
+#include "vhdx.h"
 
 
 typedef struct VHDXLogSequence {
block/vhdx.c +1 -1
index 0b1e21c..79c68a2 100644
@@ -23,7 +23,7 @@
 #include "qemu/option.h"
 #include "qemu/crc32c.h"
 #include "qemu/bswap.h"
-#include "block/vhdx.h"
+#include "vhdx.h"
 #include "migration/blocker.h"
 #include "qemu/uuid.h"
 #include "qapi/qmp/qdict.h"
Signature · 1 line
MST
#7 lore raw

PATCH v2 3/20 hppa: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/hppa/hppa_sys.h | 2 +-
 hw/hppa/machine.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/hppa/hppa_sys.h +1 -1
index a182d1f..f98cc8d 100644
@@ -10,7 +10,7 @@
 #include "hw/i386/pc.h"
 #include "hw/irq.h"
 
-#include "hw/hppa/hppa_hardware.h"
+#include "hppa_hardware.h"
 
 PCIBus *dino_init(MemoryRegion *, qemu_irq *, qemu_irq *);
 
hw/hppa/machine.c +1 -1
index a1d6b0e..aba269b 100644
@@ -16,7 +16,7 @@
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
 #include "hw/char/serial.h"
-#include "hw/hppa/hppa_sys.h"
+#include "hppa_sys.h"
 #include "qemu/cutils.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
Signature · 1 line
MST
#8 lore raw

PATCH v2 4/20 migration: drop an unused include

In reply to Michael S. Tsirkin

we just need a struct name, let's add a forward
declaration instead of an include.

---
 include/migration/vmstate.h | 2 +-
 migration/savevm.c          | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
include/migration/vmstate.h +1 -1
index df463fd..5877cae 100644
@@ -27,7 +27,7 @@
 #ifndef QEMU_VMSTATE_H
 #define QEMU_VMSTATE_H
 
-#include "migration/qjson.h"
+typedef struct QJSON QJSON;
 
 typedef struct VMStateInfo VMStateInfo;
 typedef struct VMStateDescription VMStateDescription;
migration/savevm.c +1 -0
index 4251125..da724c5 100644
@@ -55,6 +55,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-file.h"
 #include "sysemu/replay.h"
+#include "qjson.h"
 
 #ifndef ETH_P_RARP
 #define ETH_P_RARP 0x8035
Signature · 1 line
MST
#10 lore raw

PATCH v2 5/20 trace: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 trace/control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace/control.h +1 -1
index 1903e22..eb65c8e 100644
@@ -267,6 +267,6 @@ char *trace_opt_parse(const char *optarg);
 uint32_t trace_get_vcpu_event_count(void);
 
 
-#include "trace/control-internal.h"
+#include "control-internal.h"
 
 #endif /* TRACE__CONTROL_H */
Signature · 1 line
MST
#13 lore raw

PATCH v2 6/20 display: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/display/bcm2835_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/bcm2835_fb.c +1 -1
index 7eab927..3355f4c 100644
@@ -26,7 +26,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/display/bcm2835_fb.h"
-#include "hw/display/framebuffer.h"
+#include "framebuffer.h"
 #include "ui/pixel_ops.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
 #include "qemu/log.h"
Signature · 1 line
MST
#16 lore raw

PATCH v2 8/20 ioapic: fix up includes

In reply to Michael S. Tsirkin

include files shouldn't have the "include/" part,
that is implied.

Also, drop an unused include.

---
 hw/intc/ioapic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/intc/ioapic.c +1 -2
index 36139a4..c45f073 100644
@@ -28,9 +28,8 @@
 #include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
 #include "hw/i386/ioapic_internal.h"
-#include "include/hw/pci/msi.h"
+#include "hw/pci/msi.h"
 #include "sysemu/kvm.h"
-#include "target/i386/cpu.h"
 #include "hw/i386/apic-msidef.h"
 #include "hw/i386/x86-iommu.h"
 #include "trace.h"
Signature · 1 line
MST
#18 lore raw

PATCH v2 9/20 e1000e: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/net/e1000e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/e1000e.c +1 -1
index 16a9417..cda8d48 100644
@@ -41,7 +41,7 @@
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 
-#include "hw/net/e1000_regs.h"
+#include "e1000_regs.h"
 
 #include "e1000x_common.h"
 #include "e1000e_core.h"
Signature · 1 line
MST
#14 lore raw

PATCH v2 7/20 ide: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/ide/ahci-allwinner.c | 2 +-
 hw/ide/ahci.c           | 2 +-
 hw/ide/ich.c            | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
hw/ide/ahci-allwinner.c +1 -1
index 2fd9507..f98e6cb 100644
@@ -20,7 +20,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/dma.h"
 #include "hw/ide/internal.h"
-#include "hw/ide/ahci_internal.h"
+#include "ahci_internal.h"
 
 #include "trace.h"
 
hw/ide/ahci.c +1 -1
index e22d7be..24dbad5 100644
@@ -31,7 +31,7 @@
 #include "sysemu/dma.h"
 #include "hw/ide/internal.h"
 #include "hw/ide/pci.h"
-#include "hw/ide/ahci_internal.h"
+#include "ahci_internal.h"
 
 #include "trace.h"
 
hw/ide/ich.c +1 -1
index 134478e..51c935a 100644
@@ -67,7 +67,7 @@
 #include "hw/isa/isa.h"
 #include "sysemu/dma.h"
 #include "hw/ide/pci.h"
-#include "hw/ide/ahci_internal.h"
+#include "ahci_internal.h"
 
 #define ICH9_MSI_CAP_OFFSET     0x80
 #define ICH9_SATA_CAP_OFFSET    0xA8
Signature · 1 line
MST
#20 lore raw

PATCH v2 10/20 rocker: drop an unused include

In reply to Michael S. Tsirkin

We don't use net/clients.h, drop that include.

---
 hw/net/rocker/rocker_fp.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/rocker/rocker_fp.c +0 -1
index 27b17c8..4aa7da7 100644
@@ -15,7 +15,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "net/clients.h"
 #include "qapi/qapi-types-rocker.h"
 #include "rocker.h"
 #include "rocker_hw.h"
Signature · 1 line
MST
#22 lore raw

PATCH v2 11/20 ppc: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/ppc/ppc440_uc.c | 2 +-
 hw/ppc/sam460ex.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
hw/ppc/ppc440_uc.c +1 -1
index e312fdb..123f4ac 100644
@@ -20,7 +20,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/block-backend.h"
-#include "hw/ppc/ppc440.h"
+#include "ppc440.h"
 
 /*****************************************************************************/
 /* L2 Cache as SRAM */
hw/ppc/sam460ex.c +2 -2
index a48e6e6..cb2ab1d 100644
@@ -27,8 +27,8 @@
 #include "elf.h"
 #include "exec/address-spaces.h"
 #include "exec/memory.h"
-#include "hw/ppc/ppc440.h"
-#include "hw/ppc/ppc405.h"
+#include "ppc440.h"
+#include "ppc405.h"
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
Signature · 1 line
MST
#24 lore raw

PATCH v2 12/20 vhost-scsi: drop an unused include

In reply to Michael S. Tsirkin

No reason for vhost-scsi to pull in migration headers directly.

---
 hw/scsi/vhost-scsi-common.c | 1 -
 1 file changed, 1 deletion(-)
hw/scsi/vhost-scsi-common.c +0 -1
index 77e9897..e2a5828 100644
@@ -17,7 +17,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
-#include "migration/migration.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-scsi-common.h"
 #include "hw/virtio/virtio-scsi.h"
Signature · 1 line
MST
#26 lore raw

PATCH v2 13/20 sd: fix up include

In reply to Michael S. Tsirkin

include files shouldn't have the "include/" part,
that is implied.

---
 hw/sd/milkymist-memcard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/sd/milkymist-memcard.c +1 -1
index 5570c1e..fe1cccc 100644
@@ -27,7 +27,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
-#include "include/qapi/error.h"
+#include "qapi/error.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/sd/sd.h"
Signature · 1 line
MST
#28 lore raw

PATCH v2 14/20 usb: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/usb/desc-msos.c            | 2 +-
 hw/usb/desc.c                 | 2 +-
 hw/usb/dev-audio.c            | 2 +-
 hw/usb/dev-bluetooth.c        | 2 +-
 hw/usb/dev-hid.c              | 2 +-
 hw/usb/dev-hub.c              | 2 +-
 hw/usb/dev-mtp.c              | 2 +-
 hw/usb/dev-network.c          | 2 +-
 hw/usb/dev-serial.c           | 2 +-
 hw/usb/dev-smartcard-reader.c | 2 +-
 hw/usb/dev-storage.c          | 2 +-
 hw/usb/dev-uas.c              | 2 +-
 hw/usb/dev-wacom.c            | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
hw/usb/desc-msos.c +1 -1
index 3652919..3a5ad7c 100644
@@ -1,6 +1,6 @@
 #include "qemu/osdep.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 /*
  * Microsoft OS Descriptors
hw/usb/desc.c +1 -1
index 85c15ad..8b6eaea 100644
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
 
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "trace.h"
 
 /* ------------------------------------------------------------------ */
hw/usb/dev-audio.c +1 -1
index 3433452..ee43e49 100644
@@ -32,7 +32,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "hw/hw.h"
 #include "audio/audio.h"
 
hw/usb/dev-bluetooth.c +1 -1
index 0bbceae..eac7365 100644
@@ -22,7 +22,7 @@
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "sysemu/bt.h"
 #include "hw/bt.h"
 
hw/usb/dev-hid.c +1 -1
index c40019d..62d1829 100644
@@ -26,7 +26,7 @@
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "hw/input/hid.h"
hw/usb/dev-hub.c +1 -1
index 752e30c..5d9743ef 100644
@@ -26,7 +26,7 @@
 #include "qemu-common.h"
 #include "trace.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "qemu/error-report.h"
 
 #define NUM_PORTS 8
hw/usb/dev-mtp.c +1 -1
index 3d59fe4..560c61c 100644
@@ -24,7 +24,7 @@
 #include "qemu/iov.h"
 #include "trace.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 /* ----------------------------------------------------------------------- */
 
hw/usb/dev-network.c +1 -1
index aea7edc..385e090 100644
@@ -27,7 +27,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "net/net.h"
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
hw/usb/dev-serial.c +1 -1
index 2829dda..98d1ca3 100644
@@ -14,7 +14,7 @@
 #include "qemu/cutils.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "chardev/char-serial.h"
 #include "chardev/char-fe.h"
 
hw/usb/dev-smartcard-reader.c +1 -1
index f745192..2131e33 100644
@@ -39,7 +39,7 @@
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 #include "ccid.h"
 
hw/usb/dev-storage.c +1 -1
index b56c75a..f2f632a 100644
@@ -14,7 +14,7 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "hw/scsi/scsi.h"
 #include "ui/console.h"
 #include "monitor/monitor.h"
hw/usb/dev-uas.c +1 -1
index c218b53..aaf5a88 100644
@@ -17,7 +17,7 @@
 #include "qemu/error-report.h"
 
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "hw/scsi/scsi.h"
 #include "scsi/constants.h"
 
hw/usb/dev-wacom.c +1 -1
index bf70013..ac0bc83 100644
@@ -29,7 +29,7 @@
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 /* Interface requests */
 #define WACOM_GET_REPORT	0x2101
Signature · 1 line
MST
#35 lore raw

PATCH v2 16/20 colo: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 net/colo-compare.c    | 2 +-
 net/colo.c            | 2 +-
 net/filter-rewriter.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
net/colo-compare.c +1 -1
index 23b2d2c..c3a2be4 100644
@@ -25,7 +25,7 @@
 #include "net/queue.h"
 #include "chardev/char-fe.h"
 #include "qemu/sockets.h"
-#include "net/colo.h"
+#include "colo.h"
 #include "sysemu/iothread.h"
 
 #define TYPE_COLO_COMPARE "colo-compare"
net/colo.c +1 -1
index 8426265..6dda4ed 100644
@@ -14,7 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "trace.h"
-#include "net/colo.h"
+#include "colo.h"
 
 uint32_t connection_key_hash(const void *opaque)
 {
net/filter-rewriter.c +1 -1
index 62dad2d..f584e4e 100644
@@ -11,7 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "trace.h"
-#include "net/colo.h"
+#include "colo.h"
 #include "net/filter.h"
 #include "net/net.h"
 #include "qemu-common.h"
Signature · 1 line
MST
#37 lore raw

PATCH v2 17/20 qga: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 qga/channel-posix.c             | 2 +-
 qga/channel-win32.c             | 4 ++--
 qga/commands-posix.c            | 2 +-
 qga/commands-win32.c            | 4 ++--
 qga/commands.c                  | 2 +-
 qga/guest-agent-command-state.c | 2 +-
 qga/main.c                      | 4 ++--
 qga/vss-win32.c                 | 6 +++---
 8 files changed, 13 insertions(+), 13 deletions(-)
qga/channel-posix.c +1 -1
index b812bf4..5a925a9 100644
@@ -2,7 +2,7 @@
 #include <termios.h>
 #include "qapi/error.h"
 #include "qemu/sockets.h"
-#include "qga/channel.h"
+#include "channel.h"
 
 #ifdef CONFIG_SOLARIS
 #include <stropts.h>
qga/channel-win32.c +2 -2
index 7e6dc4d..b3597a8 100644
@@ -1,8 +1,8 @@
 #include "qemu/osdep.h"
 #include <windows.h>
 #include <io.h>
-#include "qga/guest-agent-core.h"
-#include "qga/channel.h"
+#include "guest-agent-core.h"
+#include "channel.h"
 
 typedef struct GAChannelReadState {
     guint thread_id;
qga/commands-posix.c +1 -1
index 0dc219d..eae8171 100644
@@ -16,7 +16,7 @@
 #include <sys/utsname.h>
 #include <sys/wait.h>
 #include <dirent.h>
-#include "qga/guest-agent-core.h"
+#include "guest-agent-core.h"
 #include "qga-qapi-commands.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
qga/commands-win32.c +2 -2
index 2d48394..70ee537 100644
@@ -32,8 +32,8 @@
 #include <wtsapi32.h>
 #include <wininet.h>
 
-#include "qga/guest-agent-core.h"
-#include "qga/vss-win32.h"
+#include "guest-agent-core.h"
+#include "vss-win32.h"
 #include "qga-qapi-commands.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
qga/commands.c +1 -1
index a64b34c..cce3010 100644
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qga/guest-agent-core.h"
+#include "guest-agent-core.h"
 #include "qga-qapi-commands.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
qga/guest-agent-command-state.c +1 -1
index e609d32..18bcb59 100644
@@ -10,7 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include "qga/guest-agent-core.h"
+#include "guest-agent-core.h"
 
 struct GACommandState {
     GSList *groups;
qga/main.c +2 -2
index 1e1cec7..ea7540e 100644
@@ -23,12 +23,12 @@
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qjson.h"
 #include "qapi/qmp/qstring.h"
-#include "qga/guest-agent-core.h"
+#include "guest-agent-core.h"
 #include "qemu/module.h"
 #include "qga-qapi-commands.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/error.h"
-#include "qga/channel.h"
+#include "channel.h"
 #include "qemu/bswap.h"
 #include "qemu/help_option.h"
 #include "qemu/sockets.h"
qga/vss-win32.c +3 -3
index 0199c2a..a541f3a 100644
@@ -14,9 +14,9 @@
 #include <windows.h>
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "qga/guest-agent-core.h"
-#include "qga/vss-win32.h"
-#include "qga/vss-win32/requester.h"
+#include "guest-agent-core.h"
+#include "vss-win32.h"
+#include "vss-win32/requester.h"
 
 #define QGA_VSS_DLL "qga-vss.dll"
 
Signature · 1 line
MST
#30 lore raw

PATCH v2 15/20 migration: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory. Directory based path works more or less by accident.

---
 migration/block-dirty-bitmap.c | 2 +-
 migration/page_cache.c         | 2 +-
 migration/ram.c                | 4 ++--
 migration/vmstate.c            | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
migration/block-dirty-bitmap.c +1 -1
index 8819aab..eeccaff 100644
@@ -66,7 +66,7 @@
 #include "qemu/error-report.h"
 #include "migration/misc.h"
 #include "migration/migration.h"
-#include "migration/qemu-file.h"
+#include "qemu-file.h"
 #include "migration/vmstate.h"
 #include "migration/register.h"
 #include "qemu/hbitmap.h"
migration/page_cache.c +1 -1
index 96268c3..acc252b 100644
@@ -18,7 +18,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/host-utils.h"
-#include "migration/page_cache.h"
+#include "page_cache.h"
 
 #ifdef DEBUG_CACHE
 #define DPRINTF(fmt, ...) \
migration/ram.c +2 -2
index 5bcbf7a..e7d6cf6 100644
@@ -41,7 +41,7 @@
 #include "migration/misc.h"
 #include "qemu-file.h"
 #include "postcopy-ram.h"
-#include "migration/page_cache.h"
+#include "page_cache.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "qapi/qapi-events-migration.h"
@@ -51,7 +51,7 @@
 #include "exec/target_page.h"
 #include "qemu/rcu_queue.h"
 #include "migration/colo.h"
-#include "migration/block.h"
+#include "block.h"
 #include "sysemu/sysemu.h"
 #include "qemu/uuid.h"
 #include "savevm.h"
migration/vmstate.c +1 -1
index 0b3282c..0a09636 100644
@@ -14,7 +14,7 @@
 #include "qemu-common.h"
 #include "migration.h"
 #include "migration/vmstate.h"
-#include "migration/savevm.h"
+#include "savevm.h"
 #include "qemu-file.h"
 #include "qemu/bitops.h"
 #include "qemu/error-report.h"
Signature · 1 line
MST
#38 lore raw

PATCH v2 18/20 trace: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 trace/qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace/qmp.c +1 -1
index 756086c..ea99b00 100644
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-trace.h"
-#include "trace/control.h"
+#include "control.h"
 
 
 static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp)
Signature · 1 line
MST
#40 lore raw

PATCH v2 19/20 ui: use local path for local headers

In reply to Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 ui/gtk.c          | 2 +-
 ui/input-keymap.c | 2 +-
 ui/input-legacy.c | 2 +-
 ui/spice-input.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
ui/gtk.c +1 -1
index dbce970..903f136 100644
@@ -66,7 +66,7 @@
 #define VC_SCALE_STEP   0.25
 
 #ifdef GDK_WINDOWING_X11
-#include "ui/x_keymap.h"
+#include "x_keymap.h"
 
 /* Gtk2 compat */
 #ifndef GDK_IS_X11_DISPLAY
ui/input-keymap.c +1 -1
index 3d4e66b..87cc301 100644
@@ -1,6 +1,6 @@
 #include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
-#include "ui/keymaps.h"
+#include "keymaps.h"
 #include "ui/input.h"
 
 #include "standard-headers/linux/input.h"
ui/input-legacy.c +1 -1
index e5d4db1..549654e 100644
@@ -26,7 +26,7 @@
 #include "qapi/qapi-commands-ui.h"
 #include "sysemu/sysemu.h"
 #include "ui/console.h"
-#include "ui/keymaps.h"
+#include "keymaps.h"
 #include "ui/input.h"
 
 struct QEMUPutMouseEntry {
ui/spice-input.c +1 -1
index 3d41aa1..a426c03 100644
@@ -23,7 +23,7 @@
 #include "qemu-common.h"
 #include "ui/qemu-spice.h"
 #include "ui/console.h"
-#include "ui/keymaps.h"
+#include "keymaps.h"
 #include "ui/input.h"
 
 /* keyboard bits */
Signature · 1 line
MST
#41 lore raw

PATCH v2 20/20 arch_init: sort architectures

In reply to Michael S. Tsirkin

Sort alphabetically. Will help us see if anything is missing (e.g. tile is not there now).

---
 arch_init.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch_init.c +8 -8
index 9597218..f4f3f61 100644
@@ -52,14 +52,14 @@ int graphic_depth = 32;
 #define QEMU_ARCH QEMU_ARCH_ARM
 #elif defined(TARGET_CRIS)
 #define QEMU_ARCH QEMU_ARCH_CRIS
-#elif defined(TARGET_I386)
-#define QEMU_ARCH QEMU_ARCH_I386
 #elif defined(TARGET_HPPA)
 #define QEMU_ARCH QEMU_ARCH_HPPA
-#elif defined(TARGET_M68K)
-#define QEMU_ARCH QEMU_ARCH_M68K
+#elif defined(TARGET_I386)
+#define QEMU_ARCH QEMU_ARCH_I386
 #elif defined(TARGET_LM32)
 #define QEMU_ARCH QEMU_ARCH_LM32
+#elif defined(TARGET_M68K)
+#define QEMU_ARCH QEMU_ARCH_M68K
 #elif defined(TARGET_MICROBLAZE)
 #define QEMU_ARCH QEMU_ARCH_MICROBLAZE
 #elif defined(TARGET_MIPS)
@@ -80,12 +80,12 @@ int graphic_depth = 32;
 #define QEMU_ARCH QEMU_ARCH_SH4
 #elif defined(TARGET_SPARC)
 #define QEMU_ARCH QEMU_ARCH_SPARC
-#elif defined(TARGET_XTENSA)
-#define QEMU_ARCH QEMU_ARCH_XTENSA
-#elif defined(TARGET_UNICORE32)
-#define QEMU_ARCH QEMU_ARCH_UNICORE32
 #elif defined(TARGET_TRICORE)
 #define QEMU_ARCH QEMU_ARCH_TRICORE
+#elif defined(TARGET_UNICORE32)
+#define QEMU_ARCH QEMU_ARCH_UNICORE32
+#elif defined(TARGET_XTENSA)
+#define QEMU_ARCH QEMU_ARCH_XTENSA
 #endif
 
 const uint32_t arch_type = QEMU_ARCH;
Signature · 1 line
MST
#31 lore raw

Re: [Qemu-devel] [PATCH v2 15/20] migration: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 1 line · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as

s/as C/as the C/ (here and in many other messages)

Quoted 2 lines

opposed to one in include/), we should use its relative path, without a directory. Directory based path works more or less by accident.

Missed trimming this out of your commit message.

Or, if you want, on many of these commits, you could be more explicit about intention:

When pulling in headers that are in the same directory as the C file (as opposed to one in include/), we prefer to use its relative path without a directory, rather than relying on the global -I$(SRC_DIR) that may be removed in a later patch.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v2 15/20
#33 lore raw

Re: [Qemu-devel] [PATCH v2 15/20] migration: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 3 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory. Directory based path works more or less by accident.

I don't agree with the comment that they work by accident, it is "by-design". But if you want to change the design, I agree with removing "$ROOT" from the default include path.

Quoted 2 lines

Later, Juan.

Reviewed-by on v2 1/20
#2 lore raw

Re: [Qemu-devel] [PATCH v2 01/20] block: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 1 line · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as

s/as C/as the C/

Quoted 4 lines

opposed to one in include/), we should use its relative path, without a directory.

Quoted 13 lines
---
  block/crypto.c         | 2 +-
  block/nbd.c            | 2 +-
  block/qcow.c           | 2 +-
  block/qcow2-bitmap.c   | 2 +-
  block/qcow2-cluster.c  | 2 +-
  block/qcow2-refcount.c | 2 +-
  block/qcow2-snapshot.c | 2 +-
  block/qcow2.c          | 4 ++--
  block/vhdx-endian.c    | 2 +-
  block/vhdx-log.c       | 2 +-
  block/vhdx.c           | 2 +-
  11 files changed, 12 insertions(+), 12 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v2 4/20
#9 lore raw

Re: [Qemu-devel] [PATCH v2 04/20] migration: drop an unused include

In reply to Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin

we just need a struct name, let's add a forward
declaration instead of an include.

---
  include/migration/vmstate.h | 2 +-
  migration/savevm.c          | 1 +
  2 files changed, 2 insertions(+), 1 deletion(-)

I'm okay with the patch as-is, but the commit message could possibly be improved:

In the vmstate.h file, we just need a struct name. Use a forward declaration instead of an include, then adjust the one affected .c file to include the file that is no longer implicit from the header.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#43 lore raw
In reply to Michael S. Tsirkin
Quoted 18 lines · Michael S. Tsirkin

Right now, a local header can be included with either

#include "foo.h"
or
#include "dir/foo.h"

since the later doesn't tell you where the header is (in source or include directory), the former is preferable.

I intend to look for ways to prevent the second way from working, but that will take time. For now, fix all instances for the later way I could find.

In a couple of places I just dropped the include instead.

Finally, arch_init huge list of includes is sorted, which will be helpful in future cleanups.

Quoted 7 lines

This was part of the include path cleanup patchset
(https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg00739.html).

Changes from v1
drop patches not dealing with local headers
stop saying include through root works by accident -
it's not by accident, just not how we'd like code to look like

You mostly did that, but I still think some of the commit messages can be improved. See 15/20.

Quoted 1 line

address comments by eric, philip, others

At any rate, I think we are getting closer; and splitting this into a less-controversial part compared to the rest of v1 makes it more likely that this half can go in soon. Many of the patches are independent, but it's still probably easier if this goes in through one tree (Paolo's misc tree, perhaps?), once you've collected reviews.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#32 lore raw

Re: [Qemu-devel] [PATCH v2 15/20] migration: use local path for local headers

In reply to Eric Blake
Quoted 4 lines · Eric Blake
Quoted 1 line · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as

s/as C/as the C/ (here and in many other messages)

Will fix, thanks.

Quoted 4 lines
Quoted 2 lines

opposed to one in include/), we should use its relative path, without a directory. Directory based path works more or less by accident.

Missed trimming this out of your commit message.

Will fix, thanks.

Quoted 7 lines

Or, if you want, on many of these commits, you could be more explicit about intention:

When pulling in headers that are in the same directory as the C file (as opposed to one in include/), we prefer to use its relative path without a directory, rather than relying on the global -I$(SRC_DIR) that may be removed in a later patch.

I'm no longer sure we'll be able to.

Quoted 4 lines
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#34 lore raw

Re: [Qemu-devel] [PATCH v2 15/20] migration: use local path for local headers

In reply to Juan Quintela
Quoted 6 lines · Juan Quintela
Quoted 3 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory. Directory based path works more or less by accident.

I don't agree with the comment that they work by accident,

Oh I removed this from most commit messages but somehow this one managed to sneek in. I agree, will drop this sentence.

Quoted 10 lines

it is
"by-design". But if you want to change the design, I agree with removing "$ROOT" from the default include path.

Quoted 2 lines

Later, Juan.

Thanks!

#11 lore raw

Re: [Qemu-devel] [PATCH v2 05/20] trace: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 11 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

This reminds me of this project:

https://github.com/noidontdig/gitdown

gitdown is a script which moderates your git committing activity based on your blood alcohol content (BAC).

:P

Quoted 17 lines
---
 trace/control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace/control.h +1 -1
index 1903e22..eb65c8e 100644
@@ -267,6 +267,6 @@ char *trace_opt_parse(const char *optarg);
 uint32_t trace_get_vcpu_event_count(void);
 
 
-#include "trace/control-internal.h"
+#include "control-internal.h"
 
 #endif /* TRACE__CONTROL_H */
Reviewed-by Tested-by on v2 13/20
#27 lore raw

Re: [Qemu-devel] [PATCH v2 13/20] sd: fix up include

In reply to Michael S. Tsirkin
Quoted 4 lines · Michael S. Tsirkin

include files shouldn't have the "include/" part,
that is implied.

Quoted 18 lines
---
 hw/sd/milkymist-memcard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/sd/milkymist-memcard.c +1 -1
index 5570c1e..fe1cccc 100644
@@ -27,7 +27,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
-#include "include/qapi/error.h"
+#include "qapi/error.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/sd/sd.h"
Reviewed-by Tested-by on v2 18/20
#39 lore raw

Re: [Qemu-devel] [PATCH v2 18/20] trace: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 18 lines
---
 trace/qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace/qmp.c +1 -1
index 756086c..ea99b00 100644
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-trace.h"
-#include "trace/control.h"
+#include "control.h"
 
 
 static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp)
Reviewed-by Tested-by on v2 10/20
#21 lore raw

Re: [Qemu-devel] [PATCH v2 10/20] rocker: drop an unused include

In reply to Michael S. Tsirkin
Quoted 3 lines · Michael S. Tsirkin

We don't use net/clients.h, drop that include.

Quoted 17 lines
---
 hw/net/rocker/rocker_fp.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/rocker/rocker_fp.c +0 -1
index 27b17c8..4aa7da7 100644
@@ -15,7 +15,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "net/clients.h"
 #include "qapi/qapi-types-rocker.h"
 #include "rocker.h"
 #include "rocker_hw.h"
Reviewed-by Tested-by on v2 14/20
#29 lore raw

Re: [Qemu-devel] [PATCH v2 14/20] usb: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 185 lines
---
 hw/usb/desc-msos.c            | 2 +-
 hw/usb/desc.c                 | 2 +-
 hw/usb/dev-audio.c            | 2 +-
 hw/usb/dev-bluetooth.c        | 2 +-
 hw/usb/dev-hid.c              | 2 +-
 hw/usb/dev-hub.c              | 2 +-
 hw/usb/dev-mtp.c              | 2 +-
 hw/usb/dev-network.c          | 2 +-
 hw/usb/dev-serial.c           | 2 +-
 hw/usb/dev-smartcard-reader.c | 2 +-
 hw/usb/dev-storage.c          | 2 +-
 hw/usb/dev-uas.c              | 2 +-
 hw/usb/dev-wacom.c            | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
hw/usb/desc-msos.c +1 -1
index 3652919..3a5ad7c 100644
@@ -1,6 +1,6 @@
 #include "qemu/osdep.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 /*
  * Microsoft OS Descriptors
hw/usb/desc.c +1 -1
index 85c15ad..8b6eaea 100644
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
 
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "trace.h"
 
 /* ------------------------------------------------------------------ */
hw/usb/dev-audio.c +1 -1
index 3433452..ee43e49 100644
@@ -32,7 +32,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "hw/hw.h"
 #include "audio/audio.h"
 
hw/usb/dev-bluetooth.c +1 -1
index 0bbceae..eac7365 100644
@@ -22,7 +22,7 @@
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "sysemu/bt.h"
 #include "hw/bt.h"
 
hw/usb/dev-hid.c +1 -1
index c40019d..62d1829 100644
@@ -26,7 +26,7 @@
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "hw/input/hid.h"
hw/usb/dev-hub.c +1 -1
index 752e30c..5d9743ef 100644
@@ -26,7 +26,7 @@
 #include "qemu-common.h"
 #include "trace.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "qemu/error-report.h"
 
 #define NUM_PORTS 8
hw/usb/dev-mtp.c +1 -1
index 3d59fe4..560c61c 100644
@@ -24,7 +24,7 @@
 #include "qemu/iov.h"
 #include "trace.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 /* ----------------------------------------------------------------------- */
 
hw/usb/dev-network.c +1 -1
index aea7edc..385e090 100644
@@ -27,7 +27,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "net/net.h"
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
hw/usb/dev-serial.c +1 -1
index 2829dda..98d1ca3 100644
@@ -14,7 +14,7 @@
 #include "qemu/cutils.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "chardev/char-serial.h"
 #include "chardev/char-fe.h"
 
hw/usb/dev-smartcard-reader.c +1 -1
index f745192..2131e33 100644
@@ -39,7 +39,7 @@
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 #include "ccid.h"
 
hw/usb/dev-storage.c +1 -1
index b56c75a..f2f632a 100644
@@ -14,7 +14,7 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "hw/scsi/scsi.h"
 #include "ui/console.h"
 #include "monitor/monitor.h"
hw/usb/dev-uas.c +1 -1
index c218b53..aaf5a88 100644
@@ -17,7 +17,7 @@
 #include "qemu/error-report.h"
 
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 #include "hw/scsi/scsi.h"
 #include "scsi/constants.h"
 
hw/usb/dev-wacom.c +1 -1
index bf70013..ac0bc83 100644
@@ -29,7 +29,7 @@
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/usb.h"
-#include "hw/usb/desc.h"
+#include "desc.h"
 
 /* Interface requests */
 #define WACOM_GET_REPORT	0x2101
Reviewed-by Tested-by on v2 9/20
#19 lore raw

Re: [Qemu-devel] [PATCH v2 09/20] e1000e: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 14 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 hw/net/e1000e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/e1000e.c +0 -0
index 16a9417..cda8d48 100644

hw/net/e1000e.c line 45

Quoted 6 lines
hw/net/e1000e.c +1 -1
@@ -41,7 +41,7 @@
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 
-#include "hw/net/e1000_regs.h"
+#include "e1000_regs.h"
 

Can you remove this extra newline while here?

Quoted 3 lines
hw/net/e1000e.c +0 -0
 #include "e1000x_common.h"
 #include "e1000e_core.h"
Reviewed-by Tested-by on v2 8/20
#17 lore raw

Re: [Qemu-devel] [PATCH v2 08/20] ioapic: fix up includes

In reply to Michael S. Tsirkin
Quoted 6 lines · Michael S. Tsirkin

include files shouldn't have the "include/" part,
that is implied.

Also, drop an unused include.

Quoted 20 lines
---
 hw/intc/ioapic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/intc/ioapic.c +1 -2
index 36139a4..c45f073 100644
@@ -28,9 +28,8 @@
 #include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
 #include "hw/i386/ioapic_internal.h"
-#include "include/hw/pci/msi.h"
+#include "hw/pci/msi.h"
 #include "sysemu/kvm.h"
-#include "target/i386/cpu.h"
 #include "hw/i386/apic-msidef.h"
 #include "hw/i386/x86-iommu.h"
 #include "trace.h"
Reviewed-by Tested-by on v2 7/20
#15 lore raw

Re: [Qemu-devel] [PATCH v2 07/20] ide: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 46 lines
---
 hw/ide/ahci-allwinner.c | 2 +-
 hw/ide/ahci.c           | 2 +-
 hw/ide/ich.c            | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
hw/ide/ahci-allwinner.c +1 -1
index 2fd9507..f98e6cb 100644
@@ -20,7 +20,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/dma.h"
 #include "hw/ide/internal.h"
-#include "hw/ide/ahci_internal.h"
+#include "ahci_internal.h"
 
 #include "trace.h"
 
hw/ide/ahci.c +1 -1
index e22d7be..24dbad5 100644
@@ -31,7 +31,7 @@
 #include "sysemu/dma.h"
 #include "hw/ide/internal.h"
 #include "hw/ide/pci.h"
-#include "hw/ide/ahci_internal.h"
+#include "ahci_internal.h"
 
 #include "trace.h"
 
hw/ide/ich.c +1 -1
index 134478e..51c935a 100644
@@ -67,7 +67,7 @@
 #include "hw/isa/isa.h"
 #include "sysemu/dma.h"
 #include "hw/ide/pci.h"
-#include "hw/ide/ahci_internal.h"
+#include "ahci_internal.h"
 
 #define ICH9_MSI_CAP_OFFSET     0x80
 #define ICH9_SATA_CAP_OFFSET    0xA8
Reviewed-by Tested-by on v2 2/20
#5 lore raw

Re: [Qemu-devel] [PATCH v2 02/20] crypto: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 244 lines
---
 crypto/block-luks.h    | 2 +-
 crypto/block-qcow.h    | 2 +-
 crypto/ivgen-essiv.h   | 2 +-
 crypto/ivgen-plain.h   | 2 +-
 crypto/ivgen-plain64.h | 2 +-
 crypto/block-luks.c    | 2 +-
 crypto/block-qcow.c    | 2 +-
 crypto/block.c         | 6 +++---
 crypto/cipher.c        | 6 +++---
 crypto/ivgen-essiv.c   | 2 +-
 crypto/ivgen-plain.c   | 2 +-
 crypto/ivgen-plain64.c | 2 +-
 crypto/ivgen.c         | 8 ++++----
 crypto/tlscreds.c      | 2 +-
 crypto/tlscredsanon.c  | 2 +-
 crypto/tlscredsx509.c  | 2 +-
 16 files changed, 23 insertions(+), 23 deletions(-)
crypto/block-luks.h +1 -1
index b2d8a35..befd8b2 100644
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_BLOCK_LUKS_H
 #define QCRYPTO_BLOCK_LUKS_H
 
-#include "crypto/blockpriv.h"
+#include "blockpriv.h"
 
 extern const QCryptoBlockDriver qcrypto_block_driver_luks;
 
crypto/block-qcow.h +1 -1
index 3e2c0a8..6988fb2 100644
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_BLOCK_QCOW_H
 #define QCRYPTO_BLOCK_QCOW_H
 
-#include "crypto/blockpriv.h"
+#include "blockpriv.h"
 
 extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
 
crypto/ivgen-essiv.h +1 -1
index 4a00af8..f34dbab 100644
@@ -18,7 +18,7 @@
  *
  */
 
-#include "crypto/ivgenpriv.h"
+#include "ivgenpriv.h"
 
 #ifndef QCRYPTO_IVGEN_ESSIV_H__
 #define QCRYPTO_IVGEN_ESSIV_H__
crypto/ivgen-plain.h +1 -1
index 0fe8835..16e1ae5 100644
@@ -18,7 +18,7 @@
  *
  */
 
-#include "crypto/ivgenpriv.h"
+#include "ivgenpriv.h"
 
 #ifndef QCRYPTO_IVGEN_PLAIN_H__
 #define QCRYPTO_IVGEN_PLAIN_H__
crypto/ivgen-plain64.h +1 -1
index c410445..f8611bd 100644
@@ -18,7 +18,7 @@
  *
  */
 
-#include "crypto/ivgenpriv.h"
+#include "ivgenpriv.h"
 
 #ifndef QCRYPTO_IVGEN_PLAIN64_H__
 #define QCRYPTO_IVGEN_PLAIN64_H__
crypto/block-luks.c +1 -1
index d418ac3..5738124 100644
@@ -22,7 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/bswap.h"
 
-#include "crypto/block-luks.h"
+#include "block-luks.h"
 
 #include "crypto/hash.h"
 #include "crypto/afsplit.h"
crypto/block-qcow.c +1 -1
index 8817d6a..4284e05 100644
@@ -27,7 +27,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 
-#include "crypto/block-qcow.h"
+#include "block-qcow.h"
 #include "crypto/secret.h"
 
 #define QCRYPTO_BLOCK_QCOW_SECTOR_SIZE 512
crypto/block.c +3 -3
index f206d5e..e59d114 100644
@@ -20,9 +20,9 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "crypto/blockpriv.h"
-#include "crypto/block-qcow.h"
-#include "crypto/block-luks.h"
+#include "blockpriv.h"
+#include "block-qcow.h"
+#include "block-luks.h"
 
 static const QCryptoBlockDriver *qcrypto_block_drivers[] = {
     [Q_CRYPTO_BLOCK_FORMAT_QCOW] = &qcrypto_block_driver_qcow,
crypto/cipher.c +3 -3
index bcbfb3d..b3af579 100644
@@ -150,11 +150,11 @@ qcrypto_cipher_munge_des_rfb_key(const uint8_t *key,
 #endif /* CONFIG_GCRYPT || CONFIG_NETTLE */
 
 #ifdef CONFIG_GCRYPT
-#include "crypto/cipher-gcrypt.c"
+#include "cipher-gcrypt.c"
 #elif defined CONFIG_NETTLE
-#include "crypto/cipher-nettle.c"
+#include "cipher-nettle.c"
 #else
-#include "crypto/cipher-builtin.c"
+#include "cipher-builtin.c"
 #endif
 
 QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
crypto/ivgen-essiv.c +1 -1
index aeaa8fc..43e258c 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "crypto/ivgen-essiv.h"
+#include "ivgen-essiv.h"
 
 typedef struct QCryptoIVGenESSIV QCryptoIVGenESSIV;
 struct QCryptoIVGenESSIV {
crypto/ivgen-plain.c +1 -1
index bf2fb7a..06f4145 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "crypto/ivgen-plain.h"
+#include "ivgen-plain.h"
 
 static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen,
                                     const uint8_t *key, size_t nkey,
crypto/ivgen-plain64.c +1 -1
index e4679a1..fbb7724 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "crypto/ivgen-plain.h"
+#include "ivgen-plain.h"
 
 static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen,
                                     const uint8_t *key, size_t nkey,
crypto/ivgen.c +4 -4
index f664351..6a2b3ad 100644
@@ -21,10 +21,10 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 
-#include "crypto/ivgenpriv.h"
-#include "crypto/ivgen-plain.h"
-#include "crypto/ivgen-plain64.h"
-#include "crypto/ivgen-essiv.h"
+#include "ivgenpriv.h"
+#include "ivgen-plain.h"
+#include "ivgen-plain64.h"
+#include "ivgen-essiv.h"
 
 
 QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgorithm alg,
crypto/tlscreds.c +1 -1
index 3cd4103..02255a6 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "crypto/tlscredspriv.h"
+#include "tlscredspriv.h"
 #include "trace.h"
 
 #define DH_BITS 2048
crypto/tlscredsanon.c +1 -1
index 1464220..7ad66d1 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "crypto/tlscredsanon.h"
-#include "crypto/tlscredspriv.h"
+#include "tlscredspriv.h"
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "trace.h"
crypto/tlscredsx509.c +1 -1
index 50eb54f..98ee042 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "crypto/tlscredsx509.h"
-#include "crypto/tlscredspriv.h"
+#include "tlscredspriv.h"
 #include "crypto/secret.h"
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
Reviewed-by Tested-by on v2 1/20
#3 lore raw

Re: [Qemu-devel] [PATCH v2 01/20] block: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 167 lines
---
 block/crypto.c         | 2 +-
 block/nbd.c            | 2 +-
 block/qcow.c           | 2 +-
 block/qcow2-bitmap.c   | 2 +-
 block/qcow2-cluster.c  | 2 +-
 block/qcow2-refcount.c | 2 +-
 block/qcow2-snapshot.c | 2 +-
 block/qcow2.c          | 4 ++--
 block/vhdx-endian.c    | 2 +-
 block/vhdx-log.c       | 2 +-
 block/vhdx.c           | 2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)
block/crypto.c +1 -1
index 7e7ad2d..bc322b5 100644
@@ -29,7 +29,7 @@
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/error.h"
 #include "qemu/option.h"
-#include "block/crypto.h"
+#include "crypto.h"
 
 typedef struct BlockCrypto BlockCrypto;
 
block/nbd.c +1 -1
index 3e1693c..ff8333e 100644
@@ -27,7 +27,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "block/nbd-client.h"
+#include "nbd-client.h"
 #include "qapi/error.h"
 #include "qemu/uri.h"
 #include "block/block_int.h"
block/qcow.c +1 -1
index 3ba2ca2..1f866af 100644
@@ -37,7 +37,7 @@
 #include "qapi/qapi-visit-block-core.h"
 #include "crypto/block.h"
 #include "migration/blocker.h"
-#include "block/crypto.h"
+#include "crypto.h"
 
 /**************************************************************/
 /* QEMU COW block driver with compression and encryption support */
block/qcow2-bitmap.c +1 -1
index 6e93ec4..60d5290 100644
@@ -30,7 +30,7 @@
 #include "qemu/cutils.h"
 
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 
 /* NOTICE: BME here means Bitmaps Extension and used as a namespace for
  * _internal_ constants. Please do not use this _internal_ abbreviation for
block/qcow2-cluster.c +1 -1
index 1aee726..0d74584 100644
@@ -28,7 +28,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/bswap.h"
 #include "trace.h"
 
block/qcow2-refcount.c +1 -1
index 2dc2300..4032362 100644
@@ -26,7 +26,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/range.h"
 #include "qemu/bswap.h"
 #include "qemu/cutils.h"
block/qcow2-snapshot.c +1 -1
index 74293be..bb6a5b7 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "block/block_int.h"
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/bswap.h"
 #include "qemu/error-report.h"
 #include "qemu/cutils.h"
block/qcow2.c +2 -2
index 6d53247..db13109 100644
@@ -27,7 +27,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
 #include <zlib.h>
-#include "block/qcow2.h"
+#include "qcow2.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "qapi/qapi-events-block-core.h"
@@ -39,7 +39,7 @@
 #include "qemu/bswap.h"
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/qapi-visit-block-core.h"
-#include "block/crypto.h"
+#include "crypto.h"
 
 /*
   Differences with QCOW:
block/vhdx-endian.c +1 -1
index 429d755..41fbdd2 100644
@@ -19,7 +19,7 @@
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/bswap.h"
-#include "block/vhdx.h"
+#include "vhdx.h"
 
 /*
  * All the VHDX formats on disk are little endian - the following
block/vhdx-log.c +1 -1
index 0ac4863..d2f1b98 100644
@@ -24,7 +24,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/bswap.h"
-#include "block/vhdx.h"
+#include "vhdx.h"
 
 
 typedef struct VHDXLogSequence {
block/vhdx.c +1 -1
index 0b1e21c..79c68a2 100644
@@ -23,7 +23,7 @@
 #include "qemu/option.h"
 #include "qemu/crc32c.h"
 #include "qemu/bswap.h"
-#include "block/vhdx.h"
+#include "vhdx.h"
 #include "migration/blocker.h"
 #include "qemu/uuid.h"
 #include "qapi/qmp/qdict.h"
#12 lore raw

Re: [Qemu-devel] [PATCH v2 05/20] trace: use local path for local headers

In reply to Philippe Mathieu-Daudé
Quoted 15 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

This reminds me of this project:

Quoted 7 lines

https://github.com/noidontdig/gitdown

gitdown is a script which moderates your git committing activity based on your blood alcohol content (BAC).

:P

Oh I have a script that attaches signatures, and it does not check for duplicates.

I started rewriting it using git interpret-trailers but Junio asked me to rework interpret-trailers first and I didn't bother yet.

Quoted 17 lines
Quoted 17 lines
---
 trace/control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace/control.h +1 -1
index 1903e22..eb65c8e 100644
@@ -267,6 +267,6 @@ char *trace_opt_parse(const char *optarg);
 uint32_t trace_get_vcpu_event_count(void);
 
 
-#include "trace/control-internal.h"
+#include "control-internal.h"
 
 #endif /* TRACE__CONTROL_H */
#44 lore raw
In reply to Eric Blake
Quoted 30 lines · Eric Blake
Quoted 18 lines · Michael S. Tsirkin

Right now, a local header can be included with either

#include "foo.h"
or
#include "dir/foo.h"

since the later doesn't tell you where the header is (in source or include directory), the former is preferable.

I intend to look for ways to prevent the second way from working, but that will take time. For now, fix all instances for the later way I could find.

In a couple of places I just dropped the include instead.

Finally, arch_init huge list of includes is sorted, which will be helpful in future cleanups.

Quoted 7 lines

This was part of the include path cleanup patchset
(https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg00739.html).

Changes from v1
drop patches not dealing with local headers
stop saying include through root works by accident -
it's not by accident, just not how we'd like code to look like

You mostly did that, but I still think some of the commit messages can be improved. See 15/20.

Quoted 7 lines
Quoted 1 line

address comments by eric, philip, others

At any rate, I think we are getting closer; and splitting this into a less-controversial part compared to the rest of v1 makes it more likely that this half can go in soon. Many of the patches are independent, but it's still probably easier if this goes in through one tree (Paolo's misc tree, perhaps?), once you've collected reviews.

I plan to just merge these through my tree.

Quoted 4 lines
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by Tested-by on v2 11/20
#23 lore raw

Re: [Qemu-devel] [PATCH v2 11/20] ppc: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 6 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 34 lines
---
 hw/ppc/ppc440_uc.c | 2 +-
 hw/ppc/sam460ex.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
hw/ppc/ppc440_uc.c +1 -1
index e312fdb..123f4ac 100644
@@ -20,7 +20,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/block-backend.h"
-#include "hw/ppc/ppc440.h"
+#include "ppc440.h"
 
 /*****************************************************************************/
 /* L2 Cache as SRAM */
hw/ppc/sam460ex.c +2 -2
index a48e6e6..cb2ab1d 100644
@@ -27,8 +27,8 @@
 #include "elf.h"
 #include "exec/address-spaces.h"
 #include "exec/memory.h"
-#include "hw/ppc/ppc440.h"
-#include "hw/ppc/ppc405.h"
+#include "ppc440.h"
+#include "ppc405.h"
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
Reviewed-by Tested-by on v2 12/20
#25 lore raw

Re: [Qemu-devel] [PATCH v2 12/20] vhost-scsi: drop an unused include

In reply to Michael S. Tsirkin
Quoted 3 lines · Michael S. Tsirkin

No reason for vhost-scsi to pull in migration headers directly.

Quoted 17 lines
---
 hw/scsi/vhost-scsi-common.c | 1 -
 1 file changed, 1 deletion(-)
hw/scsi/vhost-scsi-common.c +0 -1
index 77e9897..e2a5828 100644
@@ -17,7 +17,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
-#include "migration/migration.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-scsi-common.h"
 #include "hw/virtio/virtio-scsi.h"
Reviewed-by Tested-by on v2 16/20
#36 lore raw

Re: [Qemu-devel] [PATCH v2 16/20] colo: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 6 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

Quoted 46 lines
---
 net/colo-compare.c    | 2 +-
 net/colo.c            | 2 +-
 net/filter-rewriter.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
net/colo-compare.c +1 -1
index 23b2d2c..c3a2be4 100644
@@ -25,7 +25,7 @@
 #include "net/queue.h"
 #include "chardev/char-fe.h"
 #include "qemu/sockets.h"
-#include "net/colo.h"
+#include "colo.h"
 #include "sysemu/iothread.h"
 
 #define TYPE_COLO_COMPARE "colo-compare"
net/colo.c +1 -1
index 8426265..6dda4ed 100644
@@ -14,7 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "trace.h"
-#include "net/colo.h"
+#include "colo.h"
 
 uint32_t connection_key_hash(const void *opaque)
 {
net/filter-rewriter.c +1 -1
index 62dad2d..f584e4e 100644
@@ -11,7 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "trace.h"
-#include "net/colo.h"
+#include "colo.h"
 #include "net/filter.h"
 #include "net/net.h"
 #include "qemu-common.h"
Reviewed-by on v2 20/20
#42 lore raw

Re: [Qemu-devel] [PATCH v2 20/20] arch_init: sort architectures

In reply to Michael S. Tsirkin
Quoted 39 lines · Michael S. Tsirkin

Sort alphabetically. Will help us see if anything is missing (e.g. tile is not there now).

---
 arch_init.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch_init.c +4 -7
index 9597218..f4f3f61 100644
@@ -52,14 +52,14 @@ int graphic_depth = 32;
 #define QEMU_ARCH QEMU_ARCH_ARM
 #elif defined(TARGET_CRIS)
 #define QEMU_ARCH QEMU_ARCH_CRIS
-#elif defined(TARGET_I386)
-#define QEMU_ARCH QEMU_ARCH_I386
 #elif defined(TARGET_HPPA)
 #define QEMU_ARCH QEMU_ARCH_HPPA
-#elif defined(TARGET_M68K)
-#define QEMU_ARCH QEMU_ARCH_M68K
+#elif defined(TARGET_I386)
+#define QEMU_ARCH QEMU_ARCH_I386
 #elif defined(TARGET_LM32)
 #define QEMU_ARCH QEMU_ARCH_LM32
+#elif defined(TARGET_M68K)
+#define QEMU_ARCH QEMU_ARCH_M68K
 #elif defined(TARGET_MICROBLAZE)
 #define QEMU_ARCH QEMU_ARCH_MICROBLAZE
 #elif defined(TARGET_MIPS)
@@ -80,12 +80,12 @@ int graphic_depth = 32;
 #define QEMU_ARCH QEMU_ARCH_SH4
 #elif defined(TARGET_SPARC)
 #define QEMU_ARCH QEMU_ARCH_SPARC
-#elif defined(TARGET_XTENSA)
-#define QEMU_ARCH QEMU_ARCH_XTENSA
-#elif defined(TARGET_UNICORE32)

arch_init.c int graphic_depth = 32; · line 91

Quoted 10 lines
arch_init.c +4 -1
-#define QEMU_ARCH QEMU_ARCH_UNICORE32
 #elif defined(TARGET_TRICORE)
 #define QEMU_ARCH QEMU_ARCH_TRICORE
+#elif defined(TARGET_UNICORE32)
+#define QEMU_ARCH QEMU_ARCH_UNICORE32
+#elif defined(TARGET_XTENSA)
+#define QEMU_ARCH QEMU_ARCH_XTENSA
 #endif
 
 const uint32_t arch_type = QEMU_ARCH;

I sorted the list from scratch, using some regexes to temporarily move the #define's to the same lines as the #[el]if's. My results were identical to those of this patch.

Thanks
Laszlo

Acked-by on v2 2/20
#6 lore raw

Re: [Qemu-devel] [PATCH v2 02/20] crypto: use local path for local headers

In reply to Michael S. Tsirkin
Quoted 15 lines · Michael S. Tsirkin

When pulling in headers that are in the same directory as C file (as opposed to one in include/), we should use its relative path, without a directory.

---
 crypto/block-luks.h    | 2 +-
 crypto/block-qcow.h    | 2 +-
 crypto/ivgen-essiv.h   | 2 +-
 crypto/ivgen-plain.h   | 2 +-
 crypto/ivgen-plain64.h | 2 +-
 crypto/block-luks.c    | 2 +-
 crypto/block-qcow.c    | 2 +-
 crypto/block.c         | 6 +++---
 crypto/cipher.c        | 6 +++---
Quoted 8 lines
 crypto/ivgen-essiv.c   | 2 +-
 crypto/ivgen-plain.c   | 2 +-
 crypto/ivgen-plain64.c | 2 +-
 crypto/ivgen.c         | 8 ++++----
 crypto/tlscreds.c      | 2 +-
 crypto/tlscredsanon.c  | 2 +-
 crypto/tlscredsx509.c  | 2 +-
 16 files changed, 23 insertions(+), 23 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|