From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo4Ub-0007UY-Ql for qemu-devel@nongnu.org; Fri, 10 Aug 2018 06:18:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo4UY-0001DD-JV for qemu-devel@nongnu.org; Fri, 10 Aug 2018 06:18:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46918 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fo4UY-0001CI-E4 for qemu-devel@nongnu.org; Fri, 10 Aug 2018 06:17:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1490E857AB for ; Fri, 10 Aug 2018 10:17:58 +0000 (UTC) Date: Fri, 10 Aug 2018 13:17:54 +0300 From: "Michael S. Tsirkin" Message-ID: <20180810131717-mutt-send-email-mst@kernel.org> References: <20180808114830.7169-1-quintela@redhat.com> <20180808114830.7169-10-quintela@redhat.com> <20180809190303.GF2618@work-vm> <20180810015411-mutt-send-email-mst@kernel.org> <87d0uqwu7r.fsf@trasno.org> <20180810122918-mutt-send-email-mst@kernel.org> <878t5ewnef.fsf@trasno.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878t5ewnef.fsf@trasno.org> Subject: Re: [Qemu-devel] [PATCH v2 09/22] virtio: Remove unneeded includes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, lvivier@redhat.com, peterx@redhat.com On Fri, Aug 10, 2018 at 12:01:44PM +0200, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Fri, Aug 10, 2018 at 09:34:32AM +0200, Juan Quintela wrote: > >> "Michael S. Tsirkin" wrote: > >> > On Thu, Aug 09, 2018 at 08:03:03PM +0100, Dr. David Alan Gilbert wrote: > >> >> * Juan Quintela (quintela@redhat.com) wrote: > >> >> > They are all already included in virtio_pci.h. > >> > > >> > All I see in virtio_pci.h is: > >> > > >> > #include "standard-headers/linux/types.h" > >> > > >> > Weird. > >> > > >> > BTW what's the point of this patch? Generally it's best not to depend > >> > on headers including each other, it makes refactoring harder. > >> > >> If you see the following patches, we remove blk, net, serial, scsi, > >> balloon and input bits from that file, so I was removing includes patch > >> by patch. > >> > >> And at the end, I found that we only need that ones. > >> > >> "virtio-pci.h" does too many things here, I could have split it also, > >> because the mayority of the bits are only used now inside their own > >> virtio-foo-pci.c. But then, there are things that share bits, > >> virtio-bus-pci is used for lots of stuff, virtio-input-pci bits are used > >> in virtio-input-host-pci.c, etc, So I decided to only do the direct > >> split. > >> > >> And about including directly all the files that you use, and including > >> only the files that are extrictly needed, the normal argument is that > >> the less includes, the faster compiler times. > >> > >> Later, Juan. > > > > That's reverse of the direction we have been going. > > Pls move includes when you split up the files. > > Hi > > You want this bit of virtio-pci.h into vhost-vsock-pci.h? In fact can we move it into c file? > #ifdef CONFIG_VHOST_VSOCK > /* > * vhost-vsock-pci: This extends VirtioPCIProxy. > */ > #define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci" > #define VHOST_VSOCK_PCI(obj) \ > OBJECT_CHECK(VHostVSockPCI, (obj), TYPE_VHOST_VSOCK_PCI) > > struct VHostVSockPCI { > VirtIOPCIProxy parent_obj; > VHostVSock vdev; > }; > #endif > > Except for shared things (input, bus, ...) the rest are only used on > the file that uses them. > > Later, Juan. >