kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Oliver Upton <oupton@google.com>
Subject: Re: [PATCH v3 5/6] KVM: Actually create debugfs in kvm_create_vm()
Date: Fri, 5 Aug 2022 19:16:08 +0000	[thread overview]
Message-ID: <Yu1seNDDwUDEAEL4@google.com> (raw)
In-Reply-To: <20220720092259.3491733-6-oliver.upton@linux.dev>

On Wed, Jul 20, 2022, Oliver Upton wrote:
> From: Oliver Upton <oupton@google.com>
> 
> Doing debugfs creation after vm creation leaves things in a
> quasi-initialized state for a while. This is further complicated by the
> fact that we tear down debugfs from kvm_destroy_vm(). Align debugfs and
> stats init/destroy with the vm init/destroy pattern to avoid any
> headaches.
> 
> Note the fix for a benign mistake in error handling for calls to
> kvm_arch_create_vm_debugfs() rolled in. Since all implementations of
> the function return 0 unconditionally it isn't actually a bug at
> the moment.

Heh, now I feel like you're being intentionally mean.  Usually I discourage
play-by-play descriptions, but in this case being explicit saves readers a lot
of staring.

And I would argue it's still a bug, it's just that the bug can't be hit and so
can't cause issues.  E.g.

  Opportunistically fix a benign bug where KVM would return "i" instead
  of "ret" if kvm_arch_create_vm_debugfs() failed.  The bug is benign as
  all implementations of the function return 0 unconditionally.

> Lastly, tear down debugfs/stats data in the kvm_create_vm_debugfs()
> error path. Previously it was safe to assume that kvm_destroy_vm() would
> take out the garbage, that is no longer the case.
> 
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---

Reviewed-by: Sean Christopherson <seanjc@google.com>

  reply	other threads:[~2022-08-05 19:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  9:22 [PATCH v3 0/6] KVM: Clean up debugfs init/destroy Oliver Upton
2022-07-20  9:22 ` [PATCH v3 1/6] KVM: Shove vm stats_id init into kvm_create_vm() Oliver Upton
2022-08-05 19:09   ` Sean Christopherson
2022-07-20  9:22 ` [PATCH v3 2/6] KVM: Shove vcpu stats_id init into kvm_vcpu_init() Oliver Upton
2022-08-05 19:06   ` Sean Christopherson
2022-08-09 14:52     ` Paolo Bonzini
2022-07-20  9:22 ` [PATCH v3 3/6] KVM: Get an fd before creating the VM Oliver Upton
2022-08-05 19:03   ` Sean Christopherson
2022-07-20  9:22 ` [PATCH v3 4/6] KVM: Pass the name of the VM fd to kvm_create_vm_debugfs() Oliver Upton
2022-08-05 19:20   ` Sean Christopherson
2022-07-20  9:22 ` [PATCH v3 5/6] KVM: Actually create debugfs in kvm_create_vm() Oliver Upton
2022-08-05 19:16   ` Sean Christopherson [this message]
2022-07-20  9:22 ` [PATCH v3 6/6] KVM: Hoist debugfs_dentry init to kvm_create_vm_debugfs() (again) Oliver Upton
2022-08-05 19:02   ` Sean Christopherson
2022-08-09 14:56     ` Paolo Bonzini
2022-08-09 19:59       ` Oliver Upton
2022-07-20  9:22 ` [PATCH v3 0/6] KVM: Clean up debugfs init/destroy Oliver Upton
2022-07-20  9:22 ` [PATCH v3 1/6] KVM: Shove vm stats_id init into kvm_create_vm() Oliver Upton
2022-07-20  9:22 ` [PATCH v3 2/6] KVM: Shove vcpu stats_id init into kvm_vcpu_init() Oliver Upton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yu1seNDDwUDEAEL4@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=oupton@google.com \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).