From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mza7s-0001Q8-4a for qemu-devel@nongnu.org; Sun, 18 Oct 2009 14:05:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mza7n-0001PY-CR for qemu-devel@nongnu.org; Sun, 18 Oct 2009 14:05:03 -0400 Received: from [199.232.76.173] (port=56638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mza7n-0001PV-71 for qemu-devel@nongnu.org; Sun, 18 Oct 2009 14:04:59 -0400 Received: from mail-fx0-f211.google.com ([209.85.220.211]:52673) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mza7m-0005z8-Nf for qemu-devel@nongnu.org; Sun, 18 Oct 2009 14:04:58 -0400 Received: by fxm7 with SMTP id 7so4019058fxm.34 for ; Sun, 18 Oct 2009 11:04:54 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4ADB58C4.8000705@gnu.org> Date: Sun, 18 Oct 2009 20:04:52 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 01/10] Introduce qmisc module References: <1255037747-3340-1-git-send-email-lcapitulino@redhat.com> <1255037747-3340-2-git-send-email-lcapitulino@redhat.com> <4AD72B88.2040107@codemonkey.ws> <20091015122622.1f93ea2d@doriath> <20091015163936.GB532@redhat.com> <20091015142837.6c90580a@doriath> <4AD76B3C.3050001@codemonkey.ws> <4AD87424.3010000@redhat.com> <4AD87901.5030705@codemonkey.ws> <4AD8AECE.9000507@redhat.com> <4AD8AFA4.4070203@codemonkey.ws> <4AD8CB31.9080809@redhat.com> <4AD8E7B5.8000509@codemonkey.ws> <4AD910BA.4090607@gnu.org> <4AD922EB.5030501@codemonkey.ws> <4AD995FD.6070202@snarc.org> <20091018120631.0ab44d80@doriath> <4ADB2172.2040501@gnu.org> <4ADB2B13.4090207@codemonkey.ws> <20091018131818.6d8d73ae@doriath> <4ADB337B.7080803@gnu.org> <20091018140535.17eca067@doriath> <4ADB430B.6060507@codemonkey.ws> In-Reply-To: <4ADB430B.6060507@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Vincent Hanquez , Luiz Capitulino On 10/18/2009 06:32 PM, Anthony Liguori wrote: > > What's the value of integrating into the objects verses having a > separate function that can apply it to the objects? That's just different style. Of course you could do a switch(qobject_type(qobject)) instead of using polymorphism. It would be nicer in some ways, and uglier in other ways. toString however seems pervasive enough that it could deserve a place as a QObject virtual method. Anyway, I probably won't have much code in QEMU in the end, so there's no value in arguing when anyway a very nice design is emerging. It looks like Anthony has most of the JSON plumbing in his brain, so it's better if he keeps the flow going. Feel free to steal my code. Once your stuff is settled I'll see what's missing and rebase/resend. Paolo, at one point tempted to s/encode_json/to_string/ and resubmit :-)