From patchwork Fri Jul 21 14:49:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B566EB64DC for ; Fri, 21 Jul 2023 14:50:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRo-0002uH-7D; Fri, 21 Jul 2023 10:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMrRi-0002iB-UZ for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:31 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMrRh-0004lx-0N for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:30 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36LBo1b4027837; Fri, 21 Jul 2023 07:49:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=Lu7RYOYUT7ZvuwWWjZLt5SHjd1hMIBqQ7OkfsG 17fWw=; b=UtK+Nej4bvtZTPdUx9b3qIMHFJZYN91ybk2jbtUvWQ11Rn1SqE1Atm d94u1I+1UzPPkI8+5w6sQGM7QrTNhaC5a44jRHYPHCC/tv/+go0V23/ebhI/dox6 YGhB+AGmoJpeCArwNd7v1i36c2OSLKUACkEYokFN5vzUT83gWiHvJ/Tn3EFodxFj 2Bytu33+zKww9bBxTM2hJRB18qg23qvg831Vkln0/uky488QCGCT8WQK+zuU/8pG 6uoIJ7XqcBpkAUbBoPesk5bUZ+QdK7fTj3NQAfnUdp8IHU9WCEBEO+VMeQiHNwa7 AUB5X3SRtKNSf0Q+2QCpIqkMD74YTDmA== Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx319phvh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8yXIdo3kE6yWzHrvIuat6cgY/aZsTt1fjLwgLMhupnNE8qeGZagJGx8uUcm0hVsqnjW6gqHQeWwJaWK89+R1EUGme8hkMQYF0tkh0IOLdKGYCApSlfRhJOEVrrrst7vbjedHcItTg5OQgBTNoCuK7A6aloutX8x+/15lJodFGCMD9ZrrGbdMk91gqs4/DDp01M1M2tuhr4exh4SmR59XU0vHovDAJFTYrowhU/vdP525lmeL9iZ0W52gL4rRQ+GUC63pgWlY5Qr5/Oqgyu+TWUr41UOH1wNERgsHKukX7kIrTtUbzgPuPfseuUmJx7afsNWpKZZE0Nazbkk3/SXmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lu7RYOYUT7ZvuwWWjZLt5SHjd1hMIBqQ7OkfsG17fWw=; b=Z+1lenhbMQhHHOA4eQILGTFL0h4V0l3a/IfQKY7n65cTP4NxE8iqFXPVP2hP8Nq6D3WtHZVg6hLOTaepA8QC5rhXbMndn78imz8vR8YvyUPyJXzynJEGygBirDKsVo0saw+2jjGKiNhvnodFiT06mMqad1oYbFottbQlRJk9gDWsFR0d3ZV/VkRlvnicAOvkiXk2GE6yAGlB6+P1TLJSFxl8rD8mSeMa10tdypOcu9zXLusvIl6osETD2Rol/znlTUnoJWHLUDm3B4PDjIdsvxZ3wyKElqciTYfHOTJRH3vDDaACE8nTt1ccvLW7oPDnqTHKiswpOz8wQDx5BCsesA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lu7RYOYUT7ZvuwWWjZLt5SHjd1hMIBqQ7OkfsG17fWw=; b=ROhFHWDa7ygA6zsEiRR2kowdyEMAtokKkXh73/Ve8DTRgsbY2qqUN88M/cFhWVA8s0p8YRg+Dlko+WpC+Id71IezdqV5XxqsJghGzRGAhctOZvuFJhdleQOew+03wzi/jugbc5ew59y4ocnBvGwXmNb0WeU0mTj1dI1UWQVpV4PmqB/H8AcTDcrjudnsZZk7PTeRKwm0n3keENJbnWxj1ubC54OzbN75392V63+1LJk8gdzGN1oA9yFCGnnm82Qqt32OM6XYG2fIVbG3+WVeehX0jdtqvR6GiJbxx5zFk3umh64z9O6PH3bP61nBXgziR8F44+2JZbcg8OOUyEVxuQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:26 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::89a1:d75c:813:618e]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::89a1:d75c:813:618e%7]) with mapi id 15.20.6609.022; Fri, 21 Jul 2023 14:49:26 +0000 From: Het Gala To: "qemu-devel@nongnu.org" CC: Prerna Saxena , "quintela@redhat.com" , "dgilbert@redhat.com" , "pbonzini@redhat.com" , "berrange@redhat.com" , "armbru@redhat.com" , "eblake@redhat.com" , Manish Mishra , Aravind Retnakaran , Het Gala Subject: [PATCH v9 03/10] migration: convert socket backend to accept MigrateAddress Thread-Topic: [PATCH v9 03/10] migration: convert socket backend to accept MigrateAddress Thread-Index: Adm74otwXZ11rOI+JUiscwI+vxTRZw== Date: Fri, 21 Jul 2023 14:49:26 +0000 Message-ID: <20230721144914.170991-4-het.gala@nutanix.com> References: <20230721144914.170991-1-het.gala@nutanix.com> In-Reply-To: <20230721144914.170991-1-het.gala@nutanix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PH0P220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::17) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR02MB4343:EE_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: fc5cd793-bacc-4e0b-c07c-08db89f9adf6 x-proofpoint-crosstenant: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: r6eo9cKCwV55kckO2q9SR9VegOlrq3PNgSq08cghPjUFg9AQ3cNDWXoCfaEK2mkQaa5RG2NUCiWmILZ8nglk9O+kKJOfvAd2dlFxYjxm+hjkqFk9oS4iLipdYDwk4WmzMR2HjcleJbbQI8XlU33mAGdmaqAsn1gEGV4qb7Y/8hvJ+2YBEsztzJpR/x5Iz1nKQP2Sj8CCQ+HAT3xqI8UmtKNGi15dTZ4I+gUKGhnX7U8ypEEAwElizj+6qiTnCI3a8wNuv6hQATnXo8jxAwGhxYaEzIVBOFYmmq/hmWdKg4OX7AhFuStbISFPfLCBw0KLJ1FYNorjQWRWbK8ZNGWtRGxeFU2oSGR4W2rtUX38RVmmTqOwKMQQoIj7e4YOj9g69noEfIxqRq6ViYycqIBDMwuUFgHU2waNHwRm8nTN728FE5SymOEYey1acHkz3gy1nj/V3yYdjUe/UZbCvRC04TcMTfwgoM3vL/OgbKxE/vjJC9EVOODYFeYfn3gB17ceQCCU+8a4hdHRbixoVZ/GIZdl4eJQ/OXYSjb70PrMFmli5JTIwk8XE6bCDsZ0Sveq9ghICdHA3dHECHVJi0XH1240xTguX+kNRDeeTHXgH/NAud8o2YEYKuzLqDX7wSUY x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?PaGE1o02kgWTohXV0h3tpDS6Jop/?= =?utf-8?q?3fFWZx5LaNMHnYAlLj/t0US35w+kgTKCUrnEje+aHOg2wKyuis5tqhz+4qztvKfqc?= =?utf-8?q?Nu2KUEDBs4kCG3a0meMiYMWHsvgNa/B7+i/OMRCVaeBEEiYasmc9tjkY7zaMBWSSm?= =?utf-8?q?jOnCjnByGS5F7p/FHrR6XOEAzkEu3KLRHuIvZxg7/MmRU7mOC9HKu9iWcNc34920B?= =?utf-8?q?QUrDyYXLg73rvp70lt6bOnD7roFeUuZ7k3h4z9msXLO4uX8HDzdcLdRXuHY0nTdGF?= =?utf-8?q?xmdWJjnJj3zQ4Hx9fN7dwYo3w90ix7lc6kChMT3FZfcNWbIoJuIjRq+RROnhjxhfB?= =?utf-8?q?m36tk2UMKWaDhgdR1oG0/rhpNZ1KV+IBZ+kHowJT2Flmj+oBJgXiQ8oGSwwqvQGWl?= =?utf-8?q?UD/hlUXPFxPL4fK1/0fxXZR4TIKqf8/vrschTOPWeA3vHlTLpzMDiOM7H5HWwzjzM?= =?utf-8?q?bvvIYUd90Ur1j55DyhxQI0IBmSOCsT2L4f7BF5hMDoL0dRf0W7QmLpH9TSInWgAJg?= =?utf-8?q?SUAdoYCtkOhLs2KxYJMyJcoW/KXaBPYqwRmAkuEXko8GxhTRIhjtUc69KkcsDOJEt?= =?utf-8?q?e54U4SlBOjKw+ahGYKBeIE0f5WlSccMz8hlNWt09jLxrr6HEtlbqGxlgdPgi6oRWJ?= =?utf-8?q?O4bqOKDe2Nrr5EvYdKV/0S/spcxBZZ/PsjSsEFzNKEj6udWOkyEbfI6r4JnqP1bKK?= =?utf-8?q?BgG6MLrgh18eEb0D8rK7Y/qCUcWp2H//veiQw9gLCaQKseV3TeG1GLOfsahJhvwmS?= =?utf-8?q?3am6wRC3gpa1DsocmW4JBubfw9URZFzk5tHIKVmi3h+Agm3V1aR8DYq9BhGwdd+0t?= =?utf-8?q?FQYBiiyejJzrlkvZYeVkNmTe/JmeoazicRZ3SxkKWRuFipvwk1xYjZv4w40pZ/iy8?= =?utf-8?q?A5MKYAW47YvqQo+QrXwRQtQtPYyhQsR+zLtGsBFsfPiQgEZAQEcom+uXjsaktDBCx?= =?utf-8?q?a20dddxwDT+x18LJBe0Feewgw8rt0TyUzwwfNyYYUYJTn//ARCz0JA4kTOogaRt+Q?= =?utf-8?q?x3xwwbDbaBsDtEiWn+crHkKKKMXCZ59O2e6uT5J24lVpRhO9wvpxcI2q4jYpGPnhT?= =?utf-8?q?iZxplRR/AVBlNfHYVu6r8TOxdfIRJdPScv70oOC7+pF3xxoGF9/qD2d2c52JUPHvQ?= =?utf-8?q?j2sMMs+DEuu3UZHlNnIUeB+WdpgKjh/u+p61FE9azljWi4w4JnQOtNcbFR15nIdKO?= =?utf-8?q?Ce7gz/EG3uVmNL4VDPuAZPywOKg/xXEP2jJcesKGr6adQCWIc/ZofuTb3IusxjrY0?= =?utf-8?q?zvRfFOtUwbe2bo1dNvTHysbmsOmuW6HNC5mWAlBw45PTxGoJUDSq7Rcc7cGOcuAcb?= =?utf-8?q?PtlnWUw9+mVgTHDnbm8Y8uwYC6SyE/qxVtNE85z/2jGi7w9x7pQ6f3SDxgU4Kg8hY?= =?utf-8?q?jdzpVfk0UpNVTZZpd1mY1SkFNnqHOVdAT+zZw+3zvQInz5bW0jxl+NgINX0btPQKy?= =?utf-8?q?/Z2wbsT2J6Km7XInxsXsqtrSlNCs+QxLn9EvHpaM0hEKmongT6LmDIh9aO8WXZMfC?= =?utf-8?q?3ZVHbOKY6VBLUX/OpcnBPdnkQVk7AvZqIg=3D=3D?= Content-ID: <61B72B5CAAA5FB44B75FE0B491C6851B@namprd02.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc5cd793-bacc-4e0b-c07c-08db89f9adf6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:26.0922 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Y3iggOamZPegcXVBi1mIdJKFrXi8Zjg+drEAlvZkC+EV6Yj3Brd3rZ1Ocu85NOAOOv1aXasgIpWBHwmBh7yM3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-GUID: 8deqt2Oi2SriADX8o2GrnWFpkZqAtU6O X-Proofpoint-ORIG-GUID: 8deqt2Oi2SriADX8o2GrnWFpkZqAtU6O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_09,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Socket transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for socket connection into well defined SocketAddress struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 30 ++++++++++++++++++------------ migration/socket.c | 39 +++++++++------------------------------ migration/socket.h | 7 ++++--- 3 files changed, 31 insertions(+), 45 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5b3be767f0..c4bcf8bbd7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -481,18 +481,21 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) } qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_incoming_migration(p ? p : uri, errp); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_incoming_migration(saddr, errp); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_incoming_migration(saddr->u.fd.str, errp); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_incoming_migration(p, errp); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_incoming_migration(p, errp); - } else if (strstart(uri, "fd:", &p)) { - fd_start_incoming_migration(p, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1715,18 +1718,21 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } } - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_outgoing_migration(s, p ? p : uri, &local_err); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_outgoing_migration(s, saddr, &local_err); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_outgoing_migration(s, p, &local_err); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); - } else if (strstart(uri, "fd:", &p)) { - fd_start_outgoing_migration(s, p, &local_err); } else { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); diff --git a/migration/socket.c b/migration/socket.c index 1b6f5baefb..98e3ea1514 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -28,6 +28,8 @@ #include "trace.h" #include "postcopy-ram.h" #include "options.h" +#include "qapi/clone-visitor.h" +#include "qapi/qapi-visit-sockets.h" struct SocketOutgoingArgs { SocketAddress *saddr; @@ -108,19 +110,19 @@ out: object_unref(OBJECT(sioc)); } -static void -socket_start_outgoing_migration_internal(MigrationState *s, - SocketAddress *saddr, - Error **errp) +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, + Error **errp) { QIOChannelSocket *sioc = qio_channel_socket_new(); struct SocketConnectData *data = g_new0(struct SocketConnectData, 1); + SocketAddress *addr = QAPI_CLONE(SocketAddress, saddr); data->s = s; /* in case previous migration leaked it */ qapi_free_SocketAddress(outgoing_args.saddr); - outgoing_args.saddr = saddr; + outgoing_args.saddr = addr; if (saddr->type == SOCKET_ADDRESS_TYPE_INET) { data->hostname = g_strdup(saddr->u.inet.host); @@ -135,18 +137,6 @@ socket_start_outgoing_migration_internal(MigrationState *s, NULL); } -void socket_start_outgoing_migration(MigrationState *s, - const char *str, - Error **errp) -{ - Error *err = NULL; - SocketAddress *saddr = socket_parse(str, &err); - if (!err) { - socket_start_outgoing_migration_internal(s, saddr, &err); - } - error_propagate(errp, err); -} - static void socket_accept_incoming_migration(QIONetListener *listener, QIOChannelSocket *cioc, gpointer opaque) @@ -172,9 +162,8 @@ socket_incoming_migration_end(void *opaque) object_unref(OBJECT(listener)); } -static void -socket_start_incoming_migration_internal(SocketAddress *saddr, - Error **errp) +void socket_start_incoming_migration(SocketAddress *saddr, + Error **errp) { QIONetListener *listener = qio_net_listener_new(); MigrationIncomingState *mis = migration_incoming_get_current(); @@ -213,13 +202,3 @@ socket_start_incoming_migration_internal(SocketAddress *saddr, } } -void socket_start_incoming_migration(const char *str, Error **errp) -{ - Error *err = NULL; - SocketAddress *saddr = socket_parse(str, &err); - if (!err) { - socket_start_incoming_migration_internal(saddr, &err); - } - qapi_free_SocketAddress(saddr); - error_propagate(errp, err); -} diff --git a/migration/socket.h b/migration/socket.h index dc54df4e6c..5e4c33b8ea 100644 --- a/migration/socket.h +++ b/migration/socket.h @@ -19,13 +19,14 @@ #include "io/channel.h" #include "io/task.h" +#include "qemu/sockets.h" void socket_send_channel_create(QIOTaskFunc f, void *data); QIOChannel *socket_send_channel_create_sync(Error **errp); int socket_send_channel_destroy(QIOChannel *send); -void socket_start_incoming_migration(const char *str, Error **errp); +void socket_start_incoming_migration(SocketAddress *saddr, Error **errp); -void socket_start_outgoing_migration(MigrationState *s, const char *str, - Error **errp); +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, Error **errp); #endif