From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAd7C-0005Fo-10 for qemu-devel@nongnu.org; Mon, 23 Apr 2018 11:10:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAd77-0002kq-RY for qemu-devel@nongnu.org; Mon, 23 Apr 2018 11:10:49 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:46062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fAd77-0002j7-Gk for qemu-devel@nongnu.org; Mon, 23 Apr 2018 11:10:45 -0400 Received: by mail-lf0-x22a.google.com with SMTP id q5-v6so15495289lff.12 for ; Mon, 23 Apr 2018 08:10:45 -0700 (PDT) MIME-Version: 1.0 From: Omer Katz Date: Mon, 23 Apr 2018 15:10:32 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: [Qemu-devel] Filtering files passing through MTP devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi everyone, We have a use case that requires us to only allow certain files to pass through to the guest machine from USB storage devices. I was told on IRC that such a feature does not exist but the easiest way to achieve our goal is to contribute a patch the the MTP device driver since other drivers operate on a filesystem level instead of a file level which is what we need. The plan is to pass the contents of each file to a program through stdin and decide based on the exit code if the file should be allowed to pass through to the guest or not. Since this is the first time I'm contributing to QEMU I'd like some guidance to where the filtering code should be. https://github.com/qemu/qemu/blob/master/hw/usb/dev-mtp.c doesn't look that complicated but I still need to understand it better to continue. Furthermore, I need to know where to add such a command line option to point QEMU to the filtering program. Would such a patch be accepted if all the requirements above are met? Best Regards, Omer Katz.