From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=W8uCkXen8cEocghCHY+nMnANq/AH1C6LA1zq0gTNa/UoEPJhnm0d0Pfin8ET21EUGRIV1AxDXjmz2DExRyNbI1m/meeXYH2Xi+fzlx3q2HRjlZ18IuQguyy4j5Ak2fiFg5ewJcJyqohqoNsfSmWEFGO13q66YSfb4S+jInwarOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5Dr5zUSc8CybxIYP08nPfkAu9MUEQByW6n99WVFF+4I=; b=jSymQfZon/2Z9fEjxZ2IXhZGpWbUkiPMyqzl52mQs6dGfc1lkHR/87ffLz9BHqT7F1037bJIDGOISHf5uXcHEVckP1aNVdNejpabf5M5ImWL3PMMv0AR/cEigyLo/kHuuofFH7RCayEsEBe6/ZCeFqUsNOqrmakZpD/qOee+a6U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15605115738581017.7168202074464; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKD-0007QN-89; Fri, 14 Jun 2019 11:24:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKB-0007Q8-TU for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:51 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0561f948-8e97-11e9-8864-4b151223ecb4; Fri, 14 Jun 2019 11:24:49 +0000 (UTC) X-Inumbo-ID: 0561f948-8e97-11e9-8864-4b151223ecb4 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 2VqaeuU4/Ekc5ZjEZBd9qZcZj4i2GQ25hHXftqJEVkGlqdnKU0r/F/Tugj6awM5KkW23Ht+g2Q c3dggZJRqKZ4FmpPBe+Mj9Gbbq4rSG24wVBLsIatFP3WQaUPMaBGJv+pxZlVlacij399aip8qG 1jDsLgks/E4D3Z+tgMnCIdE/KnMBPhNrTJIAY0GbOD2QEVTP4WBHAIglbUQssdrjbo9mNkkrwE enTTOICrfX88/ZMhLpYhlTRDcM+J1P/fbn+F1jPo07RpYNDfpni5cUhJDyZBOrts1ssxhgLKOJ 5gI= X-SBRS: 2.7 X-MesageID: 1737462 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737462" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:30 +0100 Message-ID: <20190614112444.29980-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 01/15] libxl: Rename struct libxl_device_type to libxl__device_type X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" libxl__device_type is internal to libxl, rename it to the internal only prefix. And eliminate redundant 'struct' keyword, in accord with the coding style. No functional changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_create.c | 4 +-- tools/libxl/libxl_device.c | 10 ++++---- tools/libxl/libxl_dm.c | 2 +- tools/libxl/libxl_domain.c | 2 +- tools/libxl/libxl_internal.c | 2 +- tools/libxl/libxl_internal.h | 49 ++++++++++++++++++------------------ 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 03ce166f4f..9f56851be2 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1522,7 +1522,7 @@ static void libxl__add_dtdevs(libxl__egc *egc, libxl_= _ao *ao, uint32_t domid, #define libxl__device_dtdev_update_devid NULL static DEFINE_DEVICE_TYPE_STRUCT(dtdev, NONE); =20 -const struct libxl_device_type *device_type_tbl[] =3D { +const libxl__device_type *device_type_tbl[] =3D { &libxl__disk_devtype, &libxl__nic_devtype, &libxl__vtpm_devtype, @@ -1575,7 +1575,7 @@ static void domcreate_attach_devices(libxl__egc *egc, STATE_AO_GC(dcs->ao); int domid =3D dcs->guest_domid; libxl_domain_config *const d_config =3D dcs->guest_config; - const struct libxl_device_type *dt; + const libxl__device_type *dt; =20 if (ret) { LOGD(ERROR, domid, "unable to add %s devices", diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index db6c0203b7..d385f19d85 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -1823,7 +1823,7 @@ int libxl_device_events_handler(libxl_ctx *ctx, } =20 void device_add_domain_config(libxl__gc *gc, libxl_domain_config *d_config, - const struct libxl_device_type *dt, const vo= id *dev) + const libxl__device_type *dt, const void *de= v) { int *num_dev; unsigned int i; @@ -1853,7 +1853,7 @@ void device_add_domain_config(libxl__gc *gc, libxl_do= main_config *d_config, } =20 void libxl__device_add_async(libxl__egc *egc, uint32_t domid, - const struct libxl_device_type *dt, void *typ= e, + const libxl__device_type *dt, void *type, libxl__ao_device *aodev) { STATE_AO_GC(aodev->ao); @@ -1968,7 +1968,7 @@ void libxl__device_add_async(libxl__egc *egc, uint32_= t domid, } =20 int libxl__device_add(libxl__gc *gc, uint32_t domid, - const struct libxl_device_type *dt, void *type) + const libxl__device_type *dt, void *type) { flexarray_t *back; flexarray_t *front, *ro_front; @@ -2017,7 +2017,7 @@ int libxl__device_add(libxl__gc *gc, uint32_t domid, return rc; } =20 -void *libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt, +void *libxl__device_list(libxl__gc *gc, const libxl__device_type *dt, uint32_t domid, int *num) { void *r =3D NULL; @@ -2068,7 +2068,7 @@ void *libxl__device_list(libxl__gc *gc, const struct = libxl_device_type *dt, return r; } =20 -void libxl__device_list_free(const struct libxl_device_type *dt, +void libxl__device_list_free(const libxl__device_type *dt, void *list, int num) { int i; diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index f4fc96415d..348c3fddf5 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -3168,7 +3168,7 @@ int libxl__need_xenpv_qemu(libxl__gc *gc, libxl_domai= n_config *d_config) { int idx, i, ret, num; uint32_t domid; - const struct libxl_device_type *dt; + const libxl__device_type *dt; =20 ret =3D libxl__get_domid(gc, &domid); if (ret) { diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c index 0ce1ba1327..aee621b0a5 100644 --- a/tools/libxl/libxl_domain.c +++ b/tools/libxl/libxl_domain.c @@ -1726,7 +1726,7 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ct= x, uint32_t domid, * retrieve from JSON. */ { - const struct libxl_device_type *dt; + const libxl__device_type *dt; int idx; =20 for (idx =3D 0;; idx++) { diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c index f492dae5ff..ce6eb7ab16 100644 --- a/tools/libxl/libxl_internal.c +++ b/tools/libxl/libxl_internal.c @@ -552,7 +552,7 @@ void libxl__update_domain_configuration(libxl__gc *gc, const libxl_domain_config *src) { int i, idx, num; - const struct libxl_device_type *dt; + const libxl__device_type *dt; =20 for (idx =3D 0;; idx++) { dt =3D device_type_tbl[idx]; diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 3be5c644c1..a25bacd7aa 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -192,6 +192,7 @@ typedef struct libxl__ao libxl__ao; typedef struct libxl__aop_occurred libxl__aop_occurred; typedef struct libxl__osevent_hook_nexus libxl__osevent_hook_nexus; typedef struct libxl__osevent_hook_nexi libxl__osevent_hook_nexi; +typedef struct libxl__device_type libxl__device_type; typedef struct libxl__json_object libxl__json_object; typedef struct libxl__carefd libxl__carefd; =20 @@ -3713,7 +3714,7 @@ typedef int (*device_set_xenstore_config_fn_t)(libxl_= _gc *, uint32_t, void *, flexarray_t *, flexarray_t = *, flexarray_t *); =20 -struct libxl_device_type { +struct libxl__device_type { libxl__device_kind type; int skip_attach; /* Skip entry in domcreate_attach_devices() if 1 */ int ptr_offset; /* Offset of device array ptr in libxl_domain_confi= g */ @@ -3735,7 +3736,7 @@ struct libxl_device_type { }; =20 #define DEFINE_DEVICE_TYPE_STRUCT_X(name, sname, kind, ...) = \ - const struct libxl_device_type libxl__ ## name ## _devtype =3D { = \ + const libxl__device_type libxl__ ## name ## _devtype =3D { = \ .type =3D LIBXL__DEVICE_KIND_ ## kind, = \ .ptr_offset =3D offsetof(libxl_domain_config, name ## s), = \ .num_offset =3D offsetof(libxl_domain_config, num_ ## name ## s= ), \ @@ -3759,38 +3760,38 @@ struct libxl_device_type { DEFINE_DEVICE_TYPE_STRUCT_X(name, name, kind, __VA_ARGS__) =20 static inline void **libxl__device_type_get_ptr( - const struct libxl_device_type *dt, const libxl_domain_config *d_confi= g) + const libxl__device_type *dt, const libxl_domain_config *d_config) { return (void **)((void *)d_config + dt->ptr_offset); } =20 static inline void *libxl__device_type_get_elem( - const struct libxl_device_type *dt, const libxl_domain_config *d_confi= g, + const libxl__device_type *dt, const libxl_domain_config *d_config, int e) { return *libxl__device_type_get_ptr(dt, d_config) + dt->dev_elem_size *= e; } =20 static inline int *libxl__device_type_get_num( - const struct libxl_device_type *dt, const libxl_domain_config *d_confi= g) + const libxl__device_type *dt, const libxl_domain_config *d_config) { return (int *)((void *)d_config + dt->num_offset); } =20 -extern const struct libxl_device_type libxl__vfb_devtype; -extern const struct libxl_device_type libxl__vkb_devtype; -extern const struct libxl_device_type libxl__disk_devtype; -extern const struct libxl_device_type libxl__nic_devtype; -extern const struct libxl_device_type libxl__vtpm_devtype; -extern const struct libxl_device_type libxl__usbctrl_devtype; -extern const struct libxl_device_type libxl__usbdev_devtype; -extern const struct libxl_device_type libxl__pcidev_devtype; -extern const struct libxl_device_type libxl__vdispl_devtype; -extern const struct libxl_device_type libxl__p9_devtype; -extern const struct libxl_device_type libxl__pvcallsif_devtype; -extern const struct libxl_device_type libxl__vsnd_devtype; - -extern const struct libxl_device_type *device_type_tbl[]; +extern const libxl__device_type libxl__vfb_devtype; +extern const libxl__device_type libxl__vkb_devtype; +extern const libxl__device_type libxl__disk_devtype; +extern const libxl__device_type libxl__nic_devtype; +extern const libxl__device_type libxl__vtpm_devtype; +extern const libxl__device_type libxl__usbctrl_devtype; +extern const libxl__device_type libxl__usbdev_devtype; +extern const libxl__device_type libxl__pcidev_devtype; +extern const libxl__device_type libxl__vdispl_devtype; +extern const libxl__device_type libxl__p9_devtype; +extern const libxl__device_type libxl__pvcallsif_devtype; +extern const libxl__device_type libxl__vsnd_devtype; + +extern const libxl__device_type *device_type_tbl[]; =20 /*----- Domain destruction -----*/ =20 @@ -4568,21 +4569,21 @@ static inline bool libxl__acpi_defbool_val(const li= bxl_domain_build_info *b_info * (a copy of `dev' will be made) */ void device_add_domain_config(libxl__gc *gc, libxl_domain_config *d_config, - const struct libxl_device_type *dt, + const libxl__device_type *dt, const void *dev); =20 void libxl__device_add_async(libxl__egc *egc, uint32_t domid, - const struct libxl_device_type *dt, void *typ= e, + const libxl__device_type *dt, void *type, libxl__ao_device *aodev); int libxl__device_add(libxl__gc *gc, uint32_t domid, - const struct libxl_device_type *dt, void *type); + const libxl__device_type *dt, void *type); =20 /* Caller is responsible for freeing the memory by calling * libxl__device_list_free */ -void* libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt, +void* libxl__device_list(libxl__gc *gc, const libxl__device_type *dt, uint32_t domid, int *num); -void libxl__device_list_free(const struct libxl_device_type *dt, +void libxl__device_list_free(const libxl__device_type *dt, void *list, int num); =20 static inline bool libxl__timer_mode_is_default(libxl_timer_mode *tm) --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=BS1ABH1QKPwMVl2xIbolyw9gCM0jefhViCn0ft+F8F2wN+uBm4P1RjXWlOVQxLtrrwyCiClDW/VZVXD7d7eZpHPrA/ueRJAI78uM43JoJB9YpfFoJjB/7gXHgL15eWiDhIVCGSH9++C6SClwxfIz31dSIJwmW9mSEj8btdEo0tw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nAz5ZDkT5JIzjiPx9J/eyOPTLmMCW6D+XxhDMpiJVec=; b=jsLFKBQ6+dhmFhyHWUhzT+LJQ7/lDH+tQfEKuqwh70h4aSqmA3lOMI9GvYMjfO+AOtFsIgFQjE8RWvIZ+ItTgDH/luXZZMDzUFwbQwoi6YoLCk3msDfYip2bE46q/11zcxhA/Lyh3Opbb8zzV4iKYOyxhO3SPFH4TbNaKdIEsqw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 156051157332727.121927880842236; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKD-0007QT-Hj; Fri, 14 Jun 2019 11:24:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKC-0007QA-2p for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:52 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 04842d70-8e97-11e9-b1fe-37d331339edf; Fri, 14 Jun 2019 11:24:48 +0000 (UTC) X-Inumbo-ID: 04842d70-8e97-11e9-b1fe-37d331339edf Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: /KsnXc/7nM74rGBfYlgkBO5FOjSlu2K4d4lo5tPjK0TjceeXgNZtIzX+RgUdbwBtlk+9Rr4/E7 5sLqiIWG/b+Wn6hbTRm8t/HAThHFu4ZD3Wl2v1mq/E/vQPtWsSQSyW3bqTBl4mEfBEEhHy2lHj JW0xZ7kIql6rIh4VtcPF4kk9SYqrGqKsPbD2p2keNGa6XHV6fYE8DtdRrTyG3516uoeduAZkkP 0RAIGNKg55AHFRgnp58W8BvZD7Obm7SmLyxzNuO5FRETDLdYrtQ4qoll5sLQtCAcWk4qf/9JYc mHk= X-SBRS: 2.7 X-MesageID: 1737461 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737461" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:31 +0100 Message-ID: <20190614112444.29980-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 02/15] libxl: Remove unused variable in libxl__device_pci_add_xenstore X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" *device isn't used. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_pci.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 4ec6872798..67677d7b55 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -115,7 +115,6 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc= , uint32_t domid, libxl_d char *num_devs, *be_path; int num =3D 0; xs_transaction_t t =3D XBT_NULL; - libxl__device *device; int rc; libxl_domain_config d_config; libxl_device_pci pcidev_saved; @@ -149,9 +148,6 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc= , uint32_t domid, libxl_d if (!starting) flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateRe= configuring)); =20 - GCNEW(device); - libxl__device_from_pcidev(gc, domid, pcidev, device); - lock =3D libxl__lock_domain_userdata(gc, domid); if (!lock) { rc =3D ERROR_LOCK_FAIL; --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511581; cv=none; d=zoho.com; s=zohoarc; b=joIhHq694xSLAOSCT039vH/dsrli1CoEz3k2UFhgJzxHchfbCImh3utbPPtDZikGRy32KC/a+VthvmwvqQV7NMNS2UL+v8FcZ00nGdsdNVxCffLQ1t0eNK4TXEzINmpUogxlGCXIL77rjqNwXWk4hqZ5ZBqndu9ZAl2m/xqjrU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511581; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=FCjLxVRcHtvSpAVVtfk1TYd31SLNR7HIOYGGCpHFFhg=; b=Zjc46mG2aoj0O5HzmPJX36vgOFAUYEShjSG7eWesenwBHV9Zy9Ezd9XUTxWE14QUAZ9xB2jqMdHt1n0kQ3lDQDKCbuJSQWXJSIHF5Nbq0jAqZF9zHEN+hypN1Ujp7f3UhUYJsKEtKUX5PjAPAdIf1BtqIZ2t+goidqzAi4lTSVM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511581124243.67925859129662; Fri, 14 Jun 2019 04:26:21 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKG-0007RH-I2; Fri, 14 Jun 2019 11:24:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKE-0007Qt-HT for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:54 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 06c96f32-8e97-11e9-ae50-7b47ac2747f6; Fri, 14 Jun 2019 11:24:51 +0000 (UTC) X-Inumbo-ID: 06c96f32-8e97-11e9-ae50-7b47ac2747f6 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: GdyRQy5Cw6PNBe1MQRQOGxUvk1yu8teMECm/mqv3/nbPkV1L4Rg+Us2wvCWy/i0su6Vh2Ydlik xgw2/9RsOnVtbVvdrJ5D+ylJKXIssR24gkSvp1Z8yjceLEjgYzar135IvIx6/pMgEx3m7kvyMJ J+JMYgukn4eLVeQ13lB2WHbNRJsjtUhHm0lcKVUtPa9mk9S12jVTbYFEhFwm3m6GE3Hg6n19qO Vrvel0+7WCeDR4ciAKX/cz9mFKF8hX5rFGjMqNdJjc23hUjIPBMS/k6WiCideMziA+WQ7bGLTH yzQ= X-SBRS: 2.7 X-MesageID: 1737463 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737463" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:32 +0100 Message-ID: <20190614112444.29980-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 03/15] libxl_pci: Make libxl__create_pci_backend static X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" libxl__create_pci_backend isn't called from outside of libxl_pci anymore, and it's only useful as part of the pci_add process, so remove the prototype from libxl_internal.h. No functional changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_internal.h | 2 -- tools/libxl/libxl_pci.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index a25bacd7aa..01411382fd 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1541,8 +1541,6 @@ _hidden int libxl__pci_topology_init(libxl__gc *gc, /* from libxl_pci */ =20 _hidden int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_dev= ice_pci *pcidev, int starting); -_hidden int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, - libxl_device_pci *pcidev, int num); _hidden int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid); _hidden bool libxl__is_igd_vga_passthru(libxl__gc *gc, const libxl_domain_config *d_confi= g); diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 67677d7b55..0e07f70f29 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -75,8 +75,8 @@ static void libxl__device_from_pcidev(libxl__gc *gc, uint= 32_t domid, device->kind =3D LIBXL__DEVICE_KIND_PCI; } =20 -int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, - libxl_device_pci *pcidev, int num) +static int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, + libxl_device_pci *pcidev, int num) { flexarray_t *front =3D NULL; flexarray_t *back =3D NULL; --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=goJR9DuYQspWG0HNzOVzdnGJPglnHeBWKDzqr6lttZC6zNZZQ7CDpR6dOsnCOxg9qQ4+1eHWCz0rA9F7FV8RBYNG8SB9eOsfIsObsjf2tZhvVgSO102aKZhYubY1lC3VrHIrZ6DSpiIsKBBfBSa7EgLucf7iLGuUG7xAO1l98lQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JXeMhUtFxxIpbLeaQ7kcieTB8k6oY2DchpIrMXiqKXo=; b=ieMWIP4m59CSNkIfq4ozI4uOX71Q4K2HOYBLaJJeX/1298J8+JVlg8GC8OcABZdnH+7K2D98gxxNpADBQIrCWf0IFLWuAQtUORcMVKeFYHzxcy6LveWUF2XHdwwm+ldfAPL+cCYsOltGpFqE00uj6HjUEo5myUzYSaTHHnfDMoM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511573393160.8537054086853; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKG-0007RN-Si; Fri, 14 Jun 2019 11:24:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKE-0007R4-P0 for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:54 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 06efa044-8e97-11e9-bf5f-0f5740848fb4; Fri, 14 Jun 2019 11:24:52 +0000 (UTC) X-Inumbo-ID: 06efa044-8e97-11e9-bf5f-0f5740848fb4 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: poLzMvH6Fod03BxScQ2jqc6QRto9O/UkuNyeY3nSy9U20CdFHW22Q6WNxhnMIlyoo3jy5GQlMO GOuFDN+TUQZ4enZHSt2UUC97zKTbVdyGi+MDz+3GOdnnaEsn6Ndd+6XBZ50RYTVTqKB85vCZ9W hRqIBAVAmaciBRiqD8TRrocgrJA+ZcJuf21MbYKDwKCckIj7pZzpk6BiBYfqmMSrtns+/KhrgT aFIzejhcUSfFAjUXXt1yQdSarwHoO+orB6CuoLWw8BA6BWUOVNo7lTSKu3DDf6tFeO8akRqBqF TCU= X-SBRS: 2.7 X-MesageID: 1737464 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737464" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:33 +0100 Message-ID: <20190614112444.29980-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 04/15] libxl_pci: Constify arg `pcidev' of libxl__device_pci_add_xenstore X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" libxl__device_pci_add_xenstore doesn't modify `pcidev', so it can be constified. Also, we don't need pcidev_saved anymore, so remove the saved copy. (device_add_domain_config is going to make it's own copy anyway.) To achieve this, constify pcidev in all functions that libxl__device_pci_add_xenstore calls. No functional changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_pci.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 0e07f70f29..d2d37be75d 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -47,7 +47,10 @@ static void pcidev_struct_fill(libxl_device_pci *pcidev,= unsigned int domain, pcidev->vdevfn =3D vdevfn; } =20 -static void libxl_create_pci_backend_device(libxl__gc *gc, flexarray_t *ba= ck, int num, libxl_device_pci *pcidev) +static void libxl_create_pci_backend_device(libxl__gc *gc, + flexarray_t *back, + int num, + const libxl_device_pci *pcidev) { flexarray_append(back, GCSPRINTF("key-%d", num)); flexarray_append(back, GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus,= pcidev->dev, pcidev->func)); @@ -64,7 +67,7 @@ static void libxl_create_pci_backend_device(libxl__gc *gc= , flexarray_t *back, in } =20 static void libxl__device_from_pcidev(libxl__gc *gc, uint32_t domid, - libxl_device_pci *pcidev, + const libxl_device_pci *pcidev, libxl__device *device) { device->backend_devid =3D 0; @@ -76,7 +79,8 @@ static void libxl__device_from_pcidev(libxl__gc *gc, uint= 32_t domid, } =20 static int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, - libxl_device_pci *pcidev, int num) + const libxl_device_pci *pcidev, + int num) { flexarray_t *front =3D NULL; flexarray_t *back =3D NULL; @@ -109,7 +113,10 @@ static int libxl__create_pci_backend(libxl__gc *gc, ui= nt32_t domid, NULL); } =20 -static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, l= ibxl_device_pci *pcidev, int starting) +static int libxl__device_pci_add_xenstore(libxl__gc *gc, + uint32_t domid, + const libxl_device_pci *pcidev, + int starting) { flexarray_t *back; char *num_devs, *be_path; @@ -117,12 +124,9 @@ static int libxl__device_pci_add_xenstore(libxl__gc *g= c, uint32_t domid, libxl_d xs_transaction_t t =3D XBT_NULL; int rc; libxl_domain_config d_config; - libxl_device_pci pcidev_saved; libxl__domain_userdata_lock *lock =3D NULL; =20 libxl_domain_config_init(&d_config); - libxl_device_pci_init(&pcidev_saved); - libxl_device_pci_copy(CTX, &pcidev_saved, pcidev); =20 be_path =3D libxl__domain_device_backend_path(gc, 0, domid, 0, LIBXL__DEVICE_KIND_PCI); @@ -158,7 +162,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc= , uint32_t domid, libxl_d if (rc) goto out; =20 device_add_domain_config(gc, &d_config, &libxl__pcidev_devtype, - &pcidev_saved); + pcidev); =20 rc =3D libxl__dm_check_start(gc, &d_config, domid); if (rc) goto out; @@ -180,7 +184,6 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc= , uint32_t domid, libxl_d out: libxl__xs_transaction_abort(gc, &t); if (lock) libxl__unlock_domain_userdata(lock); - libxl_device_pci_dispose(&pcidev_saved); libxl_domain_config_dispose(&d_config); return rc; } --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=ObqFKpNOKrcPPjv2LuaMNy2rlzhHJXiCQpWcJ/lmR6hmEZ/oGJhYdWKovnaDn/FucuZTZ3QzRMx6zhgTuYkpJxtr3k3JRW79unlv5psGLLi/Zeel1kaAMNuAuOhzwrSzIRb9BvZrG32Q+sGcll3Ggx4NwrRgy6C7LFvQEiLDU54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=UP6ASRxiwNPPBKmyI4K6IBEHuU15e0rfg/zNmolc3to=; b=UWmBn4HWoQllc4MEJQnkUIyRu1ep5Opiafkj9a+cHjcpPMeglYIfSqhgjDVctXi+hqsQLnHITXPUEag+9tH5rqkk9rtSiqh8J0+wgNthmsQwTud6c+50TxiusHhtoDhXrBp6JTMul5S/9ZBiSU1FNb8mGUIPh4DgK9U4829UoJQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511573342371.5130772440883; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKG-0007R9-8o; Fri, 14 Jun 2019 11:24:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKE-0007Qu-Hc for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:54 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 07137794-8e97-11e9-9525-b3ca68e02144; Fri, 14 Jun 2019 11:24:52 +0000 (UTC) X-Inumbo-ID: 07137794-8e97-11e9-9525-b3ca68e02144 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: XV6IkCd2Yu3yQY891cXZmwjY2QZ7ckJPuBvkdhG6xmtOo6cZ9fwf2ez6E+98XUnEf88pG2/kTM Qu47Tfj6jD2LU/c+HPGG8PGhYIByLlKIJgnA/POn6rZv/407u9LTbh6ZDUqlUjpMmGaquyMjT8 80Iyt23CB9lL6aK/V0rZA3fuEz6cPfLkCowttdcr+feJOvkQB4GxtHoJKQ1UlrNvcCFNGc3iZf rmxb1gfnttuqdvGhgnpiEIqddAQW3xHtAgiV8EMvERJsZ/siNacEwqnjuw4c7zn/6Fzg+EONMb G7Y= X-SBRS: 2.7 X-MesageID: 1737465 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737465" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:34 +0100 Message-ID: <20190614112444.29980-6-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 05/15] libxl_pci: `starting' is a bool X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The argument `starting' is used as a boolean, change its type to reflex that throughout libxl_pci.c. No functional changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_internal.h | 3 ++- tools/libxl/libxl_pci.c | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 01411382fd..846227c3cd 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1540,7 +1540,8 @@ _hidden int libxl__pci_topology_init(libxl__gc *gc, =20 /* from libxl_pci */ =20 -_hidden int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_dev= ice_pci *pcidev, int starting); +_hidden int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, + libxl_device_pci *pcidev, bool starting); _hidden int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid); _hidden bool libxl__is_igd_vga_passthru(libxl__gc *gc, const libxl_domain_config *d_confi= g); diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index d2d37be75d..f204ac9fb7 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -116,7 +116,7 @@ static int libxl__create_pci_backend(libxl__gc *gc, uin= t32_t domid, static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, const libxl_device_pci *pcidev, - int starting) + bool starting) { flexarray_t *back; char *num_devs, *be_path; @@ -983,7 +983,8 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_= t domid, return rc; } =20 -static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pci= dev, int starting) +static int do_pci_add(libxl__gc *gc, uint32_t domid, + libxl_device_pci *pcidev, bool starting) { libxl_ctx *ctx =3D libxl__gc_owner(gc); libxl_domain_type type =3D libxl__domain_type(gc, domid); @@ -1164,7 +1165,7 @@ int libxl_device_pci_add(libxl_ctx *ctx, uint32_t dom= id, { AO_CREATE(ctx, domid, ao_how); int rc; - rc =3D libxl__device_pci_add(gc, domid, pcidev, 0); + rc =3D libxl__device_pci_add(gc, domid, pcidev, false); libxl__ao_complete(egc, ao, rc); return AO_INPROGRESS; } @@ -1186,7 +1187,8 @@ static int libxl_pcidev_assignable(libxl_ctx *ctx, li= bxl_device_pci *pcidev) return i !=3D num; } =20 -int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci = *pcidev, int starting) +int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, + libxl_device_pci *pcidev, bool starting) { libxl_ctx *ctx =3D libxl__gc_owner(gc); unsigned int orig_vdev, pfunc_mask; @@ -1241,7 +1243,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t dom= id, libxl_device_pci *pcide if (stubdomid !=3D 0) { libxl_device_pci pcidev_s =3D *pcidev; /* stubdomain is always running by now, even at create time */ - rc =3D do_pci_add(gc, stubdomid, &pcidev_s, 0); + rc =3D do_pci_add(gc, stubdomid, &pcidev_s, false); if ( rc ) goto out; } @@ -1294,7 +1296,7 @@ static void libxl__add_pcidevs(libxl__egc *egc, libxl= __ao *ao, uint32_t domid, int i, rc =3D 0; =20 for (i =3D 0; i < d_config->num_pcidevs; i++) { - rc =3D libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1); + rc =3D libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], tru= e); if (rc < 0) { LOGD(ERROR, domid, "libxl_device_pci_add failed: %d", rc); goto out; --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=iMOQ+lYnXWEdXTl3K1DusR/hjWav+ApzHrTP4kAfS2NiErPnnsH93VviUAJQ6f3yn0Eb7TxuHps77WMO/pIr+LQ8oT8s91VjksiDUDTQuEwR7y40WanEVfq9evOwzMeYNt54hb2JqrpAmF90ioJNY5V5KmjHGb4VgTDvj5WowTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ZmS0uADx6Jtqy+exz3TrN/70uqk+m36SGHUqP2UNsWQ=; b=gLHloYn+EMs0JK7QeRnMtgh2v7V8xAGGo+MHR7saxCr/hg7sH0hFsk5GMyE1gJglMv/nfJSlFkkFVvaobU/WlLWqOcotCebZ26ayZGJsuDqxH+TKN/JJg7fTjRtP5RTeXhqojXNKW8PJVBijYlP4wLYC16Uqvwo1RJMHgQ+BiCg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511573377486.40839504258406; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKJ-0007SF-8C; Fri, 14 Jun 2019 11:24:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKI-0007Rt-1o for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:58 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 086f0a68-8e97-11e9-ba81-ef5fc2f7992d; Fri, 14 Jun 2019 11:24:54 +0000 (UTC) X-Inumbo-ID: 086f0a68-8e97-11e9-ba81-ef5fc2f7992d Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 3K2GOz8QXejbGs5VYriScINrlE4tZzII3iJj3LOX/Thwd6nS+ZBWlUvyN8B2BVc2wxFQxIulQi y0hNsTa11pGxmz7CQWbV6O3p04q08YNKPEUMvvnqxpU0R5IYBgQUmpcNPvUvuqbnhUPHDbtKa8 uDDYKF2ymV26+S8/0yy/H96xOegVHZtNwppKLVwkZ7BUoVh6S+zA4q1vkqS5ry6um7saqoSSde f2hk040X1PYnONmAwfxPZLRZNjRQ3PALxiBgF8uBIJwshKCXCdGE/djJznZ/SnwnLndD/h1SBt Hmg= X-SBRS: 2.7 X-MesageID: 1737469 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737469" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:35 +0100 Message-ID: <20190614112444.29980-7-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 06/15] libxl_dom_save: Reorder functions for switch_qemu_logdirty X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There are two differents set of callbacks here, one for libxl__domain_common_switch_qemu_logdirty, and one for libxl__domain_suspend_common_switch_qemu_logdirty. The first set calls the second. Pure code motion. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- Notes: The check for PVH seems to be in the wrong function: It's in libxl__domain_suspend_common_switch_qemu_logdirty(), but it should probably be in: libxl__domain_common_switch_qemu_logdirty(). That second function is used by the remus/COLO stuff, but the first is only a callback of libxl__domain_save(). tools/libxl/libxl_dom_save.c | 168 +++++++++++++++++++---------------- 1 file changed, 89 insertions(+), 79 deletions(-) diff --git a/tools/libxl/libxl_dom_save.c b/tools/libxl/libxl_dom_save.c index 2e9ec4dbf2..13d08d6dae 100644 --- a/tools/libxl/libxl_dom_save.c +++ b/tools/libxl/libxl_dom_save.c @@ -36,11 +36,17 @@ static void domain_save_done(libxl__egc *egc, * xenstore_process_logdirty_event */ =20 +static void domain_suspend_switch_qemu_xen_traditional_logdirty + (libxl__egc *egc, int domid, unsigned enabl= e, + libxl__logdirty_switch *lds); +static void switch_logdirty_xswatch(libxl__egc *egc, libxl__ev_xswatch*, + const char *watch_path, const char *event_path= ); +static void domain_suspend_switch_qemu_xen_logdirty + (libxl__egc *egc, int domid, unsigned enabl= e, + libxl__logdirty_switch *lds); static void switch_logdirty_timeout(libxl__egc *egc, libxl__ev_time *ev, const struct timeval *requested_abs, int rc); -static void switch_logdirty_xswatch(libxl__egc *egc, libxl__ev_xswatch*, - const char *watch_path, const char *event_path= ); static void switch_logdirty_done(libxl__egc *egc, libxl__logdirty_switch *lds, int rc); =20 @@ -51,6 +57,27 @@ void libxl__logdirty_init(libxl__logdirty_switch *lds) libxl__ev_time_init(&lds->timeout); } =20 +void libxl__domain_common_switch_qemu_logdirty(libxl__egc *egc, + int domid, unsigned enable, + libxl__logdirty_switch *lds) +{ + STATE_AO_GC(lds->ao); + + switch (libxl__device_model_version_running(gc, domid)) { + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: + domain_suspend_switch_qemu_xen_traditional_logdirty(egc, domid, en= able, + lds); + break; + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: + domain_suspend_switch_qemu_xen_logdirty(egc, domid, enable, lds); + break; + default: + LOGD(ERROR, domid, "logdirty switch failed" + ", no valid device model version found, abandoning suspend"); + lds->callback(egc, lds, ERROR_FAIL); + } +} + static void domain_suspend_switch_qemu_xen_traditional_logdirty (libxl__egc *egc, int domid, unsigned enabl= e, libxl__logdirty_switch *lds) @@ -120,83 +147,6 @@ static void domain_suspend_switch_qemu_xen_traditional= _logdirty switch_logdirty_done(egc,lds,rc); } =20 -static void domain_suspend_switch_qemu_xen_logdirty - (libxl__egc *egc, int domid, unsigned enabl= e, - libxl__logdirty_switch *lds) -{ - STATE_AO_GC(lds->ao); - int rc; - - rc =3D libxl__qmp_set_global_dirty_log(gc, domid, enable); - if (rc) - LOGD(ERROR, domid, - "logdirty switch failed (rc=3D%d), abandoning suspend",rc); - - lds->callback(egc, lds, rc); -} - -static void domain_suspend_switch_qemu_logdirty_done - (libxl__egc *egc, libxl__logdirty_switch *lds, int= rc) -{ - libxl__domain_save_state *dss =3D CONTAINER_OF(lds, *dss, logdirty); - - if (rc) { - dss->rc =3D rc; - libxl__xc_domain_saverestore_async_callback_done(egc, - &dss->sws.shs, -1= ); - } else - libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.sh= s, 0); -} - -void libxl__domain_suspend_common_switch_qemu_logdirty - (uint32_t domid, unsigned enable, void *use= r) -{ - libxl__save_helper_state *shs =3D user; - libxl__egc *egc =3D shs->egc; - libxl__domain_save_state *dss =3D shs->caller_state; - - /* Convenience aliases. */ - libxl__logdirty_switch *const lds =3D &dss->logdirty; - - if (dss->type =3D=3D LIBXL_DOMAIN_TYPE_PVH) { - domain_suspend_switch_qemu_logdirty_done(egc, lds, 0); - return; - } - - lds->callback =3D domain_suspend_switch_qemu_logdirty_done; - libxl__domain_common_switch_qemu_logdirty(egc, domid, enable, lds); -} - -void libxl__domain_common_switch_qemu_logdirty(libxl__egc *egc, - int domid, unsigned enable, - libxl__logdirty_switch *lds) -{ - STATE_AO_GC(lds->ao); - - switch (libxl__device_model_version_running(gc, domid)) { - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: - domain_suspend_switch_qemu_xen_traditional_logdirty(egc, domid, en= able, - lds); - break; - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: - domain_suspend_switch_qemu_xen_logdirty(egc, domid, enable, lds); - break; - default: - LOGD(ERROR, domid, "logdirty switch failed" - ", no valid device model version found, abandoning suspend"); - lds->callback(egc, lds, ERROR_FAIL); - } -} -static void switch_logdirty_timeout(libxl__egc *egc, libxl__ev_time *ev, - const struct timeval *requested_abs, - int rc) -{ - libxl__logdirty_switch *lds =3D CONTAINER_OF(ev, *lds, timeout); - STATE_AO_GC(lds->ao); - LOG(ERROR,"logdirty switch: wait for device model timed out"); - switch_logdirty_done(egc,lds,ERROR_FAIL); -} - static void switch_logdirty_xswatch(libxl__egc *egc, libxl__ev_xswatch *wa= tch, const char *watch_path, const char *event_path) { @@ -251,6 +201,31 @@ static void switch_logdirty_xswatch(libxl__egc *egc, l= ibxl__ev_xswatch *watch, } } =20 +static void domain_suspend_switch_qemu_xen_logdirty + (libxl__egc *egc, int domid, unsigned enabl= e, + libxl__logdirty_switch *lds) +{ + STATE_AO_GC(lds->ao); + int rc; + + rc =3D libxl__qmp_set_global_dirty_log(gc, domid, enable); + if (rc) + LOGD(ERROR, domid, + "logdirty switch failed (rc=3D%d), abandoning suspend",rc); + + lds->callback(egc, lds, rc); +} + +static void switch_logdirty_timeout(libxl__egc *egc, libxl__ev_time *ev, + const struct timeval *requested_abs, + int rc) +{ + libxl__logdirty_switch *lds =3D CONTAINER_OF(ev, *lds, timeout); + STATE_AO_GC(lds->ao); + LOG(ERROR,"logdirty switch: wait for device model timed out"); + switch_logdirty_done(egc,lds,ERROR_FAIL); +} + static void switch_logdirty_done(libxl__egc *egc, libxl__logdirty_switch *lds, int rc) @@ -263,6 +238,41 @@ static void switch_logdirty_done(libxl__egc *egc, lds->callback(egc, lds, rc); } =20 +static void domain_suspend_switch_qemu_logdirty_done + (libxl__egc *egc, libxl__logdirty_switch *lds, int= rc); + +void libxl__domain_suspend_common_switch_qemu_logdirty + (uint32_t domid, unsigned enable, void *use= r) +{ + libxl__save_helper_state *shs =3D user; + libxl__egc *egc =3D shs->egc; + libxl__domain_save_state *dss =3D shs->caller_state; + + /* Convenience aliases. */ + libxl__logdirty_switch *const lds =3D &dss->logdirty; + + if (dss->type =3D=3D LIBXL_DOMAIN_TYPE_PVH) { + domain_suspend_switch_qemu_logdirty_done(egc, lds, 0); + return; + } + + lds->callback =3D domain_suspend_switch_qemu_logdirty_done; + libxl__domain_common_switch_qemu_logdirty(egc, domid, enable, lds); +} + +static void domain_suspend_switch_qemu_logdirty_done + (libxl__egc *egc, libxl__logdirty_switch *lds, int= rc) +{ + libxl__domain_save_state *dss =3D CONTAINER_OF(lds, *dss, logdirty); + + if (rc) { + dss->rc =3D rc; + libxl__xc_domain_saverestore_async_callback_done(egc, + &dss->sws.shs, -1= ); + } else + libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.sh= s, 0); +} + /*----- callbacks, called by xc_domain_save -----*/ =20 /* --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=BTYjF20TFX+CUN9qAjno/8YWS72dCmZXvmjz9bQzB4o98BaCenQ6GplS1WCVSHlGe+honDTmxjeKrpm1QGe/DCTO3y6mU0gHRYSUcep+z34vC8CtnqmhUkcoAaE568aqVJLNTleMk9Ni2wfIBhdBglJjjwHYt8tjbnYZMIRRxbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=cZ9secuNHgAT8ov6P9yvu24mXr3zBb5vAErBSK3cQd0=; b=MhoPDryudy7uhxdRxkBGtxI69rXT544G5QEVTbIB0iyvJSD1VssQJRQlJCB+UBvoFV2PQNPhwwpBiI2ZsXHtxw6un69cMRUTIhUNZ/K2bpDZUu9RX4wEQ+dCTp/+HXlr6FPdzsbVTQ/sChQedVaXnrdQh//muHnJBCs3MWx8htY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511573374390.49756237450447; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKJ-0007SN-Jw; Fri, 14 Jun 2019 11:24:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKI-0007Rs-1o for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:58 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 083ddd76-8e97-11e9-bcb6-c71690691944; Fri, 14 Jun 2019 11:24:54 +0000 (UTC) X-Inumbo-ID: 083ddd76-8e97-11e9-bcb6-c71690691944 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: cIw7zh1P+Og1z/F7b764TOe+7i8Ycs8T3/dXt2wEgffCYNauiWg8ruWNyB8WGa9ktH08WbPC0V J7Bl3IBg8W5XRZ7PLQXGeiDd47n6tKEOJgDj4090fvg7sesqJnNg731ftfXr7k+uLyPsNRRdNA 0g0t0UtTwzntmjCgufhsvOqsx58emsS2PdBtyv8heQwVUIS0aqfOciCbA36nlVhRfgkcmXhJG9 Iki9eEFErKPwaB485piGY04YHfGj08W+vjWAOa/38rwSreUcgsPdvmqQOYnpKHJ0QDIHjQdB0Z pdM= X-SBRS: 2.7 X-MesageID: 1737468 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737468" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:36 +0100 Message-ID: <20190614112444.29980-8-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 07/15] libxl_dm: Fix initialisation of libxl__stub_dm_spawn_state X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" sdss->pvqemu wasn't initialiased and disposed of properly. Also, move the initialisation of sdss->xswait with the rest of the initialisation of sdss. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_dm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 348c3fddf5..5942e70c16 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -2105,8 +2105,11 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__st= ub_dm_spawn_state *sdss) libxl__domain_build_state *const d_state =3D sdss->dm.build_state; libxl__domain_build_state *const stubdom_state =3D &sdss->dm_state; =20 + /* Initialise private part of sdss */ libxl__domain_build_state_init(stubdom_state); dmss_init(&sdss->dm); + dmss_init(&sdss->pvqemu); + libxl__xswait_init(&sdss->xswait); =20 if (guest_config->b_info.device_model_version !=3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) { @@ -2391,8 +2394,6 @@ static void stubdom_pvqemu_cb(libxl__egc *egc, STATE_AO_GC(sdss->dm.spawn.ao); uint32_t dm_domid =3D sdss->pvqemu.guest_domid; =20 - libxl__xswait_init(&sdss->xswait); - if (rc) { LOGED(ERROR, sdss->dm.guest_domid, "error connecting nics devices"); @@ -2439,6 +2440,7 @@ static void stubdom_xswait_cb(libxl__egc *egc, libxl_= _xswait_state *xswait, libxl__domain_build_state_dispose(&sdss->dm_state); libxl__xswait_stop(gc, xswait); dmss_dispose(gc, &sdss->dm); + dmss_dispose(gc, &sdss->pvqemu); sdss->callback(egc, &sdss->dm, rc); } =20 --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511574; cv=none; d=zoho.com; s=zohoarc; b=L13EyVOTRuqoZmGaVYWwYpN13kzVgUzodi6Cum3ojvSHGupHerWdvrip2GYH6YHw9MGj3uDHs1dHC6FjV+3ZP8d3MEN1vueXlf9+uguTpU036EV19peyiGfg9oJKtfOIOEuaxmhUUJTo52muNGoTf9IJy/J2ZYqwbrqT62VS5fg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511574; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=k+MA2BwnQh/O7qfsSqG4zrN6AnKuoSbAFotMKcsIFNY=; b=YIjR2zVfOiTN76ywJaRn+D4V+wyrV31PRpdbewfXDK3GVYiSiVBa2wU2t7BEBE2Ohr22MXcFyiZAUTIEJCXdWU5SGIkdE7OSKPaWZ4rPiA7PNSFxw8zrtotWzV3IFRqiMnWE423HfRE6qrKL9kYVxrm6bRrNW8Os0OscbVGmaY8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511574483659.4192139770421; Fri, 14 Jun 2019 04:26:14 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKJ-0007SW-U4; Fri, 14 Jun 2019 11:24:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKI-0007Ru-1y for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:58 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 087e53c4-8e97-11e9-b1c3-5f976f97b11a; Fri, 14 Jun 2019 11:24:54 +0000 (UTC) X-Inumbo-ID: 087e53c4-8e97-11e9-b1c3-5f976f97b11a Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 0KqVKt5374Sipua02at4gsgz2QKNRA27APFGfR8P6oKgLKR12UccPvWqRn0ujONVcLQQVbG+jS bDTOIIaRp3PsdKfCUgmbn9ObL7UJn5WyaGLxxsJAoU4BluEwJYLJGmQtGHifB45foY39A5T4xC vxo7c4dEC4lE7i9bhIMudTXcmEaPLZL6Z3WbxFBq03bQvVcWTc2FwuaQgYT0xuMmZeTknNWGXN uaqr2H3YBtACYvMO7xS7mEP81IqAoJNwai33S6jr9vLrBDopE5net5IV9XUwDYhSb1e6UBoFJj z5Y= X-SBRS: 2.7 X-MesageID: 1737470 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737470" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:37 +0100 Message-ID: <20190614112444.29980-9-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 08/15] libxl: Comment libxl__dm_spawn_state aboud init and dispose X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 846227c3cd..0046b30549 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -3920,6 +3920,8 @@ typedef struct libxl__dm_spawn_state libxl__dm_spawn_= state; typedef void libxl__dm_spawn_cb(libxl__egc *egc, libxl__dm_spawn_state*, int rc /* if !0, error was logged */); =20 +/* Call dmss_init and dmss_dispose to initialise and dispose of + * libxl__dm_spawn_state */ struct libxl__dm_spawn_state { /* mixed - spawn.ao must be initialised by user; rest is private: */ libxl__spawn_state spawn; --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511573; cv=none; d=zoho.com; s=zohoarc; b=c340NkHarqEPiVL5FrseJ0NpNqNuyjQnY0x+TNE3lpXXWDTZSAKTCiLwbjKrxJtp+Ov7Fj5YQ4irPnM+ufjPRypRm/dJtWYG7BPMn9zZWZ7Qvy3U3wxF0CEqllW6bvo01vy5a1+6RfiHWxEvEZIy2ABPBgTutTUrCzVDOik9dq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ohwGDrU+4Jq9JsRjr3NX9Rz9r+IKw+IqRzguYOC3Vkc=; b=ebNnHwc4RhZe6p15eTksJwUIKxhNkKqPN/nl7Rho5Qb/hh6GL9928w8kgTJyHYiH/+pfohNOAJpiGiLJ78kRU3djP9yCnMXlrJtNDrg9iWTPXawrgHMjm5Q/DYow3v8JbCBOgmLLpa6dQTzWfaQxo63ReADw3FnAVOa4D36SnKA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511573587566.034651475541; Fri, 14 Jun 2019 04:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKM-0007TI-DQ; Fri, 14 Jun 2019 11:25:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKL-0007T9-E3 for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:25:01 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0a0760aa-8e97-11e9-9df2-6f477a47ccb4; Fri, 14 Jun 2019 11:24:57 +0000 (UTC) X-Inumbo-ID: 0a0760aa-8e97-11e9-9df2-6f477a47ccb4 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: B4g2j01qBHPBe1inYvHEy9tGwzv02NI4UcK0IMnEdTK+2o0y3bQVGy41sDpf6tM9bWD6VuD0mY bOzn5YvzW+cHng3GQ/U6gDl+CjVTpuxknHSXHHQPYcVtAY6c4Ki8sZqC7zPIsF404dCD/iOmDU hb67dLmR9vnbTGL8m/pBcZyeOthl3wYpJRcmu6HhVYqSPiMhPTNt/QkfXrpGaYdbHQ7WFPq0qK ygKuwT99ji/PPNyUsqF2Gy9GGzImaz/my3hCcPLbeM9+fxDxuY9q2CXgS8ve51IZmtokibOSeX i4U= X-SBRS: 2.7 X-MesageID: 1737471 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737471" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:38 +0100 Message-ID: <20190614112444.29980-10-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 09/15] libxl_domain: Cleanup libxl__destroy_domid X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" - dom_path isn't used anymore in that function, remove it. - Use `r' to store return value of external calls. - Use `CTX', no need for a local `ctx'. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_domain.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c index aee621b0a5..11a29b235b 100644 --- a/tools/libxl/libxl_domain.c +++ b/tools/libxl/libxl_domain.c @@ -1023,14 +1023,13 @@ static void domain_destroy_domid_cb(libxl__egc *egc, void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis) { STATE_AO_GC(dis->ao); - libxl_ctx *ctx =3D CTX; uint32_t domid =3D dis->domid; - char *dom_path; int rc, dm_present; + int r; =20 libxl__ev_child_init(&dis->destroyer); =20 - rc =3D libxl_domain_info(ctx, NULL, domid); + rc =3D libxl_domain_info(CTX, NULL, domid); switch(rc) { case 0: break; @@ -1058,17 +1057,12 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__d= estroy_domid_state *dis) abort(); } =20 - dom_path =3D libxl__xs_get_dompath(gc, domid); - if (!dom_path) { - rc =3D ERROR_FAIL; - goto out; - } - if (libxl__device_pci_destroy_all(gc, domid) < 0) LOGD(ERROR, domid, "Pci shutdown failed"); - rc =3D xc_domain_pause(ctx->xch, domid); - if (rc < 0) { - LOGEVD(ERROR, rc, domid, "xc_domain_pause failed"); + r =3D xc_domain_pause(CTX->xch, domid); + if (r < 0) { + LOGEVD(ERROR, r, domid, "xc_domain_pause failed"); + rc =3D ERROR_FAIL; } =20 if (dm_present) { --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511731; cv=none; d=zoho.com; s=zohoarc; b=bFj0jojE6n3CCBGskRwe8oWTD3S2Uji/S7jAolQ1YqNa/8p/NbmALG7djGB5x0ALWGhz4vCrTqRBv4SNAIJe9X41jYco+UYRax5x6Df0wcxYQEnw+0kgTlmPWytjyyXo0eLKZVSlJ/ljj2AL4d3syvHBGe/vYR6Ydy0QXxbqjqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=eKjN4tGa3xW/1tJyB5tQysurgoNQQt9Mks+Sybfvngw=; b=V89g36NOHg0jNUv/ITKObkuDIOVQC1yrTVHPdOB7FE3n9DYpgPszOzexS2eZsjmV68fCY/TCeO5y/HH8RlVyao4weJrW14h64oaaoqGfJIcCjwqLYJDhnSrTYG/WKDb/TUsof3LHlHGAwvo/z3xv5V5L5ceXFleYPOzmHQ/2Ct8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511731886169.31438899951047; Fri, 14 Jun 2019 04:28:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN0-0008Ot-6u; Fri, 14 Jun 2019 11:27:46 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkMz-0008Oe-FH for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:27:45 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 6dc544ba-8e97-11e9-8980-bc764e045a96; Fri, 14 Jun 2019 11:27:44 +0000 (UTC) X-Inumbo-ID: 6dc544ba-8e97-11e9-8980-bc764e045a96 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: EsWbqUuXwiKTE62cnB2MlQLTVuFOkRKut5yAyHADjC9KfeF60V5mvnV54IWDI35xJtMYiFLy/J XVnb9/jnmwwZEQKN4Tt+1BaVb1Jaz4pM6pvg/X9a5W+vTM5P3ymV9E4aC1Qu2h/p95e88s4RIC y9+JqkhBx4DJn4ffbwPMIGyStMgvHW7W3Gg5qzc3LYKcy8oZlle//0bxkMwt4z+2qxVkE8x6xi SBOGUe+Z4G++/d5QND85Qt3e42VBS3v5k53TkAcn5lfcqB1/uoVX4tlV93UvuwkeKp8aJbANn2 lZY= X-SBRS: 2.7 X-MesageID: 1737600 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737600" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:39 +0100 Message-ID: <20190614112444.29980-11-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 10/15] libxl_usb: Use proper domid value, from libxl__device X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" ao->domid isn't a reliable way of getting a domid, it might not be set (this isn't the case here). The right domid value can be found in the libxl__device (which is the device we want to remove) attached to libxl__ao_device. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index adb122ac85..3d389c0198 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -515,7 +515,7 @@ void libxl__initiate_device_usbctrl_remove(libxl__egc *= egc, libxl_device_usbdev *usbdevs =3D NULL; int num_usbdev =3D 0; int i, rc; - uint32_t domid =3D ao->domid; + uint32_t domid =3D aodev->dev->domid; int usbctrl_devid =3D aodev->dev->devid; libxl_device_usbctrl usbctrl; libxl_usbctrlinfo usbctrlinfo; --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511728; cv=none; d=zoho.com; s=zohoarc; b=VgZs4FBVK7Ur4mYteW7lz1PZU78xyq2AUByNgUqXmirIjGs7kyaedH8QoyK6MtwgfwRNMcoessF2o+pQ1K5Yd1kXVXRKcZCVbacU16zpMmwiTvqAAxYcumUmuOjEi7wMXagR0+tQ+SH//b8CEkZB3wCpKznp8bgWF8hxVJ/calY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511728; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=PWTzfJU3H05GkCB8+6U6Fzov42CVtM4gybTnCjW17+0=; b=SJ0RtSrnEuKwyT/Okple3KFI8Auj2rejUWiy1iljW9fNSduDjAI5V/6VvxBaHjaUbvEGOB+yC0Flg4DJ/uNT8YAsHJUSyMccAzXGGozEx06dxJrO1WloS5cHJ8Z3gygCnrU0VSQut6NTrHaG7M6DPQrHqCyMvQ5vdZX781R/5JY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15605117282891002.0361736945845; Fri, 14 Jun 2019 04:28:48 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN4-0008QI-Ho; Fri, 14 Jun 2019 11:27:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN3-0008Py-Cp for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:27:49 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6e74fda4-8e97-11e9-9abd-4bc53f874d12; Fri, 14 Jun 2019 11:27:46 +0000 (UTC) X-Inumbo-ID: 6e74fda4-8e97-11e9-9abd-4bc53f874d12 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: jwL9937GfRuLE398m1u5dheaP/tcyGm3Qf4JNg45rY1Xqmi4saYzQNUhR7/8PxkDyh4q+DMeAZ lMx3ELcoctWTK1zS0FZm+cSMddS+BQL/O5bTKyaNYfZlwR38YvIT5si2jNmzdZqg8X4TTCOOJt s+eFgZIBtoYF+cJcmLfVC9hzCkauc5y9yq1UW7P1s9pL1aMn/knDOLvTjJpeXF6gjkYPvYD2fN 9YABM+Dz1APUHNZEVyATIYESxTGgo+zGIZYhZ5UqFwF1iIRoV/MchGqESeODcU4NqoWCPCN7SQ n7I= X-SBRS: 2.7 X-MesageID: 1726673 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1726673" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:40 +0100 Message-ID: <20190614112444.29980-12-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 11/15] libxl_usb: Fix wrong usage of asserts X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Anthony PERARD --- tools/libxl/libxl_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index 3d389c0198..694870a3c3 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -148,7 +148,7 @@ static int libxl__device_from_usbctrl(libxl__gc *gc, ui= nt32_t domid, break; default: assert(0); /* can't really happen. */ - break; + return ERROR_INVAL; } device->devid =3D usbctrl->devid; device->domid =3D domid; @@ -371,7 +371,7 @@ static int libxl__device_usbctrl_add_hvm(libxl__gc *gc,= uint32_t domid, break; default: assert(0); /* Should not be possible. */ - break; + return ERROR_INVAL; } =20 flexarray_append_pair(qmp_args, "id", --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511723; cv=none; d=zoho.com; s=zohoarc; b=IHj04b9VVvF6TEyIOnEW8LyAHbjpoH4prKkdRgnAFRb/JIYsZfuozc8grZ37BBoFFBSQbZoGhFipiXiVqMO2lYeZ019sfWLK56elumWKPdhvSPQsZPiZPF3+IJ9+K7dXpKmdSCRUbnAVIAZtxUw/ycTRW5JVtSTs61Xg/ArzXzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511723; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=CdjplhzIa9BaK5+D2h5RUHUqFe3HPV6I1U0q7sMAE+o=; b=FdauNGkVIBoLi+n0RIsORklyINigtv+4ipe5TjkkgqGgm8XBDvMl0zO64RL13BoH4Wx/Uf18o3xKY84K48g9X5ppxi93YJYnpAxrdVhOVg9HJFTXNkJ9yUhQ3ZxrDPj0r6AVsAdUH3jlhiQ9q25qftjVZVm2BTdj3letPJxHW84= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511723013264.7849465310777; Fri, 14 Jun 2019 04:28:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkMy-0008OY-Tv; Fri, 14 Jun 2019 11:27:44 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkMx-0008Nf-7z for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:27:43 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 6c23ec23-8e97-11e9-8980-bc764e045a96; Fri, 14 Jun 2019 11:27:42 +0000 (UTC) X-Inumbo-ID: 6c23ec23-8e97-11e9-8980-bc764e045a96 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: fagq45aXva8k42F4MriKsdKADiAC2RapOtGX80yUmImUYzfQPqYVB+bgJdt1LgMMuZ/XRcbGOU IUFepxld7kiKGOkGoZQqOyK4CMer7iQyCUfoOdCF21jcGGuduwjld18rE9Dp2FD/2IKH7ABVPi gq4eac/jXA4mYze2vvQdRV3yYKYsN8GfWzbMgVZYqnVQwoAVAmTjU6FSFKcLJ4mY0cURc4EKP+ sB4uEShMPGBIk+f+qAh1QjhOZNZ+6xYA6IOPhdLKECycM3gQsXpSZ6mPefs1Eavcx/f/pUUQP5 T+w= X-SBRS: 2.7 X-MesageID: 1737598 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737598" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:41 +0100 Message-ID: <20190614112444.29980-13-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 12/15] libxl_usb: Fix libxl_device_usbctrl_getinfo X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" `usbctrl' is modified in this function which doesn't seems to be intended, and usbctrlinfo.backend_id was never modified. Take this opportunity to consify the argument `usbctrl' in libxl API to avoid similar mistake. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl.h | 2 +- tools/libxl/libxl_usb.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 9bacfb97f0..750ef1b7d0 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1950,7 +1950,7 @@ void libxl_device_usbctrl_list_free(libxl_device_usbc= trl *list, int nr); =20 =20 int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_usbctrl *usbctrl, + const libxl_device_usbctrl *usbctrl, libxl_usbctrlinfo *usbctrlinfo); =20 /* USB Devices */ diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index 694870a3c3..9851fe8468 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -641,7 +641,7 @@ libxl_device_usbctrl_list(libxl_ctx *ctx, uint32_t domi= d, int *num) } =20 int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_usbctrl *usbctrl, + const libxl_device_usbctrl *usbctrl, libxl_usbctrlinfo *usbctrlinfo) { GC_INIT(ctx); @@ -678,7 +678,7 @@ int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32= _t domid, be_path =3D READ_SUBPATH(libxl_path, "backend"); usbctrlinfo->backend =3D libxl__strdup(NOGC, be_path); rc =3D libxl__backendpath_parse_domid(gc, be_path, - &usbctrl->backend_domid); + &usbctrlinfo->backend_id); if (rc) goto out; usbctrlinfo->state =3D READ_SUBPATH_INT(fe_path, "state"); usbctrlinfo->evtch =3D READ_SUBPATH_INT(fe_path, "event-channel"); @@ -691,7 +691,7 @@ int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32= _t domid, } else { usbctrlinfo->ports =3D READ_SUBPATH_INT(libxl_path, "num-ports"); usbctrlinfo->version =3D READ_SUBPATH_INT(libxl_path, "usb-ver"); - rc =3D libxl__get_domid(gc, &usbctrl->backend_domid); + rc =3D libxl__get_domid(gc, &usbctrlinfo->backend_id); if (rc) goto out; } =20 --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511732; cv=none; d=zoho.com; s=zohoarc; b=TEYH77pVUNtu96aFjoOyJBhGv8vDeP5ruSlWp/AcGLlzJhALL1ZcXBgIl/uj2EdtPowbeWqHTRtxVrUen28XK/mtMwvTwHzOLKYrx+GY7nWPid1/5JH5Wmt65LEw+3rt3sZuYBpBb7KEHb+vmRK8Iueco8qlN10CtlDkHV2GxRQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511732; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=eHSThRj+kBnp7/rLH4h6KeovlBJrknNZuNGSgmMpwSo=; b=V3GoykJi+iYj5CFjBmQqZN2czN2N0sw6A4OjEF0lto319qGINrAzIdyXRkkkrxi5ThzchByvcS45gmVLpLbNhoNynlWhlLrNToxN/NhukNjNraSJHpb+MyxcbowoCdgOqoSCiiQA5m2kgddc78HA1ql+gXr03I1mQJ3ABTGO/G8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511732519882.0814711858608; Fri, 14 Jun 2019 04:28:52 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN8-0008Sq-C9; Fri, 14 Jun 2019 11:27:54 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN7-0008SE-Om for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:27:53 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 725a4d25-8e97-11e9-8980-bc764e045a96; Fri, 14 Jun 2019 11:27:52 +0000 (UTC) X-Inumbo-ID: 725a4d25-8e97-11e9-8980-bc764e045a96 Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: XuuLk7rHiFx7QLhIv3kuzFGBBp5YdE7XbRau8sdAMtgRITnvU1ocX1S5Qxu19O9aFrBAd0vptl yCg9Fx5F1PBOv0zkHO9di/9fWNAPCRETwuWFKJBH7Y9gtbIMK4J/BbX9ZMuOj6zxfqsDULvysb K2ZRUT2z3Ibv13Jk43Z9iVbin7LWxTD8nVKyuowCMXwxfHn04KuKT9+6KHLUbmqsD03LmkX5hT TBMiNDG4gTKKIpeqqMS9sUYU/3l56XRpXoUKGANFreZSl81fn7p2oytlPcE1xj88w/7+4iFXUU n3A= X-SBRS: 2.7 X-MesageID: 1746072 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1746072" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:42 +0100 Message-ID: <20190614112444.29980-14-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 13/15] libxl: Constify libxl_device_* param of *_getinfo X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The libxl_device_TYPE parameter of all the libxl_device_TYPE_getinfo function seems to be only used as input to find more information to bi stored in the libxl_TYPEinfo parameter. Make sure this is always true and constify the input parameter to avoid further mistake. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl.h | 14 +++++++------- tools/libxl/libxl_console.c | 2 +- tools/libxl/libxl_disk.c | 3 ++- tools/libxl/libxl_nic.c | 3 ++- tools/libxl/libxl_vdispl.c | 2 +- tools/libxl/libxl_vkb.c | 2 +- tools/libxl/libxl_vsnd.c | 4 ++-- tools/libxl/libxl_vtpm.c | 2 +- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 750ef1b7d0..e40546c23a 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1888,7 +1888,7 @@ libxl_device_disk *libxl_device_disk_list(libxl_ctx *= ctx, void libxl_device_disk_list_free(libxl_device_disk* list, int num) LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_disk *disk, libxl_diskinfo *dis= kinfo) + const libxl_device_disk *disk, libxl_diskinf= o *diskinfo) LIBXL_EXTERNAL_CALLERS_ONLY; =20 /* @@ -1989,7 +1989,7 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ct= x, void libxl_device_nic_list_free(libxl_device_nic* list, int num) LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_nic *nic, libxl_nicinfo *nicinfo) + const libxl_device_nic *nic, libxl_nicinfo *n= icinfo) LIBXL_EXTERNAL_CALLERS_ONLY; =20 /* @@ -2000,7 +2000,7 @@ libxl_device_channel *libxl_device_channel_list(libxl= _ctx *ctx, uint32_t domid, int *num); int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_channel *channel, + const libxl_device_channel *channel, libxl_channelinfo *channelinfo); =20 /* Virtual TPMs */ @@ -2022,7 +2022,7 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *= ctx, void libxl_device_vtpm_list_free(libxl_device_vtpm*, int num) LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vtpm *vtpm, libxl_vtpminfo *vtp= minfo) + const libxl_device_vtpm *vtpm, libxl_vtpminf= o *vtpminfo) LIBXL_EXTERNAL_CALLERS_ONLY; =20 /* Virtual displays */ @@ -2045,7 +2045,7 @@ libxl_device_vdispl *libxl_device_vdispl_list(libxl_c= tx *ctx, void libxl_device_vdispl_list_free(libxl_device_vdispl* list, int num) LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vdispl *vdispl, + const libxl_device_vdispl *vdispl, libxl_vdisplinfo *vdisplinfo) LIBXL_EXTERNAL_CALLERS_ONLY; =20 @@ -2069,7 +2069,7 @@ libxl_device_vsnd *libxl_device_vsnd_list(libxl_ctx *= ctx, void libxl_device_vsnd_list_free(libxl_device_vsnd* list, int num) LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_device_vsnd_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vsnd *vsnd, + const libxl_device_vsnd *vsnd, libxl_vsndinfo *vsndlinfo) LIBXL_EXTERNAL_CALLERS_ONLY; =20 @@ -2092,7 +2092,7 @@ libxl_device_vkb *libxl_device_vkb_list(libxl_ctx *ct= x, void libxl_device_vkb_list_free(libxl_device_vkb* list, int num) LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_device_vkb_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vkb *vkb, + const libxl_device_vkb *vkb, libxl_vkbinfo *vkbinfo) LIBXL_EXTERNAL_CALLERS_ONLY; =20 diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c index 36d79f5adc..088a455b52 100644 --- a/tools/libxl/libxl_console.c +++ b/tools/libxl/libxl_console.c @@ -566,7 +566,7 @@ libxl_device_channel *libxl_device_channel_list(libxl_c= tx *ctx, } =20 int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_channel *channel, + const libxl_device_channel *channel, libxl_channelinfo *channelinfo) { GC_INIT(ctx); diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c index bc9e2d5a74..d46e78a75c 100644 --- a/tools/libxl/libxl_disk.c +++ b/tools/libxl/libxl_disk.c @@ -598,7 +598,8 @@ int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t = domid, } =20 int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_disk *disk, libxl_diskinfo *dis= kinfo) + const libxl_device_disk *disk, + libxl_diskinfo *diskinfo) { GC_INIT(ctx); char *fe_path, *libxl_path; diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c index f2b5e02285..07880b39e1 100644 --- a/tools/libxl/libxl_nic.c +++ b/tools/libxl/libxl_nic.c @@ -399,7 +399,8 @@ void libxl_device_nic_list_free(libxl_device_nic* list,= int num) } =20 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_nic *nic, libxl_nicinfo *nicinf= o) + const libxl_device_nic *nic, + libxl_nicinfo *nicinfo) { GC_INIT(ctx); char *nicpath, *libxl_path; diff --git a/tools/libxl/libxl_vdispl.c b/tools/libxl/libxl_vdispl.c index c9cc455176..8ddc8940e9 100644 --- a/tools/libxl/libxl_vdispl.c +++ b/tools/libxl/libxl_vdispl.c @@ -152,7 +152,7 @@ static int libxl__device_vdispl_getconnectors(libxl_ctx= *ctx, } =20 int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vdispl *vdispl, + const libxl_device_vdispl *vdispl, libxl_vdisplinfo *info) { GC_INIT(ctx); diff --git a/tools/libxl/libxl_vkb.c b/tools/libxl/libxl_vkb.c index 64e20b772a..26376a7eef 100644 --- a/tools/libxl/libxl_vkb.c +++ b/tools/libxl/libxl_vkb.c @@ -270,7 +270,7 @@ int libxl_devid_to_device_vkb(libxl_ctx *ctx, uint32_t = domid, } =20 int libxl_device_vkb_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vkb *vkb, + const libxl_device_vkb *vkb, libxl_vkbinfo *info) { GC_INIT(ctx); diff --git a/tools/libxl/libxl_vsnd.c b/tools/libxl/libxl_vsnd.c index 1151cbc567..0bc5f6dbb1 100644 --- a/tools/libxl/libxl_vsnd.c +++ b/tools/libxl/libxl_vsnd.c @@ -563,7 +563,7 @@ static int libxl__device_stream_getinfo(libxl__gc *gc, = const char *path, } =20 static int libxl__device_pcm_getinfo(libxl__gc *gc, const char *path, - libxl_device_vsnd *vsnd, + const libxl_device_vsnd *vsnd, libxl_vsndinfo *info) { int i; @@ -588,7 +588,7 @@ static int libxl__device_pcm_getinfo(libxl__gc *gc, con= st char *path, } =20 int libxl_device_vsnd_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vsnd *vsnd, + const libxl_device_vsnd *vsnd, libxl_vsndinfo *info) { GC_INIT(ctx); diff --git a/tools/libxl/libxl_vtpm.c b/tools/libxl/libxl_vtpm.c index f750395f6f..dd00b267bb 100644 --- a/tools/libxl/libxl_vtpm.c +++ b/tools/libxl/libxl_vtpm.c @@ -90,7 +90,7 @@ static int libxl__vtpm_from_xenstore(libxl__gc *gc, const= char *libxl_path, =20 int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid, - libxl_device_vtpm *vtpm, + const libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo) { GC_INIT(ctx); --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511734; cv=none; d=zoho.com; s=zohoarc; b=hxAIXIBFmZkkMDsMK+3ffXA0VvYQrtHUZJRIh0rfoeTSCwzW1f2j8nmTzS/pkgL1zdWyck+MnCSe8VjFaf8MsRyT61R2X1QOFPmrqxrVHZ73wGUD5mzxzFD0yvR8T/WxUsNh2iYacWsYTlUJ9BRl5F97iGg9HyYZIE8Nbjf+Xs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511734; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=hFMKwKejXkl1HOJMcEEtK3jhpW32+iGHWbqwlmCb8C0=; b=mu7HJvxuMYAm6YOG34Ix1Vc9CKHjR6bM6RwX5QEtdhX1WVYxnMptUhujlBrAEATt5nQ/KW9EfOySkcIp+SDHRU9hF/kbQ7yWIg7rDC4xX5QNblIO+xuoERtIcoV/jJNcKABa+dMI+LEJ98lBA6o+/1Eix5phPG7/JSTV7eTbvOo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511734356801.7622294983506; Fri, 14 Jun 2019 04:28:54 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN8-0008SQ-0u; Fri, 14 Jun 2019 11:27:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkN6-0008Rb-HF for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:27:52 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 703b6cfe-8e97-11e9-a07e-5be0cf5927e5; Fri, 14 Jun 2019 11:27:49 +0000 (UTC) X-Inumbo-ID: 703b6cfe-8e97-11e9-a07e-5be0cf5927e5 Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 4v17sPX06L0GBxB8o8zh5iKDAxoT+LV+GRHc9AD61XHVKOxA4m9E5NlPaNigXSqzmf+QBLMjJ0 HQr7lpgm8v7ZnLfRyXNthDcBCz9Za2etHpkdX55noCB8pem5ag/TNiepHcJheMZl1jv1M9Tb7a FTEsfiGqE7YY2ntTAHlhdHWoCJ+HV/gBki6lNCw9E/BZxgqZOlQQD8/K4rbV1Wvl63s/B9TrJX cL+vfYeA+yJiZks720zWchQauNS9aegAcFw6ZUhDTrVw/OsGR760SikPiax5z3ZTvMHjZ7m693 xO8= X-SBRS: 2.7 X-MesageID: 1724306 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1724306" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:43 +0100 Message-ID: <20190614112444.29980-15-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 14/15] libxl_usb: usbctrl, make use of generic device handling functions X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Two functions in generate `libxl_device_usbctrl' can be replaced by generic macro: - libxl_device_usbctrl_list -> LIBXL_DEFINE_DEVICE_LIST - libxl_devid_to_device_usbctrl -> LIBXL_DEFINE_DEVID_TO_DEVICE This patch only needs to define `libxl__usbctrl_devtype.from_xenstore' to makes use of them. Small change, libxl_devid_to_device_usbctrl doesn't list all usbctrl anymore before finding the right one. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_usb.c | 122 +++++++++++----------------------------- 1 file changed, 32 insertions(+), 90 deletions(-) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index 9851fe8468..de49f8620c 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -563,81 +563,53 @@ void libxl__initiate_device_usbctrl_remove(libxl__egc= *egc, return; } =20 -libxl_device_usbctrl * -libxl_device_usbctrl_list(libxl_ctx *ctx, uint32_t domid, int *num) +static int libxl__usbctrl_from_xenstore(libxl__gc *gc, + const char *libxl_path, + libxl_devid devid, + libxl_device_usbctrl *usbctrl_r) { - GC_INIT(ctx); - libxl_device_usbctrl *usbctrls =3D NULL; - char *libxl_vusbs_path =3D NULL; - char **entry =3D NULL; - unsigned int nentries =3D 0; - - *num =3D 0; - - libxl_vusbs_path =3D GCSPRINTF("%s/device/%s", - libxl__xs_libxl_path(gc, domid), - libxl__device_kind_to_string(LIBXL__DEVICE_KIND_VUSB)= ); - entry =3D libxl__xs_directory(gc, XBT_NULL, libxl_vusbs_path, &nentrie= s); - - if (entry && nentries) { - usbctrls =3D libxl__zalloc(NOGC, sizeof(*usbctrls) * nentries); - libxl_device_usbctrl *usbctrl; - libxl_device_usbctrl *end =3D usbctrls + nentries; - for (usbctrl =3D usbctrls; - usbctrl < end; - usbctrl++, entry++, (*num)++) { - const char *tmp, *be_path, *libxl_path; - int ret; - - libxl_device_usbctrl_init(usbctrl); - usbctrl->devid =3D atoi(*entry); + int rc; + const char *tmp; + const char *be_path; =20 #define READ_SUBPATH(path, subpath) ({ \ - ret =3D libxl__xs_read_checked(gc, XBT_NULL, \ + rc =3D libxl__xs_read_checked(gc, XBT_NULL, \ GCSPRINTF("%s/" subpath, path), \ &tmp); \ - if (ret) goto out; \ + if (rc) goto out; \ (char *)tmp; \ }) =20 #define READ_SUBPATH_INT(path, subpath) ({ \ - ret =3D libxl__xs_read_checked(gc, XBT_NULL, \ + rc =3D libxl__xs_read_checked(gc, XBT_NULL, \ GCSPRINTF("%s/" subpath, path), \ &tmp); \ - if (ret) goto out; \ + if (rc) goto out; \ tmp ? atoi(tmp) : -1; \ }) =20 - libxl_path =3D GCSPRINTF("%s/%s", libxl_vusbs_path, *entry); - libxl_usbctrl_type_from_string(READ_SUBPATH(libxl_path, "type"= ), - &usbctrl->type); - if (usbctrl->type =3D=3D LIBXL_USBCTRL_TYPE_DEVICEMODEL) { - be_path =3D libxl_path; - ret =3D libxl__get_domid(gc, &usbctrl->backend_domid); - } else { - be_path =3D READ_SUBPATH(libxl_path, "backend"); - if (!be_path) goto out; - ret =3D libxl__backendpath_parse_domid(gc, be_path, - &usbctrl->backend_dom= id); - } - if (ret) goto out; - usbctrl->version =3D READ_SUBPATH_INT(be_path, "usb-ver"); - usbctrl->ports =3D READ_SUBPATH_INT(be_path, "num-ports"); + usbctrl_r->devid =3D devid; + libxl_usbctrl_type_from_string(READ_SUBPATH(libxl_path, "type"), + &usbctrl_r->type); + if (usbctrl_r->type =3D=3D LIBXL_USBCTRL_TYPE_DEVICEMODEL) { + be_path =3D libxl_path; + rc =3D libxl__get_domid(gc, &usbctrl_r->backend_domid); + } else { + be_path =3D READ_SUBPATH(libxl_path, "backend"); + if (!be_path) goto out; + rc =3D libxl__backendpath_parse_domid(gc, be_path, + &usbctrl_r->backend_domid); + } + if (rc) goto out; + usbctrl_r->version =3D READ_SUBPATH_INT(be_path, "usb-ver"); + usbctrl_r->ports =3D READ_SUBPATH_INT(be_path, "num-ports"); =20 #undef READ_SUBPATH #undef READ_SUBPATH_INT - } - } - - GC_FREE; - return usbctrls; - out: - LOGD(ERROR, domid, "Unable to list USB Controllers"); - libxl_device_usbctrl_list_free(usbctrls, *num); - GC_FREE; - *num =3D 0; - return NULL; + if (rc) + libxl_device_usbctrl_dispose(usbctrl_r); + return rc; } =20 int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid, @@ -705,30 +677,6 @@ int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint3= 2_t domid, return rc; } =20 -int libxl_devid_to_device_usbctrl(libxl_ctx *ctx, - uint32_t domid, - int devid, - libxl_device_usbctrl *usbctrl) -{ - libxl_device_usbctrl *usbctrls; - int nb =3D 0; - int i, rc; - - usbctrls =3D libxl_device_usbctrl_list(ctx, domid, &nb); - if (!usbctrls) return ERROR_FAIL; - - rc =3D ERROR_FAIL; - for (i =3D 0; i < nb; i++) { - if (devid =3D=3D usbctrls[i].devid) { - libxl_device_usbctrl_copy(ctx, usbctrl, &usbctrls[i]); - rc =3D 0; - break; - } - } - - libxl_device_usbctrl_list_free(usbctrls, nb); - return rc; -} =20 static char *usbdev_busaddr_to_busid(libxl__gc *gc, int bus, int addr) { @@ -1945,15 +1893,6 @@ static int libxl_device_usbdev_compare(const libxl_d= evice_usbdev *d1, return COMPARE_USB(d1, d2); } =20 -void libxl_device_usbctrl_list_free(libxl_device_usbctrl *list, int nr) -{ - int i; - - for (i =3D 0; i < nr; i++) - libxl_device_usbctrl_dispose(&list[i]); - free(list); -} - void libxl_device_usbdev_list_free(libxl_device_usbdev *list, int nr) { int i; @@ -1965,7 +1904,10 @@ void libxl_device_usbdev_list_free(libxl_device_usbd= ev *list, int nr) =20 #define libxl__device_usbctrl_update_devid NULL =20 +LIBXL_DEFINE_DEVID_TO_DEVICE(usbctrl) +LIBXL_DEFINE_DEVICE_LIST(usbctrl) DEFINE_DEVICE_TYPE_STRUCT(usbctrl, VUSB, + .from_xenstore =3D (device_from_xenstore_fn_t)libxl__usbctrl_from_xens= tore, .dm_needed =3D libxl_device_usbctrl_dm_needed ); =20 --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu May 2 12:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560511741; cv=none; d=zoho.com; s=zohoarc; b=UzawEDgtgstcIV9xa3/BHmNQepeOKPn0merO1zkvY0Em2Ho6dOWWALQxdoc/goniQB9svgf0jgOl9gP6kfEAVrOQpED4OnrYXEPjAGYcwggCmU1WvPCTwnktNjq2ueNsIIOZ91oKYGRnAhrPLmv8nwXEJWczdpy1tA03kDJSWzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560511741; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=i8a3mA69TnTAmS4+gPFCAFTb7E/1bC5w6OTBmouBNss=; b=gRJwsI8ZhC8Qqe4hEi3xECIeRG4IAZmGmvCx80uxTewfolIQKcLFMFhtT15LEvmJhtcpLoQs+U0sNGtCp7f42yWMOCjAWqGZHEZ1nyyb8rPgi5R7WUgvFwU0pWAmaZTtHt2ts7yWZrDyE3872wX7SNKtwqmgDSu6GqbFc/Dkmjc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560511741370122.83231272965384; Fri, 14 Jun 2019 04:29:01 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkNG-00006r-PJ; Fri, 14 Jun 2019 11:28:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkNG-00006S-2B for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:28:02 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 76357622-8e97-11e9-a6ab-07f56f5bfeb1; Fri, 14 Jun 2019 11:27:59 +0000 (UTC) X-Inumbo-ID: 76357622-8e97-11e9-a6ab-07f56f5bfeb1 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: VkyxnMKZ5uiISRo8Z3I3ELlzeAoB8sS4FfEKdmJdYjz44Zkg+NFGEPbnwDtOZZ/+e/a/eu6E/4 eK34fj68eAm4GMNsmHQCHyV0H7LOiaOOdEy+GZABWg2q1798pReltQkMi+6SyLTYGRs6pfv5DS xbvl0GRkFZge9Lzu/12YNn7GiGVMZzWx/Lk9h3+sVh2JrjhaZvoMIhBEmpCEuWx8gpU5whySXU dF0XSylE3vHMaJPdTUzy7GFUBAPsOGPA+iOOLMYD5YysqPW/weeBTFnsbfOVe0DmEwELe+e+VI d1k= X-SBRS: 2.7 X-MesageID: 1754071 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1754071" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:44 +0100 Message-ID: <20190614112444.29980-16-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 15/15] libxl_usb: Use usbctrl instead of usbctrlinfo X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The functions that calls usbctrl_getinfo() only needs information that can be found in a `libxl_device_usbctrl'. So avoid calling libxl_device_usbctrl_getinfo and call libxl_devid_to_device_usbctrl instead. (libxl_device_usbctrl_getinfo needs a `libxl_device_usbctrl' anyway.) Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_usb.c | 49 +++++++++++------------------------------ 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index de49f8620c..3d69379c20 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -518,13 +518,10 @@ void libxl__initiate_device_usbctrl_remove(libxl__egc= *egc, uint32_t domid =3D aodev->dev->domid; int usbctrl_devid =3D aodev->dev->devid; libxl_device_usbctrl usbctrl; - libxl_usbctrlinfo usbctrlinfo; =20 libxl_device_usbctrl_init(&usbctrl); - libxl_usbctrlinfo_init(&usbctrlinfo); - usbctrl.devid =3D usbctrl_devid; - - rc =3D libxl_device_usbctrl_getinfo(CTX, domid, &usbctrl, &usbctrlinfo= ); + rc =3D libxl_devid_to_device_usbctrl(CTX, domid, usbctrl_devid, + &usbctrl); if (rc) goto out; =20 /* Remove usb devices first */ @@ -541,7 +538,7 @@ void libxl__initiate_device_usbctrl_remove(libxl__egc *= egc, } } =20 - if (usbctrlinfo.type =3D=3D LIBXL_USBCTRL_TYPE_DEVICEMODEL) { + if (usbctrl.type =3D=3D LIBXL_USBCTRL_TYPE_DEVICEMODEL) { rc =3D libxl__device_usbctrl_del_hvm(gc, domid, usbctrl_devid); if (!rc) libxl__device_usbctrl_del_xenstore(gc, domid, &usbctrl); @@ -549,7 +546,6 @@ void libxl__initiate_device_usbctrl_remove(libxl__egc *= egc, } =20 libxl_device_usbctrl_dispose(&usbctrl); - libxl_usbctrlinfo_dispose(&usbctrlinfo); =20 /* Remove usbctrl */ libxl__initiate_device_generic_remove(egc, aodev); @@ -557,7 +553,6 @@ void libxl__initiate_device_usbctrl_remove(libxl__egc *= egc, =20 out: libxl_device_usbctrl_dispose(&usbctrl); - libxl_usbctrlinfo_dispose(&usbctrlinfo); aodev->rc =3D rc; aodev->callback(egc, aodev); return; @@ -1531,16 +1526,12 @@ static int do_usbdev_add(libxl__gc *gc, uint32_t do= mid, int rc; char *busid; libxl_device_usbctrl usbctrl; - libxl_usbctrlinfo usbctrlinfo; =20 libxl_device_usbctrl_init(&usbctrl); - libxl_usbctrlinfo_init(&usbctrlinfo); - usbctrl.devid =3D usbdev->ctrl; - - rc =3D libxl_device_usbctrl_getinfo(CTX, domid, &usbctrl, &usbctrlinfo= ); + rc =3D libxl_devid_to_device_usbctrl(CTX, domid, usbdev->ctrl, &usbctr= l); if (rc) goto out; =20 - switch (usbctrlinfo.type) { + switch (usbctrl.type) { case LIBXL_USBCTRL_TYPE_PV: busid =3D usbdev_busaddr_to_busid(gc, usbdev->u.hostdev.hostbus, usbdev->u.hostdev.hostaddr); @@ -1591,7 +1582,6 @@ static int do_usbdev_add(libxl__gc *gc, uint32_t domi= d, =20 out: libxl_device_usbctrl_dispose(&usbctrl); - libxl_usbctrlinfo_dispose(&usbctrlinfo); return rc; } =20 @@ -1620,21 +1610,19 @@ static void libxl__device_usbdev_add(libxl__egc *eg= c, uint32_t domid, libxl_device_usbdev *assigned; int num_assigned; libxl_device_usbctrl usbctrl; - libxl_usbctrlinfo usbctrlinfo; =20 libxl_device_usbctrl_init(&usbctrl); - libxl_usbctrlinfo_init(&usbctrlinfo); =20 /* Currently only support adding USB device from Dom0 backend. * So, if USB controller is specified, check its backend domain, * if it's not Dom0, report error. */ if (usbdev->ctrl !=3D -1) { - usbctrl.devid =3D usbdev->ctrl; - rc =3D libxl_device_usbctrl_getinfo(CTX, domid, &usbctrl, &usbctrl= info); + rc =3D libxl_devid_to_device_usbctrl(CTX, domid, usbdev->ctrl, + &usbctrl); if (rc) goto out; =20 - if (usbctrlinfo.backend_id !=3D LIBXL_TOOLSTACK_DOMID) { + if (usbctrl.backend_domid !=3D LIBXL_TOOLSTACK_DOMID) { LOGD(ERROR, domid, "Don't support adding USB device from non-Dom0 backend"); rc =3D ERROR_INVAL; @@ -1674,7 +1662,6 @@ static void libxl__device_usbdev_add(libxl__egc *egc,= uint32_t domid, =20 out: libxl_device_usbctrl_dispose(&usbctrl); - libxl_usbctrlinfo_dispose(&usbctrlinfo); aodev->rc =3D rc; aodev->callback(egc, aodev); return; @@ -1689,18 +1676,14 @@ static int do_usbdev_remove(libxl__gc *gc, uint32_t= domid, int rc; char *busid; libxl_device_usbctrl usbctrl; - libxl_usbctrlinfo usbctrlinfo; =20 libxl_device_usbctrl_init(&usbctrl); - libxl_usbctrlinfo_init(&usbctrlinfo); - usbctrl.devid =3D usbdev->ctrl; - - rc =3D libxl_device_usbctrl_getinfo(CTX, domid, &usbctrl, &usbctrlinfo= ); + rc =3D libxl_devid_to_device_usbctrl(CTX, domid, usbdev->ctrl, &usbctr= l); if (rc) goto out; =20 - switch (usbctrlinfo.type) { + switch (usbctrl.type) { case LIBXL_USBCTRL_TYPE_PV: - busid =3D usbdev_busid_from_ctrlport(gc, domid, usbdev, usbctrlinf= o.type); + busid =3D usbdev_busid_from_ctrlport(gc, domid, usbdev, usbctrl.ty= pe); if (!busid) { rc =3D ERROR_FAIL; goto out; @@ -1772,7 +1755,6 @@ static int do_usbdev_remove(libxl__gc *gc, uint32_t d= omid, =20 out: libxl_device_usbctrl_dispose(&usbctrl); - libxl_usbctrlinfo_dispose(&usbctrlinfo); return rc; } =20 @@ -1787,7 +1769,6 @@ static int do_usbdev_remove(libxl__gc *gc, uint32_t d= omid, static int libxl__device_usbdev_remove(libxl__gc *gc, uint32_t domid, libxl_device_usbdev *usbdev) { - libxl_usbctrlinfo usbctrlinfo; libxl_device_usbctrl usbctrl; int rc; =20 @@ -1797,13 +1778,10 @@ static int libxl__device_usbdev_remove(libxl__gc *g= c, uint32_t domid, } =20 libxl_device_usbctrl_init(&usbctrl); - libxl_usbctrlinfo_init(&usbctrlinfo); - usbctrl.devid =3D usbdev->ctrl; - - rc =3D libxl_device_usbctrl_getinfo(CTX, domid, &usbctrl, &usbctrlinfo= ); + rc =3D libxl_devid_to_device_usbctrl(CTX, domid, usbdev->ctrl, &usbctr= l); if (rc) goto out; =20 - if (usbctrlinfo.backend_id !=3D LIBXL_TOOLSTACK_DOMID) { + if (usbctrl.backend_domid !=3D LIBXL_TOOLSTACK_DOMID) { LOGD(ERROR, domid, "Don't support removing USB device from non-Dom0 backend"); rc =3D ERROR_INVAL; @@ -1815,7 +1793,6 @@ static int libxl__device_usbdev_remove(libxl__gc *gc,= uint32_t domid, =20 out: libxl_device_usbctrl_dispose(&usbctrl); - libxl_usbctrlinfo_dispose(&usbctrlinfo); return rc; } =20 --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel