[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Thu, 27 Jul 2023 10:38:03 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fwE9A2LIVRsx1sJwOm8QTIoJsbgF1CFusqbdAye2whU=; b=Ao3dX1zYC6+xAmZw8NS+cI4A9WDLB/Hr7CyQ553TMEy1UYJQCNhR+hWYFYqe9MYvNbt/etWMe0OU7C4igvlJyZm3B5pWXn2BK0JoJM5F+WsM+ICWJq/Ez17lANR/GWtFAujeGnG0xJB4+BEl/IeYhEnORkTUpRh6LCiRWs0Yoxo+5ue7QJt4pysb4wXsIS6r/9aS65WZb1/g303jUI+oaGeFuYPYRNOoW0qpkmaZVVPtSACMzFQrfjBxqYaYNzeAps1dVboTWCwS7Hz0ZjFqOPVcH3FStPve6GMBMcVx618JrvtJF7K1IZ2W8TUFntbfj7vCdFGJ1vSnNv3zfVHCoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HTwqXwOz/seFC69WulJWy9viYNytZMIoni3gzkpGTiA0PhSIovpoeZIWX/2gvIfTau/olTE/T0yZJvFq1z2OjhBqxnn8ZyOY1q6mj4LeezCvnzTn1QdF87QALssaZM89MApwEOS3Hkcw/7+XATIFfpaMhRYXbw3XumiDl9SR+VSpHV9y76EGfsru4r+y8vFR7cb+TOWAe/HD4tomvFcgbjtdjn72NAU7b1tFZqeT64xEYLsErE6E9APKZ24FY+JysOiUYGHoOi5+GQD8rUhxF/8140VDToRTTt05dSKXoXiVkd+vJnNNZu2PpkEg4dsjyL4bPczBXaiZpsrNavHfZg==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Viresh Kumar <viresh.kumar@xxxxxxxxxx>
  • Delivery-date: Thu, 27 Jul 2023 10:38:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZv8uYlQiykVHkhkC1aQss9HQu9q/NX+QAgAANWwA=
  • Thread-topic: [PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array


On 27.07.23 12:50, Anthony PERARD wrote:

Hello Anthony

> On Wed, Jul 26, 2023 at 05:14:59PM +0300, Oleksandr Tyshchenko wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>>
>> Without it being present it won't be possible to use some
>> libxl__device_type's callbacks for virtio devices as the common code
>> can only invoke these callbacks (by dereferencing a pointer) for valid
>> libxl__device_type's elements when iterating over device_type_tbl[].
> 
> Did you notice an issue with it been missing from device_type_tbl[] ?
> Because to me it looks like all the functions that are using
> device_type_tbl will just skip over virtio devtype.
> 
> domcreate_attach_devices:
>      skip virtio because ".skip_attach = 1"
> 
> libxl__need_xenpv_qemu:
>      skip virtio because "dm_needed" is NULL
> 
> retrieve_domain_configuration_end:
>      skip because "compare" is "libxl_device_virtio_compare" which is NULL
> 
> libxl__update_domain_configuration:
>      skip because "update_config" is NULL.
> 
> So, I think the patch is fine, adding virtio to the device_type_tbl
> array is good for completeness, but the patch description may be
> misleading.
> 
> Did I miss something?

No, you didn't.

Just to be clear, there is no issue within *current* the code base, I am 
experimenting with using device-model bits, so I implemented 
libxl__device_virtio_dm_needed() locally and noticed that it didn't get 
called at all, the reason was in absence of libxl__virtio_devtype in the 
said array.

Do you agree with the following addition to the commit description?

"Please note, there is no issue within current the code base as virtio 
devices don't use callbacks that depend on libxl__virtio_devtype 
presence in device_type_tbl[]. The issue will appear as soon as we start
using these callbacks (for example, dm_needed)."




> 
> Thanks,
> 

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.