From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEh9j-0006d3-U5 for qemu-devel@nongnu.org; Tue, 05 Aug 2014 12:00:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEh9d-0005iE-PY for qemu-devel@nongnu.org; Tue, 05 Aug 2014 12:00:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEh9d-0005gQ-H8 for qemu-devel@nongnu.org; Tue, 05 Aug 2014 12:00:01 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s75G002X027324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 5 Aug 2014 12:00:00 -0400 Date: Tue, 5 Aug 2014 18:00:23 +0200 From: "Michael S. Tsirkin" Message-ID: <20140805160023.GA17384@redhat.com> References: <1407164781-32486-1-git-send-email-lkurusa@redhat.com> <1407164781-32486-3-git-send-email-lkurusa@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1407164781-32486-3-git-send-email-lkurusa@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] ivshmem: convert option 'use64' to a bit instead of integer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Levente Kurusa Cc: Paolo Bonzini , Marcel Apfelbaum , Cole Robinson , QEMU Developers , Luiz Capitulino 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 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