From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo5H9-0001vM-45 for qemu-devel@nongnu.org; Fri, 10 Aug 2018 07:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo5H8-0002vy-1Q for qemu-devel@nongnu.org; Fri, 10 Aug 2018 07:08:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39032 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 1fo5H7-0002vT-RA for qemu-devel@nongnu.org; Fri, 10 Aug 2018 07:08:09 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F83C81663CE for ; Fri, 10 Aug 2018 11:08:09 +0000 (UTC) From: Juan Quintela In-Reply-To: <20180810131717-mutt-send-email-mst@kernel.org> (Michael S. Tsirkin's message of "Fri, 10 Aug 2018 13:17:54 +0300") 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> <20180810131717-mutt-send-email-mst@kernel.org> Reply-To: quintela@redhat.com Date: Fri, 10 Aug 2018 13:08:00 +0200 Message-ID: <87va8iv5rj.fsf@trasno.org> MIME-Version: 1.0 Content-Type: text/plain 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: "Michael S. Tsirkin" Cc: "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, lvivier@redhat.com, peterx@redhat.com "Michael S. Tsirkin" wrote: > 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? Miss-type. I mean the .c file. ok, will do for the next round. Thanks for the comments. >> #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. >>