[vbox-dev] [PATCH 2/2] vgdrvLinuxIOCtl: Always return standard Linux errno values

Knut St. Osmundsen knut.osmundsen at oracle.com
Mon Aug 7 23:02:33 GMT 2017


Just to clarify the design a little here.

The I/O controls aren't part of any user space API.  They are supposed
(*) to be 104% internal and only used between the driver (VBoxGuest) and
the ring-3 library (VBoxGuestLib).  User land clients will call
functions in VBoxGuestLib and not care at all how that functions
internally, only that the jobs get done and that the right status code
gets returned for each call.

Regarding the idea that Michael proposed of having a last status
associated with the session: Doesn't work with multithreaded clients
like VBoxService.  Also, it's inefficient to have to go back to ring-0
again just to retrieve a status code, especially if the guest is running
in raw-mode.

Kind Regards,
 bird.


(*) There might still be one or two exceptions here, typically because
we didn't have a suitably configured VBoxGuestLib library version
available at the moment the developer needed it.  However, this also
need to be cleaned up eventually, if we haven't already.

On 2017-08-07 7:06 PM, Knut St. Osmundsen wrote:
> Hi Hans,
>
> sorry but I'm not convinced this is really useful and improving the code. We will fix this properly in a cross platform manner eventually, I hope.
>
> -bird
>
>> On 7 Aug 2017, at 16:46, Hans de Goede <hdegoede at redhat.com> wrote:
>>
>> Hi,
>>
>>> On 07-08-17 16:16, Michael Thayer wrote:
>>> Hello Hans and Knut,
>>> Would a new ioctl to query the last IPRT code for an open session be an
>>> option in case the caller does need the extra information?
>> Thank you for the suggestion, but IMHO that is worse (uglier) then returning
>> the vbox status error codes as positive values.
>>
>> Knut, I hope that my last 2 mails may have convinced you to re-consider
>> moving to standard errno returns only. But if I've failed to convince
>> you then please let me know, then I can drop these patches from my
>> ongoing work and just keep the positive return value is a vbox status code
>> thing for the upstream submission.
>>
>> Thanks & Regards,
>>
>> Hans
>>
>>
>>
>>> Regards
>>> Michael
>>> 06.08.2017 22:08, Knut St. Osmundsen wrote:
>>>> Hi Hans,
>>>>
>>>> I'm with you on this not being entirely optimal.  However 'man ioctl'
>>>> (http://man7.org/linux/man-pages/man2/ioctl.2.html) documents it as sane
>>>> behavior.  So why change working code?
>>>>
>>>> As I mentioned, the ideal fix would be to pass the VBox status code back
>>>> separately in the request buffer, making the fix cross platform rather
>>>> than linux specific.  But that's a lot of work.
>>>>
>>>> -bird--
>>> Michael Thayer | VirtualBox engineer
>>> ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt
>>> ORACLE Deutschland B.V. & Co. KG
>>> Hauptverwaltung: Riesstraße 25, D-80992 München
>>> Registergericht: Amtsgericht München, HRA 95603
>>> Komplementärin: ORACLE Deutschland Verwaltung B.V.
>>> Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
>>> der Handelskammer Midden-Nederland, Nr. 30143697
>>> Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
>>> _______________________________________________
>>> vbox-dev mailing list
>>> vbox-dev at virtualbox.org
>>> https://www.virtualbox.org/mailman/listinfo/vbox-dev
>> _______________________________________________
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
>> https://www.virtualbox.org/mailman/listinfo/vbox-dev
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev





More information about the vbox-dev mailing list