From nobody Fri Aug 18 07:18:44 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 4RRtX53MGVz4qph6; Fri, 18 Aug 2023 07:18:45 +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 4RRtX51gS9z4dl7; Fri, 18 Aug 2023 07:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692343125; 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=d9JJRb+rz9swNBWwVN6cy7sl6nZOmsnZwQhcolxynt4=; b=wZBZ0dR3FVeQV0b3+bI+1IZewD1jum5bLOdgpgYvWCt8tLXdAxWDlonsBfJ5KcDQmLDLAj m1IGfpDzH0JC9JTbK5xBV4BLOsADy6zt3QrCXW0Yvg5FYfkxdWNkBqAz5id3SgNxSpXTnb j/GJ+5JHDG7WpyJh6GpM7h2XonPK31YZ9rvRI6ECWt7ckefYy052tdwJvj+NGxaF40zOzw 3NNbgO2dksfrpSRbMcLoVAX/lYZfe1Us6pz1iGMSrztKxwsWh/55TIDuIH3hGCQRY1zGlD 1RK1dufwqs980sHZNhfxbsRTAC2/hUFlG9OmnJcBPZmRQPuuYVJHiMIBw0W11w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692343125; 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=d9JJRb+rz9swNBWwVN6cy7sl6nZOmsnZwQhcolxynt4=; b=mLkgr53yyxka3fvNTXiNTZWggNajHfh7FiMEhK/OggoI3T6xk9blUdzJt+MFqoc8qT2tqC S7W+A/8FxAGcslF6uC7ngWDqOtmgiCdMauTjQtpiqBjDU+qDra5uvMH7GnUok4IakvXh+a RsKvJLeA7MXrBRyuBSOHN9ci7WnC2MrjtWiOCLqeXKr+Ih7Y2/gAuiodAAx3XBWiV9QPSJ s7D7EYc+YntaCwwzt1nIsddh8JdA7KKQC9be294PeBQ1HZnaexkbT+GdNmxXgh8ZvyW7Dx 7qRZqtYpcr7e3uttAYw6RELvIJtIDTJo79lKetuHmCp984W7aplUhyIhitOv4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692343125; a=rsa-sha256; cv=none; b=mLSGRZhMlqQzUz/NZahl5dI/YcgdUE6jJPTZgmxL09pEh9Cw1cNtQtRaleaj6H36L3NRA5 bBAtxSN9t46rqQd+UjnpFypGXPp6K0qwl7/rDrPDxnRyyRtygIIjmWqY8xd5wsPOIqHbNF q5UNGePeMp478OBOzLOWqIDXry4R/8krs9Gscp46z4L4b0V/qSgAoNSH3bWajxaoXRkvwp pil1TGc4p5MV3/5NGP6Q3Mu7rzLKc3gLTcE3JIuRhoIBq9yLwh+FR5eBApMWi6JtOnXG0v iQsbJ3MZEE8iaFXG1SFrNn/1XxPQMloKBLSeUWXta83b2fIObyQWW2Lxf2KFlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RRtX46dkhz16gx; Fri, 18 Aug 2023 07:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37I7IiN2017546; Fri, 18 Aug 2023 07:18:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37I7IiWT017543; Fri, 18 Aug 2023 07:18:44 GMT (envelope-from git) Date: Fri, 18 Aug 2023 07:18:44 GMT Message-Id: <202308180718.37I7IiWT017543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Corvin =?utf-8?Q?K=C3=B6hne?= Subject: git: 5573404166b0 - stable/13 - bhyve: rename 'user_dev' with 'devices' 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5573404166b090ccf8556888efd9657657b54032 Auto-Submitted: auto-generated The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=5573404166b090ccf8556888efd9657657b54032 commit 5573404166b090ccf8556888efd9657657b54032 Author: Vitaliy Gusev AuthorDate: 2023-05-15 14:28:14 +0000 Commit: Corvin Köhne CommitDate: 2023-08-18 07:04:25 +0000 bhyve: rename 'user_dev' with 'devices' Bhyve don't use 'user' specifier for emulated devices. And using 'user' adds duality. Reviewed by: corvink, rew MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D40106 (cherry picked from commit b10d65a420f068bccf6aaf2942157a5347211dc5) --- usr.sbin/bhyve/bhyverun.c | 6 +++--- usr.sbin/bhyve/snapshot.c | 23 +++++++++++------------ usr.sbin/bhyve/snapshot.h | 6 +++--- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 63ca9439d6e6..4db8274335cd 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1520,7 +1520,7 @@ main(int argc, char *argv[]) #ifdef BHYVE_SNAPSHOT if (restore_file != NULL) { fprintf(stdout, "Pausing pci devs...\r\n"); - if (vm_pause_user_devs() != 0) { + if (vm_pause_devices() != 0) { fprintf(stderr, "Failed to pause PCI device state.\n"); exit(1); } @@ -1532,7 +1532,7 @@ main(int argc, char *argv[]) } fprintf(stdout, "Restoring pci devs...\r\n"); - if (vm_restore_user_devs(ctx, &rstate) != 0) { + if (vm_restore_devices(ctx, &rstate) != 0) { fprintf(stderr, "Failed to restore PCI device state.\n"); exit(1); } @@ -1544,7 +1544,7 @@ main(int argc, char *argv[]) } fprintf(stdout, "Resuming pci devs...\r\n"); - if (vm_resume_user_devs() != 0) { + if (vm_resume_devices() != 0) { fprintf(stderr, "Failed to resume PCI device state.\n"); exit(1); } diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index 5f9ef2053990..451839944bd6 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -926,7 +926,7 @@ vm_restore_kern_structs(struct vmctx *ctx, struct restore_state *rstate) } static int -vm_restore_user_dev(struct vmctx *ctx, struct restore_state *rstate, +vm_restore_device(struct vmctx *ctx, struct restore_state *rstate, const struct vm_snapshot_dev_info *info) { void *dev_ptr; @@ -971,15 +971,14 @@ vm_restore_user_dev(struct vmctx *ctx, struct restore_state *rstate, return (0); } - int -vm_restore_user_devs(struct vmctx *ctx, struct restore_state *rstate) +vm_restore_devices(struct vmctx *ctx, struct restore_state *rstate) { size_t i; int ret; for (i = 0; i < nitems(snapshot_devs); i++) { - ret = vm_restore_user_dev(ctx, rstate, &snapshot_devs[i]); + ret = vm_restore_device(ctx, rstate, &snapshot_devs[i]); if (ret != 0) return (ret); } @@ -988,7 +987,7 @@ vm_restore_user_devs(struct vmctx *ctx, struct restore_state *rstate) } int -vm_pause_user_devs(void) +vm_pause_devices(void) { const struct vm_snapshot_dev_info *info; size_t i; @@ -1008,7 +1007,7 @@ vm_pause_user_devs(void) } int -vm_resume_user_devs(void) +vm_resume_devices(void) { const struct vm_snapshot_dev_info *info; size_t i; @@ -1163,7 +1162,7 @@ vm_snapshot_dev_write_data(int data_fd, xo_handle_t *xop, const char *array_key, } static int -vm_snapshot_user_dev(const struct vm_snapshot_dev_info *info, +vm_snapshot_device(const struct vm_snapshot_dev_info *info, int data_fd, xo_handle_t *xop, struct vm_snapshot_meta *meta, off_t *offset) { @@ -1185,7 +1184,7 @@ vm_snapshot_user_dev(const struct vm_snapshot_dev_info *info, } static int -vm_snapshot_user_devs(struct vmctx *ctx, int data_fd, xo_handle_t *xop) +vm_snapshot_devices(struct vmctx *ctx, int data_fd, xo_handle_t *xop) { int ret; off_t offset; @@ -1227,7 +1226,7 @@ vm_snapshot_user_devs(struct vmctx *ctx, int data_fd, xo_handle_t *xop) meta->buffer.buf = meta->buffer.buf_start; meta->buffer.buf_rem = meta->buffer.buf_size; - ret = vm_snapshot_user_dev(&snapshot_devs[i], data_fd, xop, + ret = vm_snapshot_device(&snapshot_devs[i], data_fd, xop, meta, &offset); if (ret != 0) goto snapshot_err; @@ -1365,7 +1364,7 @@ vm_checkpoint(struct vmctx *ctx, const char *checkpoint_file, bool stop_vm) vm_vcpu_pause(ctx); - ret = vm_pause_user_devs(); + ret = vm_pause_devices(); if (ret != 0) { fprintf(stderr, "Could not pause devices\r\n"); error = ret; @@ -1394,7 +1393,7 @@ vm_checkpoint(struct vmctx *ctx, const char *checkpoint_file, bool stop_vm) goto done; } - ret = vm_snapshot_user_devs(ctx, kdata_fd, xop); + ret = vm_snapshot_devices(ctx, kdata_fd, xop); if (ret != 0) { fprintf(stderr, "Failed to snapshot device state.\n"); error = -1; @@ -1409,7 +1408,7 @@ vm_checkpoint(struct vmctx *ctx, const char *checkpoint_file, bool stop_vm) } done: - ret = vm_resume_user_devs(); + ret = vm_resume_devices(); if (ret != 0) fprintf(stderr, "Could not resume devices\r\n"); vm_vcpu_resume(ctx); diff --git a/usr.sbin/bhyve/snapshot.h b/usr.sbin/bhyve/snapshot.h index 9bf881fded92..5f98be875544 100644 --- a/usr.sbin/bhyve/snapshot.h +++ b/usr.sbin/bhyve/snapshot.h @@ -95,9 +95,9 @@ void checkpoint_cpu_suspend(int vcpu); int restore_vm_mem(struct vmctx *ctx, struct restore_state *rstate); int vm_restore_kern_structs(struct vmctx *ctx, struct restore_state *rstate); -int vm_restore_user_devs(struct vmctx *ctx, struct restore_state *rstate); -int vm_pause_user_devs(void); -int vm_resume_user_devs(void); +int vm_restore_devices(struct vmctx *ctx, struct restore_state *rstate); +int vm_pause_devices(void); +int vm_resume_devices(void); int get_checkpoint_msg(int conn_fd, struct vmctx *ctx); void *checkpoint_thread(void *param);