* [Qemu-devel] [PATCH] win32: Fix compiler errors from u_int64_t
@ 2010-04-01 21:56 Stefan Weil
2010-04-01 22:00 ` Anthony Liguori
2010-04-04 8:59 ` [Qemu-devel] " Michael S. Tsirkin
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Weil @ 2010-04-01 21:56 UTC (permalink / raw)
To: QEMU Developers; +Cc: Anthony Liguori, Michael S. Tsirkin
u_int64_t raises compiler error messages:
CC libhw32/virtio.o
/qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
/qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)
/qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is reported only once
/qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)
Replacing u_int64_t by uint64_t helps.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/vhost.c | 6 +++---
hw/virtio.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/vhost.c b/hw/vhost.c
index 1e5bc69..ad2f98a 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -357,9 +357,9 @@ static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
{
struct vhost_vring_addr addr = {
.index = idx,
- .desc_user_addr = (u_int64_t)(unsigned long)vq->desc,
- .avail_user_addr = (u_int64_t)(unsigned long)vq->avail,
- .used_user_addr = (u_int64_t)(unsigned long)vq->used,
+ .desc_user_addr = (uint64_t)(unsigned long)vq->desc,
+ .avail_user_addr = (uint64_t)(unsigned long)vq->avail,
+ .used_user_addr = (uint64_t)(unsigned long)vq->used,
.log_guest_addr = vq->used_phys,
.flags = enable_log ? (1 << VHOST_VRING_F_LOG) : 0,
};
diff --git a/hw/virtio.c b/hw/virtio.c
index f54129f..e7657ae 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -773,7 +773,7 @@ target_phys_addr_t virtio_queue_get_desc_size(VirtIODevice *vdev, int n)
target_phys_addr_t virtio_queue_get_avail_size(VirtIODevice *vdev, int n)
{
return offsetof(VRingAvail, ring) +
- sizeof(u_int64_t) * vdev->vq[n].vring.num;
+ sizeof(uint64_t) * vdev->vq[n].vring.num;
}
target_phys_addr_t virtio_queue_get_used_size(VirtIODevice *vdev, int n)
--
1.7.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] win32: Fix compiler errors from u_int64_t
2010-04-01 21:56 [Qemu-devel] [PATCH] win32: Fix compiler errors from u_int64_t Stefan Weil
@ 2010-04-01 22:00 ` Anthony Liguori
2010-04-04 8:59 ` [Qemu-devel] " Michael S. Tsirkin
1 sibling, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2010-04-01 22:00 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers, Michael S. Tsirkin
On 04/01/2010 04:56 PM, Stefan Weil wrote:
> u_int64_t raises compiler error messages:
>
> CC libhw32/virtio.o
> /qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
> /qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)
> /qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is reported only once
> /qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)
>
> Replacing u_int64_t by uint64_t helps.
>
Curious. What platform/gcc are you on?
Applied. Thanks.
Regards,
Anthony Liguori
> Cc: Michael S. Tsirkin<mst@redhat.com>
> Cc: Anthony Liguori<aliguori@us.ibm.com>
> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
> ---
> hw/vhost.c | 6 +++---
> hw/virtio.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/vhost.c b/hw/vhost.c
> index 1e5bc69..ad2f98a 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -357,9 +357,9 @@ static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
> {
> struct vhost_vring_addr addr = {
> .index = idx,
> - .desc_user_addr = (u_int64_t)(unsigned long)vq->desc,
> - .avail_user_addr = (u_int64_t)(unsigned long)vq->avail,
> - .used_user_addr = (u_int64_t)(unsigned long)vq->used,
> + .desc_user_addr = (uint64_t)(unsigned long)vq->desc,
> + .avail_user_addr = (uint64_t)(unsigned long)vq->avail,
> + .used_user_addr = (uint64_t)(unsigned long)vq->used,
> .log_guest_addr = vq->used_phys,
> .flags = enable_log ? (1<< VHOST_VRING_F_LOG) : 0,
> };
> diff --git a/hw/virtio.c b/hw/virtio.c
> index f54129f..e7657ae 100644
> --- a/hw/virtio.c
> +++ b/hw/virtio.c
> @@ -773,7 +773,7 @@ target_phys_addr_t virtio_queue_get_desc_size(VirtIODevice *vdev, int n)
> target_phys_addr_t virtio_queue_get_avail_size(VirtIODevice *vdev, int n)
> {
> return offsetof(VRingAvail, ring) +
> - sizeof(u_int64_t) * vdev->vq[n].vring.num;
> + sizeof(uint64_t) * vdev->vq[n].vring.num;
> }
>
> target_phys_addr_t virtio_queue_get_used_size(VirtIODevice *vdev, int n)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] win32: Fix compiler errors from u_int64_t
2010-04-01 21:56 [Qemu-devel] [PATCH] win32: Fix compiler errors from u_int64_t Stefan Weil
2010-04-01 22:00 ` Anthony Liguori
@ 2010-04-04 8:59 ` Michael S. Tsirkin
2010-04-05 18:01 ` Stefan Weil
1 sibling, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-04-04 8:59 UTC (permalink / raw)
To: Stefan Weil; +Cc: Anthony Liguori, QEMU Developers
On Thu, Apr 01, 2010 at 11:56:25PM +0200, Stefan Weil wrote:
> u_int64_t raises compiler error messages:
>
> CC libhw32/virtio.o
> /qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
> /qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)
> /qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is reported only once
> /qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)
>
> Replacing u_int64_t by uint64_t helps.
>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Anthony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Speaking of which, we have:
/scm/qemu/slirp/slirp.h:typedef uint64_t u_int64_t;
which we probably don't need either?
> ---
> hw/vhost.c | 6 +++---
> hw/virtio.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/vhost.c b/hw/vhost.c
> index 1e5bc69..ad2f98a 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -357,9 +357,9 @@ static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
> {
> struct vhost_vring_addr addr = {
> .index = idx,
> - .desc_user_addr = (u_int64_t)(unsigned long)vq->desc,
> - .avail_user_addr = (u_int64_t)(unsigned long)vq->avail,
> - .used_user_addr = (u_int64_t)(unsigned long)vq->used,
> + .desc_user_addr = (uint64_t)(unsigned long)vq->desc,
> + .avail_user_addr = (uint64_t)(unsigned long)vq->avail,
> + .used_user_addr = (uint64_t)(unsigned long)vq->used,
> .log_guest_addr = vq->used_phys,
> .flags = enable_log ? (1 << VHOST_VRING_F_LOG) : 0,
> };
> diff --git a/hw/virtio.c b/hw/virtio.c
> index f54129f..e7657ae 100644
> --- a/hw/virtio.c
> +++ b/hw/virtio.c
> @@ -773,7 +773,7 @@ target_phys_addr_t virtio_queue_get_desc_size(VirtIODevice *vdev, int n)
> target_phys_addr_t virtio_queue_get_avail_size(VirtIODevice *vdev, int n)
> {
> return offsetof(VRingAvail, ring) +
> - sizeof(u_int64_t) * vdev->vq[n].vring.num;
> + sizeof(uint64_t) * vdev->vq[n].vring.num;
> }
>
> target_phys_addr_t virtio_queue_get_used_size(VirtIODevice *vdev, int n)
> --
> 1.7.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] win32: Fix compiler errors from u_int64_t
2010-04-04 8:59 ` [Qemu-devel] " Michael S. Tsirkin
@ 2010-04-05 18:01 ` Stefan Weil
2010-04-05 21:30 ` Michael S. Tsirkin
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Weil @ 2010-04-05 18:01 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Anthony Liguori, QEMU Developers
Michael S. Tsirkin schrieb:
> On Thu, Apr 01, 2010 at 11:56:25PM +0200, Stefan Weil wrote:
>> u_int64_t raises compiler error messages:
>>
>> CC libhw32/virtio.o
>> /qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
>> /qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use
>> in this function)
>> /qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is
>> reported only once
>> /qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)
>>
>> Replacing u_int64_t by uint64_t helps.
>>
>> Cc: Michael S. Tsirkin <mst@redhat.com>
>> Cc: Anthony Liguori <aliguori@us.ibm.com>
>> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> Speaking of which, we have:
> /scm/qemu/slirp/slirp.h:typedef uint64_t u_int64_t;
>
> which we probably don't need either?
Right. I'd even prefer replacing all those u_int#_t types
by the standard types uint#_t.
Is that ok, or would you prefer not to touch the slirp code
(which makes heavy use of those types)?
Regards,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] win32: Fix compiler errors from u_int64_t
2010-04-05 18:01 ` Stefan Weil
@ 2010-04-05 21:30 ` Michael S. Tsirkin
0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-04-05 21:30 UTC (permalink / raw)
To: Stefan Weil; +Cc: Anthony Liguori, QEMU Developers
On Mon, Apr 05, 2010 at 08:01:16PM +0200, Stefan Weil wrote:
> Michael S. Tsirkin schrieb:
> > On Thu, Apr 01, 2010 at 11:56:25PM +0200, Stefan Weil wrote:
> >> u_int64_t raises compiler error messages:
> >>
> >> CC libhw32/virtio.o
> >> /qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
> >> /qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use
> >> in this function)
> >> /qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is
> >> reported only once
> >> /qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)
> >>
> >> Replacing u_int64_t by uint64_t helps.
> >>
> >> Cc: Michael S. Tsirkin <mst@redhat.com>
> >> Cc: Anthony Liguori <aliguori@us.ibm.com>
> >> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> >
> > Acked-by: Michael S. Tsirkin <mst@redhat.com>
> >
> > Speaking of which, we have:
> > /scm/qemu/slirp/slirp.h:typedef uint64_t u_int64_t;
> >
> > which we probably don't need either?
>
> Right. I'd even prefer replacing all those u_int#_t types
> by the standard types uint#_t.
>
> Is that ok, or would you prefer not to touch the slirp code
> (which makes heavy use of those types)?
>
> Regards,
> Stefan
I don't think we should modify all of slirp code. However
u_int64_t specifically seems unused.
--
MST
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-05 21:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 21:56 [Qemu-devel] [PATCH] win32: Fix compiler errors from u_int64_t Stefan Weil
2010-04-01 22:00 ` Anthony Liguori
2010-04-04 8:59 ` [Qemu-devel] " Michael S. Tsirkin
2010-04-05 18:01 ` Stefan Weil
2010-04-05 21:30 ` Michael S. Tsirkin
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).