From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Reordering how tap is initialized Date: Fri, 14 Aug 2009 11:28:56 -0500 Message-ID: <4A8590C8.7000207@codemonkey.ws> References: <4A8565C6.2020507@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Stephane Bakhos Return-path: Received: from mail-qy0-f196.google.com ([209.85.221.196]:52817 "EHLO mail-qy0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755974AbZHNQ27 (ORCPT ); Fri, 14 Aug 2009 12:28:59 -0400 Received: by qyk34 with SMTP id 34so1235637qyk.33 for ; Fri, 14 Aug 2009 09:29:00 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Stephane Bakhos wrote: >> Stephane Bakhos wrote: >>> This is my first patch, so I apoligize for breaking any convention. >>> >>> This patch modifies the order used in net.c for tap initialization. >>> It runs the script before the device is opened. >> >> This will break existing scripts that do not rely on explicitly >> setting ifname= and instead rely on tap_open() to allocate a tap >> device. In fact, this is one of the most common usages. > > What about adding create and destroy scripts that are executed before > tap_open / tap_close? Right now, the scripts serve an important purpose. The run after we allocate a tap device but before the guest runs. They serve as a hook in a very specific place in time. The semantics you describe are basically, run a script some time before we open the tap device. Well, that's effectively equivalent to just running the script before running QEMU. So I don't really see any compelling reason to introduce such a hook in QEMU today since you can already achieve this functionality. Regards, Anthony Liguori