Received: from eggs.gnu.org ([2001:4830:134:3::10]:55250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZ1Sh-0002oW-IM for qemu-devel@nongnu.org; Wed, 01 Feb 2017 15:25:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZ1Sc-0001Hy-L7 for qemu-devel@nongnu.org; Wed, 01 Feb 2017 15:25:03 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:33601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZ1Sc-0001Hd-Fo for qemu-devel@nongnu.org; Wed, 01 Feb 2017 15:24:58 -0500 Received: by mail-pf0-x244.google.com with SMTP id e4so32471265pfg.0 for ; Wed, 01 Feb 2017 12:24:58 -0800 (PST) Sender: Paolo Bonzini References: <1485943606-13998-1-git-send-email-lprosek@redhat.com> <20170201102013.GC3232@redhat.com> <20170201110320.GD3232@redhat.com> <15e45a8d-852e-97da-65c5-3f69258dd59b@redhat.com> From: Paolo Bonzini Message-ID: <5554a4fb-c7e7-aa36-ea82-32931233f56f@redhat.com> Date: Wed, 1 Feb 2017 12:24:53 -0800 MIME-Version: 1.0 In-Reply-To: <15e45a8d-852e-97da-65c5-3f69258dd59b@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qga: implement guest-file-ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Ladi Prosek , "Daniel P. Berrange" Cc: qemu-devel , mdroth@linux.vnet.ibm.com On 01/02/2017 06:43, Eric Blake wrote: >>> It would be possible to design a ioctl API that is more usable if you >>> didn't try to do generic passthrough of arbitrary ioctl commands. Instead >>> provide a QAPI schema that uses a union to provide strongly typed arguments >>> for the ioctl commands you care about using. Or completely separate QAPI >>> commands instead of multiplexing everything into an ioctl command. >> >> I can add a QAPI command for my specific use case if it's acceptable, > > Certainly more palatable, and more likely to gain my acceptance. > >> that's not a problem. Although at that point I would probably just go >> back to my plan b and use regular file I/O and guest-file-read. I just >> wanted to be as generic as possible to benefit other use cases as well >> and I ended up with what's basically my stab at RPC ioctl. > > The problem is that RPC ioctl is not sanely possible. Windows ioctl (DeviceIoControl) is a little different from POSIX ioctl, more RPC and less one-size-fits-all bucket for syscallish stuff. It is still a leaky abstraction though. Paolo