From nobody Mon Jun 19 05:57:59 2023 X-Original-To: dev-commits-src-main@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 4QkzZb54mFz4fCY0; Mon, 19 Jun 2023 05:57:59 +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 4QkzZb3Zy4z4KPJ; Mon, 19 Jun 2023 05:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687154279; 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=5k1oRoM+5kRTtn4r2nZk2fAIQanUZI+/hUc56fItGGY=; b=orCO68/PRVv4rIY5I4LDUdS8FED8cIfFJaLuQW/sgPs5qFKwK7mg98YsFf8stIL2I6vBhg TqXpIRPLvLavOf3EytFNUxngwwCHkQUJZT5nXQNeDzrrFo7yDW1xwRjj1XhiNLb16omAG3 WOX1EKb/XRqSYQ9sTm/TETaKTjaWl2YRD/wVm44tHdXmxr1iZ3B0VLV4sdinQELbwKtAcT TtZaXdkOLXpwLzBoBHMuEKhDi8q98FUAxBgdzuUWZNTGU+51wV2bDvzWfskfhA5QPpmDm8 JfURj/7yNxOGp6hMtEOOSEdOrPr418458Rc2I770ku36ViKoyt4JZqbF3dkB6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687154279; 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=5k1oRoM+5kRTtn4r2nZk2fAIQanUZI+/hUc56fItGGY=; b=aPsOLwVzbTlUfGwhzh2ln77QOVuExFvXd+7v/R2CPiz06qoN/zwDAChzf2Lzn8Q/1+/Wfs Anl4rgtiHd5lrVlq6fbNKyUitYVP1w1v+59iRxJf7+LA46E6TnJaBHiCIi4XD2d2vGWygS 4Z6qDVb1ObqTF+O4WLla8zJwTNbHM4/tZ8vvTDXA0yJyawHaznVNxX7RNlbwlPB6sO6Ev6 RvGlLt3xiFEisfcTFi36S3k53aWi08VTIZSkGyi/MHIGWYrOUZFhlmUorYSpRmXFUCxNFH w45eN6LFvdtqToUBV+BfyVWWHboLsNUY8+GEK4fPNf6YWqyg5XnnFD3HGEUsxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687154279; a=rsa-sha256; cv=none; b=xaq32jlk9AdGWG7yzyOi0a+/T8Fd3XdAP0wEwgmp7c7j2bmtZw0GfEMd2qjsNxynTLQvBK /5a6Rt+DRTDZpX1LHWslXANr0cmGXRfrTZsNPiRcSlmssWN6iM3SiZHwnR/YJY/gmPh7Oi pAiHaIHNl+Ljijd94oA3f3YmOSpoFI+7XEHt/+TneMFABwbbbyHkKwduENGKPytxt9PvIO 8J5phXeo7L3v8bONmycEWwC7pXbtcMwWeTFn0eAilXiMp+XFbjIZX4Z/gCx2Xb6XB15HWG 8KDLzkVm74MOkyeUL7/bepkCbv1HHym+7RbQIw6fYn5dtDWXpv+i0gWdKUtnXg== 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 4QkzZb1zYtz15S6; Mon, 19 Jun 2023 05:57:59 +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 35J5vxpI025991; Mon, 19 Jun 2023 05:57:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35J5vxCN025990; Mon, 19 Jun 2023 05:57:59 GMT (envelope-from git) Date: Mon, 19 Jun 2023 05:57:59 GMT Message-Id: <202306190557.35J5vxCN025990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: b10d65a420f0 - main - bhyve: rename 'user_dev' with 'devices' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b10d65a420f068bccf6aaf2942157a5347211dc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=b10d65a420f068bccf6aaf2942157a5347211dc5 commit b10d65a420f068bccf6aaf2942157a5347211dc5 Author: Vitaliy Gusev AuthorDate: 2023-05-15 14:28:14 +0000 Commit: Corvin Köhne CommitDate: 2023-06-19 05:57:01 +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 --- 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 052657a50dbf..5ced5df0b4cb 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1512,7 +1512,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); } @@ -1524,7 +1524,7 @@ main(int argc, char *argv[]) } fprintf(stdout, "Restoring pci devs...\r\n"); - if (vm_restore_user_devs(&rstate) != 0) { + if (vm_restore_devices(&rstate) != 0) { fprintf(stderr, "Failed to restore PCI device state.\n"); exit(1); } @@ -1536,7 +1536,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 dfe341c598b8..f7bff85e3361 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -856,7 +856,7 @@ vm_restore_kern_structs(struct vmctx *ctx, struct restore_state *rstate) } static int -vm_restore_user_dev(struct restore_state *rstate, +vm_restore_device(struct restore_state *rstate, const struct vm_snapshot_dev_info *info) { void *dev_ptr; @@ -901,15 +901,14 @@ vm_restore_user_dev(struct restore_state *rstate, return (0); } - int -vm_restore_user_devs(struct restore_state *rstate) +vm_restore_devices(struct restore_state *rstate) { size_t i; int ret; for (i = 0; i < nitems(snapshot_devs); i++) { - ret = vm_restore_user_dev(rstate, &snapshot_devs[i]); + ret = vm_restore_device(rstate, &snapshot_devs[i]); if (ret != 0) return (ret); } @@ -918,7 +917,7 @@ vm_restore_user_devs(struct restore_state *rstate) } int -vm_pause_user_devs(void) +vm_pause_devices(void) { const struct vm_snapshot_dev_info *info; size_t i; @@ -938,7 +937,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; @@ -1090,7 +1089,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) { @@ -1112,7 +1111,7 @@ vm_snapshot_user_dev(const struct vm_snapshot_dev_info *info, } static int -vm_snapshot_user_devs(int data_fd, xo_handle_t *xop) +vm_snapshot_devices(int data_fd, xo_handle_t *xop) { int ret; off_t offset; @@ -1152,7 +1151,7 @@ vm_snapshot_user_devs(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; @@ -1294,7 +1293,7 @@ vm_checkpoint(struct vmctx *ctx, int fddir, const char *checkpoint_file, 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; @@ -1322,7 +1321,7 @@ vm_checkpoint(struct vmctx *ctx, int fddir, const char *checkpoint_file, goto done; } - ret = vm_snapshot_user_devs(kdata_fd, xop); + ret = vm_snapshot_devices(kdata_fd, xop); if (ret != 0) { fprintf(stderr, "Failed to snapshot device state.\n"); error = -1; @@ -1337,7 +1336,7 @@ vm_checkpoint(struct vmctx *ctx, int fddir, const char *checkpoint_file, } 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 c3d0a7c8371a..95201deb1e5a 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 restore_state *rstate); -int vm_pause_user_devs(void); -int vm_resume_user_devs(void); +int vm_restore_devices(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);