qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Levente Kurusa <lkurusa@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>,
	Cole Robinson <crobinso@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] ivshmem: convert option 'use64' to a bit instead of integer
Date: Tue, 5 Aug 2014 18:00:23 +0200	[thread overview]
Message-ID: <20140805160023.GA17384@redhat.com> (raw)
In-Reply-To: <1407164781-32486-3-git-send-email-lkurusa@redhat.com>

On Mon, Aug 04, 2014 at 05:06:21PM +0200, Levente Kurusa wrote:
> It was expecting an integer, however the sole usecase of it just
> checked whether it was assigned to or not. Hence, remove integerness,
> and add a new bitfield instead.
> 
> Signed-off-by: Levente Kurusa <lkurusa@redhat.com>

This might break some existing scripts.
If you want to address this, add a new type that
can accept both integer and bool.

> ---
>  hw/misc/ivshmem.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index 79603c0..eac85ad 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -34,6 +34,7 @@
>  
>  #define IVSHMEM_IOEVENTFD   0
>  #define IVSHMEM_MSI     1
> +#define IVSHMEM_64BIT   2
>  
>  #define IVSHMEM_PEER    0
>  #define IVSHMEM_MASTER  1
> @@ -83,7 +84,6 @@ typedef struct IVShmemState {
>      MemoryRegion ivshmem;
>      uint64_t ivshmem_size; /* size of shared memory region */
>      uint32_t ivshmem_attr;
> -    uint32_t ivshmem_64bit;
>      int shm_fd; /* shared memory file descriptor */
>  
>      Peer *peers;
> @@ -706,7 +706,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
>      memory_region_init(&s->bar, OBJECT(s), "ivshmem-bar2-container", s->ivshmem_size);
>      s->ivshmem_attr = PCI_BASE_ADDRESS_SPACE_MEMORY |
>          PCI_BASE_ADDRESS_MEM_PREFETCH;
> -    if (s->ivshmem_64bit) {
> +    if (ivshmem_has_feature(s, IVSHMEM_64BIT)) {
>          s->ivshmem_attr |= PCI_BASE_ADDRESS_MEM_TYPE_64;
>      }
>  
> @@ -804,7 +804,7 @@ static Property ivshmem_properties[] = {
>      DEFINE_PROP_BIT("msi", IVShmemState, features, IVSHMEM_MSI, true),
>      DEFINE_PROP_STRING("shm", IVShmemState, shmobj),
>      DEFINE_PROP_STRING("role", IVShmemState, role),
> -    DEFINE_PROP_UINT32("use64", IVShmemState, ivshmem_64bit, 1),
> +    DEFINE_PROP_BIT("use64", IVShmemState, features, IVSHMEM_64BIT, true),
>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> -- 
> 1.9.3

  reply	other threads:[~2014-08-05 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 15:06 [Qemu-devel] [PATCH 0/2] ivshmem: clean up building and arguments Levente Kurusa
2014-08-04 15:06 ` [Qemu-devel] [PATCH 1/2] ivshmem: fix building when debug mode is enabled Levente Kurusa
2014-08-04 15:06 ` [Qemu-devel] [PATCH 2/2] ivshmem: convert option 'use64' to a bit instead of integer Levente Kurusa
2014-08-05 16:00   ` Michael S. Tsirkin [this message]
2014-08-11  9:26     ` Levente Kurusa

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=20140805160023.GA17384@redhat.com \
    --to=mst@redhat.com \
    --cc=crobinso@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=lkurusa@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).