From patchwork Wed Oct 30 18:07:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11219901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A49E01390 for ; Wed, 30 Oct 2019 18:08:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7226A2087E for ; Wed, 30 Oct 2019 18:08:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="RH5/GOOb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7226A2087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iPsNG-0003Tv-Bd; Wed, 30 Oct 2019 18:07:14 +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 1iPsNF-0003Td-Ha for xen-devel@lists.xenproject.org; Wed, 30 Oct 2019 18:07:13 +0000 X-Inumbo-ID: 160f8466-fb40-11e9-9534-12813bfff9fa Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 160f8466-fb40-11e9-9534-12813bfff9fa; Wed, 30 Oct 2019 18:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1572458828; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iii6ZHxeKitPwoiHj/npNpmeKfkpaTv/pdgbQ14SFVs=; b=RH5/GOObpZslyWnax10sRS5+P2PIWxEMASIZqybPHUWvBQPCk1XKnmP3 9bJdHABoIt2wP2vQwAXVFeXfqsTYsJcr+QPeJLM5X9gBIx1ywBEQZnC4u EM8u3mg/p2XUOB8t/wp/frxlhMPMHGPkF7A0afhKY31XeKjqDRaET9SZV s=; 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 (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 ip4:168.245.78.127 ~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: Wdtmq/q+D+BFZQeXVSNdmL4zxOFbyk6bRhLSppfdvrQAep85mFdR/DEnn51XHBfwNcUEu1onW+ pRZJAmez9wULxTOuqzq8jmpeBHvOZ0fhAcK9GQ1cHOOVEeugm092nzllVFKosLm7OZ7rTYApPJ mTdyFp06Cifvl4GPzLT8zsMM4Abtu7ka7B+iN5kulgwsVq3ShLRY5/7ZS5nm2ohETgbAVIWTtZ SLCCNe6YVA0yFdx4TerOPh/qpRSP91M4UsWzVsb7pK/RFzZXl9zc3wmeWfoilSLDxJHcMXdwvT 6Eg= X-SBRS: 2.7 X-MesageID: 7637910 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.68,248,1569297600"; d="scan'208";a="7637910" From: Anthony PERARD To: Date: Wed, 30 Oct 2019 18:07:03 +0000 Message-ID: <20191030180704.261320-6-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191030180704.261320-1-anthony.perard@citrix.com> References: <20191030180704.261320-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH for-4.13 v2 5/6] libxl: libxl__ev_qmp_send now takes an egc 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 , =?utf-8?b?SsO8cmdlbiBHcm8=?= =?utf-8?b?w58=?= , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" No functionnal changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_disk.c | 6 +++--- tools/libxl/libxl_dm.c | 8 ++++---- tools/libxl/libxl_dom_save.c | 2 +- tools/libxl/libxl_dom_suspend.c | 2 +- tools/libxl/libxl_domain.c | 8 ++++---- tools/libxl/libxl_internal.h | 2 +- tools/libxl/libxl_pci.c | 8 ++++---- tools/libxl/libxl_qmp.c | 10 +++++----- tools/libxl/libxl_usb.c | 28 ++++++++++++++++------------ 9 files changed, 39 insertions(+), 35 deletions(-) diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c index 77ae3a59bfb6..64a66914240a 100644 --- a/tools/libxl/libxl_disk.c +++ b/tools/libxl/libxl_disk.c @@ -776,7 +776,7 @@ static void cdrom_insert_lock_acquired(libxl__egc *egc, QMP_PARAMETERS_SPRINTF(&args, "device", "ide-%i", devid); cis->qmp.callback = cdrom_insert_ejected; - rc = libxl__ev_qmp_send(gc, &cis->qmp, "eject", args); + rc = libxl__ev_qmp_send(egc, &cis->qmp, "eject", args); if (rc) goto out; } else { cdrom_insert_ejected(egc, &cis->qmp, NULL, 0); /* must be last */ @@ -884,7 +884,7 @@ static void cdrom_insert_ejected(libxl__egc *egc, libxl_disk_format_to_string(disk->format), disk->pdev_path); qmp->callback = cdrom_insert_addfd_cb; - rc = libxl__ev_qmp_send(gc, qmp, "add-fd", args); + rc = libxl__ev_qmp_send(egc, qmp, "add-fd", args); if (rc) goto out; has_callback = true; } else { @@ -938,7 +938,7 @@ static void cdrom_insert_addfd_cb(libxl__egc *egc, libxl__qmp_param_add_string(gc, &args, "arg", libxl__qemu_disk_format_string(disk->format)); qmp->callback = cdrom_insert_inserted; - rc = libxl__ev_qmp_send(gc, qmp, "change", args); + rc = libxl__ev_qmp_send(egc, qmp, "change", args); out: if (rc) cdrom_insert_done(egc, cis, rc); /* must be last */ diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 7e52f0973172..ebfe98ebc237 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -2649,7 +2649,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss) dmss->qmp.callback = device_model_qmp_cb; dmss->qmp.domid = domid; dmss->qmp.payload_fd = -1; - rc = libxl__ev_qmp_send(gc, &dmss->qmp, "query-status", NULL); + rc = libxl__ev_qmp_send(egc, &dmss->qmp, "query-status", NULL); if (rc) goto out_close; } @@ -2807,7 +2807,7 @@ static void device_model_spawn_outcome(libxl__egc *egc, dmss->qmp.domid = dmss->guest_domid; dmss->qmp.payload_fd = -1; dmss->qmp.callback = device_model_postconfig_chardev; - rc = libxl__ev_qmp_send(gc, &dmss->qmp, "query-chardev", NULL); + rc = libxl__ev_qmp_send(egc, &dmss->qmp, "query-chardev", NULL); if (rc) goto out; return; } @@ -2879,7 +2879,7 @@ static void device_model_postconfig_chardev(libxl__egc *egc, } qmp->callback = device_model_postconfig_vnc; - rc = libxl__ev_qmp_send(gc, qmp, "query-vnc", NULL); + rc = libxl__ev_qmp_send(egc, qmp, "query-vnc", NULL); if (rc) goto out; return; @@ -2939,7 +2939,7 @@ static void device_model_postconfig_vnc(libxl__egc *egc, if (vnc && vnc->passwd) { qmp->callback = device_model_postconfig_vnc_passwd; libxl__qmp_param_add_string(gc, &args, "password", vnc->passwd); - rc = libxl__ev_qmp_send(gc, qmp, "change-vnc-password", args); + rc = libxl__ev_qmp_send(egc, qmp, "change-vnc-password", args); if (rc) goto out; return; } diff --git a/tools/libxl/libxl_dom_save.c b/tools/libxl/libxl_dom_save.c index e70aa1585976..65610e6055a7 100644 --- a/tools/libxl/libxl_dom_save.c +++ b/tools/libxl/libxl_dom_save.c @@ -226,7 +226,7 @@ static void domain_suspend_switch_qemu_xen_logdirty qmp->payload_fd = -1; qmp->callback = switch_qemu_xen_logdirty_done; libxl__qmp_param_add_bool(gc, &args, "enable", enable); - rc = libxl__ev_qmp_send(gc, qmp, "xen-set-global-dirty-log", args); + rc = libxl__ev_qmp_send(egc, qmp, "xen-set-global-dirty-log", args); if (rc) goto out; return; diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c index 248dbc33e384..940ac334f4b1 100644 --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -545,7 +545,7 @@ void libxl__dm_resume(libxl__egc *egc, qmp->domid = domid; qmp->callback = dm_resume_qmp_done; qmp->payload_fd = -1; - rc = libxl__ev_qmp_send(gc, qmp, "cont", NULL); + rc = libxl__ev_qmp_send(egc, qmp, "cont", NULL); if (rc) goto out; break; default: diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c index 84ebfcceb83e..723ad3bf8edb 100644 --- a/tools/libxl/libxl_domain.c +++ b/tools/libxl/libxl_domain.c @@ -1600,7 +1600,7 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, LIBXL_QMP_CMD_TIMEOUT * 1000); if (rc) goto out; qmp->callback = set_vcpuonline_qmp_cpus_queried; - rc = libxl__ev_qmp_send(gc, qmp, "query-cpus", NULL); + rc = libxl__ev_qmp_send(egc, qmp, "query-cpus", NULL); if (rc) goto out; return AO_INPROGRESS; default: @@ -1666,7 +1666,7 @@ static void set_vcpuonline_qmp_add_cpu(libxl__egc *egc, if (libxl_bitmap_test(map, svos->index)) { qmp->callback = set_vcpuonline_qmp_add_cpu; libxl__qmp_param_add_integer(gc, &args, "id", svos->index); - rc = libxl__ev_qmp_send(gc, qmp, "cpu-add", args); + rc = libxl__ev_qmp_send(egc, qmp, "cpu-add", args); if (rc) goto out; return; } @@ -1740,7 +1740,7 @@ static void domain_s3_resume(libxl__ao *ao, libxl__egc *egc, int domid) } break; case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: - rc = libxl__ev_qmp_send(gc, qmp, "system_wakeup", NULL); + rc = libxl__ev_qmp_send(egc, qmp, "system_wakeup", NULL); if (rc) goto out; return; default: @@ -1958,7 +1958,7 @@ static void retrieve_domain_configuration_lock_acquired( libxl_bitmap_alloc(CTX, &rdcs->qemuu_cpus, d_config->b_info.max_vcpus); rdcs->qmp.callback = retrieve_domain_configuration_cpu_queried; - rc = libxl__ev_qmp_send(gc, &rdcs->qmp, "query-cpus", NULL); + rc = libxl__ev_qmp_send(egc, &rdcs->qmp, "query-cpus", NULL); if (rc) goto out; has_callback = true; } diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 9b84dddd3b7d..f95895eae17d 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -472,7 +472,7 @@ typedef void libxl__ev_qmp_callback(libxl__egc *egc, libxl__ev_qmp *ev, int rc); _hidden void libxl__ev_qmp_init(libxl__ev_qmp *ev); -_hidden int libxl__ev_qmp_send(libxl__gc *gc, libxl__ev_qmp *ev, +_hidden int libxl__ev_qmp_send(libxl__egc *egc, libxl__ev_qmp *ev, const char *cmd, libxl__json_object *args); _hidden void libxl__ev_qmp_dispose(libxl__gc *gc, libxl__ev_qmp *ev); diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index b5444d15523a..0dc4a83e166d 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1163,7 +1163,7 @@ static void pci_add_qmp_device_add(libxl__egc *egc, pci_add_state *pas) qmp->domid = domid; qmp->payload_fd = -1; qmp->callback = pci_add_qmp_device_add_cb; - rc = libxl__ev_qmp_send(gc, qmp, "device_add", args); + rc = libxl__ev_qmp_send(egc, qmp, "device_add", args); if (rc) goto out; return; @@ -1182,7 +1182,7 @@ static void pci_add_qmp_device_add_cb(libxl__egc *egc, if (rc) goto out; qmp->callback = pci_add_qmp_query_pci_cb; - rc = libxl__ev_qmp_send(gc, qmp, "query-pci", NULL); + rc = libxl__ev_qmp_send(egc, qmp, "query-pci", NULL); if (rc) goto out; return; @@ -1997,7 +1997,7 @@ static void pci_remove_qmp_device_del(libxl__egc *egc, QMP_PARAMETERS_SPRINTF(&args, "id", PCI_PT_QDEV_ID, pcidev->bus, pcidev->dev, pcidev->func); prs->qmp.callback = pci_remove_qmp_device_del_cb; - rc = libxl__ev_qmp_send(gc, &prs->qmp, "device_del", args); + rc = libxl__ev_qmp_send(egc, &prs->qmp, "device_del", args); if (rc) goto out; return; @@ -2036,7 +2036,7 @@ static void pci_remove_qmp_retry_timer_cb(libxl__egc *egc, libxl__ev_time *ev, pci_remove_state *prs = CONTAINER_OF(ev, *prs, retry_timer); prs->qmp.callback = pci_remove_qmp_query_cb; - rc = libxl__ev_qmp_send(gc, &prs->qmp, "query-pci", NULL); + rc = libxl__ev_qmp_send(egc, &prs->qmp, "query-pci", NULL); if (rc) goto out; return; diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c index 9aabad74fabd..f0e0b50bd1c5 100644 --- a/tools/libxl/libxl_qmp.c +++ b/tools/libxl/libxl_qmp.c @@ -924,7 +924,7 @@ int libxl_qemu_monitor_command(libxl_ctx *ctx, uint32_t domid, qmcs->qmp.callback = qemu_monitor_command_done; qmcs->output = output; libxl__qmp_param_add_string(gc, &args, "command-line", command_line); - rc = libxl__ev_qmp_send(gc, &qmcs->qmp, "human-monitor-command", args); + rc = libxl__ev_qmp_send(egc, &qmcs->qmp, "human-monitor-command", args); out: if (rc) return AO_CREATE_FAIL(rc); return AO_INPROGRESS; @@ -978,7 +978,7 @@ void libxl__qmp_suspend_save(libxl__egc *egc, ev->callback = dm_stopped; ev->payload_fd = -1; - rc = libxl__ev_qmp_send(gc, ev, "stop", NULL); + rc = libxl__ev_qmp_send(egc, ev, "stop", NULL); if (rc) goto error; @@ -1007,7 +1007,7 @@ static void dm_stopped(libxl__egc *egc, libxl__ev_qmp *ev, } ev->callback = dm_state_fd_ready; - rc = libxl__ev_qmp_send(gc, ev, "add-fd", NULL); + rc = libxl__ev_qmp_send(egc, ev, "add-fd", NULL); if (rc) goto error; @@ -1052,7 +1052,7 @@ static void dm_state_fd_ready(libxl__egc *egc, libxl__ev_qmp *ev, if (qmp_ev_qemu_compare_version(ev, 2, 11, 0) >= 0) libxl__qmp_param_add_bool(gc, &args, "live", dsps->live); QMP_PARAMETERS_SPRINTF(&args, "filename", "/dev/fdset/%d", fdset); - rc = libxl__ev_qmp_send(gc, ev, "xen-save-devices-state", args); + rc = libxl__ev_qmp_send(egc, ev, "xen-save-devices-state", args); if (rc) goto error; @@ -1781,7 +1781,7 @@ void libxl__ev_qmp_init(libxl__ev_qmp *ev) ev->qemu_version.micro = -1; } -int libxl__ev_qmp_send(libxl__gc *unused_gc, libxl__ev_qmp *ev, +int libxl__ev_qmp_send(libxl__egc *egc, libxl__ev_qmp *ev, const char *cmd, libxl__json_object *args) /* disconnected -> connecting * connected -> waiting_reply (with msg set) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index 1fc7ccf41f86..da5e3708e6cf 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -349,9 +349,10 @@ static char *pvusb_get_device_type(libxl_usbctrl_type type) * - usb-ehci (version=2), always 6 ports * - nec-usb-xhci (version=3), up to 15 ports */ -static int libxl__device_usbctrl_add_hvm(libxl__gc *gc, libxl__ev_qmp *qmp, +static int libxl__device_usbctrl_add_hvm(libxl__egc *egc, libxl__ev_qmp *qmp, libxl_device_usbctrl *usbctrl) { + EGC_GC; libxl__json_object *qmp_args = NULL; switch (usbctrl->version) { @@ -378,26 +379,28 @@ static int libxl__device_usbctrl_add_hvm(libxl__gc *gc, libxl__ev_qmp *qmp, libxl__qmp_param_add_string(gc, &qmp_args, "id", GCSPRINTF("xenusb-%d", usbctrl->devid)); - return libxl__ev_qmp_send(gc, qmp, "device_add", qmp_args); + return libxl__ev_qmp_send(egc, qmp, "device_add", qmp_args); } /* Send qmp commands to delete a usb controller in qemu. */ -static int libxl__device_usbctrl_del_hvm(libxl__gc *gc, +static int libxl__device_usbctrl_del_hvm(libxl__egc *egc, libxl__ev_qmp *qmp, int devid) { + EGC_GC; libxl__json_object *qmp_args = NULL; libxl__qmp_param_add_string(gc, &qmp_args, "id", GCSPRINTF("xenusb-%d", devid)); - return libxl__ev_qmp_send(gc, qmp, "device_del", qmp_args); + return libxl__ev_qmp_send(egc, qmp, "device_del", qmp_args); } /* Send qmp commands to create a usb device in qemu. */ -static int libxl__device_usbdev_add_hvm(libxl__gc *gc, libxl__ev_qmp *qmp, +static int libxl__device_usbdev_add_hvm(libxl__egc *egc, libxl__ev_qmp *qmp, libxl_device_usbdev *usbdev) { + EGC_GC; libxl__json_object *qmp_args = NULL; libxl__qmp_param_add_string(gc, &qmp_args, "id", @@ -413,20 +416,21 @@ static int libxl__device_usbdev_add_hvm(libxl__gc *gc, libxl__ev_qmp *qmp, libxl__qmp_param_add_string(gc, &qmp_args, "hostaddr", GCSPRINTF("%d", usbdev->u.hostdev.hostaddr)); - return libxl__ev_qmp_send(gc, qmp, "device_add", qmp_args); + return libxl__ev_qmp_send(egc, qmp, "device_add", qmp_args); } /* Send qmp commands to delete a usb device in qemu. */ -static int libxl__device_usbdev_del_hvm(libxl__gc *gc, libxl__ev_qmp *qmp, +static int libxl__device_usbdev_del_hvm(libxl__egc *egc, libxl__ev_qmp *qmp, libxl_device_usbdev *usbdev) { + EGC_GC; libxl__json_object *qmp_args = NULL; libxl__qmp_param_add_string(gc, &qmp_args, "id", GCSPRINTF("xenusb-%d-%d", usbdev->u.hostdev.hostbus, usbdev->u.hostdev.hostaddr)); - return libxl__ev_qmp_send(gc, qmp, "device_del", qmp_args); + return libxl__ev_qmp_send(egc, qmp, "device_del", qmp_args); } static LIBXL_DEFINE_UPDATE_DEVID(usbctrl) @@ -490,7 +494,7 @@ static void libxl__device_usbctrl_add(libxl__egc *egc, uint32_t domid, qmp->domid = domid; qmp->payload_fd = -1; qmp->callback = device_usbctrl_add_qmp_cb; - rc = libxl__device_usbctrl_add_hvm(gc, qmp, usbctrl); + rc = libxl__device_usbctrl_add_hvm(egc, qmp, usbctrl); if (rc) goto outrm; return; } @@ -647,7 +651,7 @@ static void device_usbctrl_usbdevs_removed(libxl__egc *egc, qmp->domid = aodev->dev->domid; qmp->callback = device_usbctrl_remove_qmp_cb; qmp->payload_fd = -1; - rc = libxl__device_usbctrl_del_hvm(gc, qmp, aodev->dev->devid); + rc = libxl__device_usbctrl_del_hvm(egc, qmp, aodev->dev->devid); if (rc) goto out; return; } @@ -1797,7 +1801,7 @@ static void libxl__device_usbdev_add(libxl__egc *egc, uint32_t domid, aodev->qmp.domid = domid; aodev->qmp.callback = device_usbdev_add_qmp_cb; aodev->qmp.payload_fd = -1; - rc = libxl__device_usbdev_add_hvm(gc, &aodev->qmp, usbdev); + rc = libxl__device_usbdev_add_hvm(egc, &aodev->qmp, usbdev); if (rc) { libxl__device_usbdev_remove_xenstore(gc, domid, usbdev, LIBXL_USBCTRL_TYPE_DEVICEMODEL); @@ -1979,7 +1983,7 @@ static void libxl__device_usbdev_remove(libxl__egc *egc, uint32_t domid, aodev->qmp.domid = domid; aodev->qmp.callback = device_usbdev_remove_qmp_cb; aodev->qmp.payload_fd = -1; - rc = libxl__device_usbdev_del_hvm(gc, &aodev->qmp, usbdev); + rc = libxl__device_usbdev_del_hvm(egc, &aodev->qmp, usbdev); if (rc) { libxl__device_usbdev_add_xenstore(gc, domid, usbdev, LIBXL_USBCTRL_TYPE_DEVICEMODEL,