public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
To: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 2 of 3] Move kvm_context structure to kvmctl.h header
Date: Sun, 28 Oct 2007 21:08:37 -0500	[thread overview]
Message-ID: <472540A5.3020607@codemonkey.ws> (raw)
In-Reply-To: <8bf5e4e6a4c9d2dab890.1193618568@thinkpad>

Jerone Young wrote:
> # HG changeset patch
> # User Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> # Date 1193618330 18000
> # Node ID 8bf5e4e6a4c9d2dab89062a0ab24a2ae5d144a02
> # Parent  3bf072e498768885ab96b7ccb668b61c96db0e83
> Move kvm_context structure to kvmctl.h header
>
> This patch moves the kvm_context sturcture declaration to the kvmctl.h
> header. This way other files are able to identify variables associated
> with the structure. Also moved are definitions MAX_VCPU &
> KVM_MAX_NUM_MEM_REGIONS  to the kvmctl-x86.h since these are arch specific.
>   

I think just moving the declaration of kvm_context to an x86 specific 
file is the wrong direction to take.

I think a better first step would be to split up the architecture 
specific portions of kvm_context into an architecture specific structure 
and then have the common kvm_context be a part of the architecture 
specific structure (just like is done in the kernel code).

Regards,

Anthony Liguori

> Signed-off-by: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>
> diff --git a/user/kvmctl-x86.h b/user/kvmctl-x86.h
> --- a/user/kvmctl-x86.h
> +++ b/user/kvmctl-x86.h
> @@ -1,5 +1,8 @@
>  #ifndef KVMCTL_X86_H
>  #define KVMCTL_X86_H
> +
> +#define KVM_MAX_NUM_MEM_REGIONS 8u
> +#define MAX_VCPUS 4
>  
>  /*!
>   * \brief KVM callbacks structure
> diff --git a/user/kvmctl.c b/user/kvmctl.c
> --- a/user/kvmctl.c
> +++ b/user/kvmctl.c
> @@ -44,36 +44,8 @@ static int kvm_abi = EXPECTED_KVM_API_VE
>  
>  /* FIXME: share this number with kvm */
>  /* FIXME: or dynamically alloc/realloc regions */
> -#define KVM_MAX_NUM_MEM_REGIONS 8u
>  int free_slots[KVM_MAX_NUM_MEM_REGIONS];
>  unsigned long phys_addr_slots[KVM_MAX_NUM_MEM_REGIONS];
> -#define MAX_VCPUS 4
> -
> -/**
> - * \brief The KVM context
> - *
> - * The verbose KVM context
> - */
> -struct kvm_context {
> -	/// Filedescriptor to /dev/kvm
> -	int fd;
> -	int vm_fd;
> -	int vcpu_fd[MAX_VCPUS];
> -	struct kvm_run *run[MAX_VCPUS];
> -	/// Callbacks that KVM uses to emulate various unvirtualizable functionality
> -	struct kvm_callbacks *callbacks;
> -	void *opaque;
> -	/// A pointer to the memory used as the physical memory for the guest
> -	void *physical_memory;
> -	/// is dirty pages logging enabled for all regions or not
> -	int dirty_pages_log_all;
> -	/// memory regions parameters
> -	struct kvm_memory_region mem_regions[KVM_MAX_NUM_MEM_REGIONS];
> -	/// do not create in-kernel irqchip if set
> -	int no_irqchip_creation;
> -	/// in-kernel irqchip status
> -	int irqchip_in_kernel;
> -};
>  
>  static void init_slots()
>  {
> diff --git a/user/kvmctl.h b/user/kvmctl.h
> --- a/user/kvmctl.h
> +++ b/user/kvmctl.h
> @@ -31,6 +31,36 @@ typedef struct kvm_context *kvm_context_
>  #if defined(__x86_64__) || defined(__i386__)
>  #include "kvmctl-x86.h"
>  #endif
> +
> +
> +/**
> + * \brief The KVM context
> + *
> + * The verbose KVM context
> + */
> +
> +struct kvm_context {
> +	/// Filedescriptor to /dev/kvm
> +	int fd;
> +	int vm_fd;
> +	int vcpu_fd[MAX_VCPUS];
> +	struct kvm_run *run[MAX_VCPUS];
> +	/// Callbacks that KVM uses to emulate various unvirtualizable functionality
> +	struct kvm_callbacks *callbacks;
> +	void *opaque;
> +	/// A pointer to the memory used as the physical memory for the guest
> +	void *physical_memory;
> +	/// is dirty pages logging enabled for all regions or not
> +	int dirty_pages_log_all;
> +	/// memory regions parameters
> +	struct kvm_memory_region mem_regions[KVM_MAX_NUM_MEM_REGIONS];
> +	/// do not create in-kernel irqchip if set
> +	int no_irqchip_creation;
> +	/// in-kernel irqchip status
> +	int irqchip_in_kernel;
> +};
> +
> +
>  
>  /*!
>   * \brief Create new KVM context
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

  parent reply	other threads:[~2007-10-29  2:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29  0:42 [PATCH 0 of 3] kvmctl code refactoring part 1 Jerone Young
2007-10-29  0:42 ` [PATCH 1 of 3] Move x86 kvmcallback structure to kvmctl-x86.h header Jerone Young
2007-10-29  1:13   ` [PATCH 1 of 3] Move x86 kvmcallback structure tokvmctl-x86.h header Zhang, Xiantao
     [not found]     ` <42DFA526FC41B1429CE7279EF83C6BDC8B51E0-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-29  2:04       ` [kvm-ppc-devel] " Hollis Blanchard
2007-10-29  2:17         ` Anthony Liguori
     [not found]           ` <472542B8.9070105-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-29  2:41             ` Zhang, Xiantao
     [not found]               ` <42DFA526FC41B1429CE7279EF83C6BDC8B5292-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-29  3:00                 ` Hollis Blanchard
2007-10-29  3:53                   ` Anthony Liguori
2007-10-29  2:41         ` [kvm-ppc-devel] [PATCH 1 of 3] Move x86kvmcallback " Zhang, Xiantao
     [not found]           ` <42DFA526FC41B1429CE7279EF83C6BDC8B528F-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-29  2:56             ` Hollis Blanchard
2007-10-29  2:11   ` [PATCH 1 of 3] Move x86 kvmcallback structure to kvmctl-x86.h header Anthony Liguori
     [not found]     ` <4725415B.4020601-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-29  3:14       ` [kvm-ppc-devel] " Hollis Blanchard
2007-10-29  3:50         ` Anthony Liguori
     [not found]           ` <47255892.2090308-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-29  4:14             ` Hollis Blanchard
2007-10-29 14:12               ` Anthony Liguori
2007-10-30  4:31               ` Avi Kivity
2007-10-29  0:42 ` [PATCH 2 of 3] Move kvm_context structure to kvmctl.h header Jerone Young
2007-10-29  1:28   ` [PATCH 2 of 3] Move kvm_context structure to kvmctl.hheader Zhang, Xiantao
2007-10-29  2:08   ` Anthony Liguori [this message]
2007-10-29  7:18   ` [PATCH 2 of 3] Move kvm_context structure to kvmctl.h header Izik Eidus
2007-10-29  0:42 ` [PATCH 3 of 3] Move x86 specific properties of kvm_init to own file Jerone Young

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=472540A5.3020607@codemonkey.ws \
    --to=anthony-rdkfgonbjusknkdkm+me6a@public.gmane.org \
    --cc=jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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