Skip to contentSkip to conversation

Build error in block-cow.c

Qemu-devel Paul Brook 1 participant 1 message Apr 10, 2005

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

block-cow.c defined and uses a function named set_bit. Unfortunately this conflicts with an atomic operation declared in some system headers. The patch below renames it to cow_set_bit.

Paul

Index: block-cow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-cow.c,v
retrieving revision 1.3

block-cow.c +2 -2
diff -u -p -r1.3 block-cow.c
@@ -124,7 +124,7 @@ static int cow_open(BlockDriverState *bs
     return -1;
 }
 
-static inline void set_bit(uint8_t *bitmap, int64_t bitnum)
+static inline void cow_set_bit(uint8_t *bitmap, int64_t bitnum)
 {
     bitmap[bitnum / 8] |= (1 << (bitnum%8));
 }
@@ -198,7 +198,7 @@ static int cow_write(BlockDriverState *b
     if (ret != nb_sectors * 512) 
         return -1;
     for (i = 0; i < nb_sectors; i++)
-        set_bit(s->cow_bitmap, sector_num + i);
+        cow_set_bit(s->cow_bitmap, sector_num + i);
     return 0;
 }