From nobody Thu Jan 26 18:54:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P2qcz6TzFz3bPVP; Thu, 26 Jan 2023 18:54:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P2qcz5cpBz463t; Thu, 26 Jan 2023 18:54:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674759267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUK4I4k3G8zRZsf3lKUYJaVgQosAocMJ8gRaI2xPvR8=; b=GlvRxtmcD86yETwroZn/NhEa3P+iuC+kg6UFMbUl7t/ysRtVXfTVfCiSufziCwL+HWlLZM 3sSAvBOakyYWEn/U01X2Q2TPPmz1f7IUvp7Rgw6RJtrihlP2UOMXWQPurGfMtA3GjEV8mI m6voFyRmXEQWDijYYrGQv2yt3rHr82uv3AAdBKLc/RGWHVX3bAzYr4wZfHRzRrkY5kf1y2 ts+M0jNSMcLs7HKhJdXHjhk/GQdDPVCToMBvMQcog3//ggW1J0lphLBFoENow0unxaP+KF Vg4I7Aa7NZM5Jhk4H0VQFzOUGje2dEzoQR6aRebyoyN2xteRzPbYa5B5oKLTXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674759267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUK4I4k3G8zRZsf3lKUYJaVgQosAocMJ8gRaI2xPvR8=; b=lkYr/1IRxCUjoakxSoVUDcdKEGS/UzWE8TYo9cFxWzqLuJX00BVGqexKMO0qzGquPh6Kfu c/Nfi2ehR1NIYNfu4ynCo5bv3aQ6849wNbtxNon4DVE/Qzi8Jk9OlyCPnUvQwfQ8FgUA94 4btzoSy78gRLBrYXYMLRg673QKJuE+9ab/lsdInvFnhD8OfF4slrHhojCm6dxz0pfBDG1D M1DrZGcTLjY5s2iSoifpMBG7IqUxtb4DfahSRR7VlLnUavvfM7gBYQ6Wcu7YOcn/kWC+cD LBfddcCxcw2Ju2liiskUTtAGs5WV5NExsyRed38nXKUafgmmR5fj+okQtY6uBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674759267; a=rsa-sha256; cv=none; b=exp1h2caNT1jK6ah+oc3TIdx7uSy81bvbN7aeLmRirVq11MekTt8arlBaD6yCgUIqPKoIR wcraTNEyxxWwfmthWFris/xHSr8PSsk7hfOJFWZjhBRCIlCV2uUl9+jMwDOoCCGe/fH1VD j9Geqa4zh3lw1CJ+hZEPwcAgdb1z4YideQb+KBVewRRAEfca/DkvantKP8LzCBc7koMHC9 HgoOwwTL2QugxJi3vMr1yg59O44OZf3Mg4FmykxLnU+uTDI8C7klJC6SAnq7FNnRB8B+K9 BetATw7iJ8BDJi+aYislcQXi9yE6ndF2W7C/Aj/Buh5rkBMI+I7oxzvxQXewyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P2qcz4gkKzgKx; Thu, 26 Jan 2023 18:54:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30QIsRPB034244; Thu, 26 Jan 2023 18:54:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30QIsRUX034243; Thu, 26 Jan 2023 18:54:27 GMT (envelope-from git) Date: Thu, 26 Jan 2023 18:54:27 GMT Message-Id: <202301261854.30QIsRUX034243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a71480028333 - stable/13 - bhyvectl: drop vm_get_name() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7148002833387848a707b77f2ef2ea3dbece09c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a7148002833387848a707b77f2ef2ea3dbece09c commit a7148002833387848a707b77f2ef2ea3dbece09c Author: Robert Wing AuthorDate: 2022-03-18 05:22:43 +0000 Commit: John Baldwin CommitDate: 2023-01-26 18:48:24 +0000 bhyvectl: drop vm_get_name() Grab the vm name from bhyvectl's --vm flag instead. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D34399 (cherry picked from commit ee0ebaa42028aee9886e06b6b995c8b2389e89f4) --- usr.sbin/bhyvectl/bhyvectl.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 0480e1623621..e4de6da1803c 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1684,11 +1684,10 @@ show_memseg(struct vmctx *ctx) #ifdef BHYVE_SNAPSHOT static int -send_message(struct vmctx *ctx, nvlist_t *nvl) +send_message(const char *vmname, nvlist_t *nvl) { struct sockaddr_un addr; int err, socket_fd; - char vmname_buf[MAX_VMNAME]; socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0); if (socket_fd < 0) { @@ -1700,13 +1699,7 @@ send_message(struct vmctx *ctx, nvlist_t *nvl) memset(&addr, 0, sizeof(struct sockaddr_un)); addr.sun_family = AF_UNIX; - err = vm_get_name(ctx, vmname_buf, MAX_VMNAME - 1); - if (err != 0) { - perror("Failed to get VM name"); - goto done; - } - - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s%s", BHYVE_RUN_DIR, vmname_buf); + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s%s", BHYVE_RUN_DIR, vmname); if (connect(socket_fd, (struct sockaddr *)&addr, SUN_LEN(&addr)) != 0) { perror("connect() failed"); @@ -1725,7 +1718,7 @@ done: } static int -snapshot_request(struct vmctx *ctx, const char *file, bool suspend) +snapshot_request(const char *vmname, const char *file, bool suspend) { nvlist_t *nvl; @@ -1734,7 +1727,7 @@ snapshot_request(struct vmctx *ctx, const char *file, bool suspend) nvlist_add_string(nvl, "filename", file); nvlist_add_bool(nvl, "suspend", suspend); - return (send_message(ctx, nvl)); + return (send_message(vmname, nvl)); } #endif @@ -2398,10 +2391,10 @@ main(int argc, char *argv[]) #ifdef BHYVE_SNAPSHOT if (!error && vm_checkpoint_opt) - error = snapshot_request(ctx, checkpoint_file, false); + error = snapshot_request(vmname, checkpoint_file, false); if (!error && vm_suspend_opt) - error = snapshot_request(ctx, suspend_file, true); + error = snapshot_request(vmname, suspend_file, true); #endif free (opts);