* [Qemu-devel] Compilation fails when configure with -DDEBUG
@ 2008-05-29 17:30 Protti, Duilio J
2008-06-02 1:49 ` andrzej zaborowski
0 siblings, 1 reply; 2+ messages in thread
From: Protti, Duilio J @ 2008-05-29 17:30 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1.1: Type: text/plain, Size: 2258 bytes --]
Hi,
This minor error was found during compilation of kvm-65 and originally
submitted to the kvm project:
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=1945129&gro
up_id=180599
KVM maintainers then point me out to this mailing list.
Configuring kvm-65 with
# ./configure --prefix=/usr/devel --qemu-cflags=-DDEBUG
compilation fails with the following error:
gcc34 -I /root/linux/kvm-65/qemu/../libkvm -DDEBUG -DCONFIG_X86 -Wall
-O2
-g -fno-strict-aliasing -m32 -I. -I/root/linux/kvm-65/qemu -MMD -MP
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/root/linux/kvm-65/qemu/slirp -c -o smbus_eeprom.o
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c: In function
`eeprom_quick_cmd':
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c:40: error: structure has no
member named `addr'
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c: In function
`eeprom_send_byte':
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c:48: error: structure has no
member named `addr'
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c: In function
`eeprom_receive_byte':
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c:58: error: structure has no
member named `addr'
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c: In function
`eeprom_write_data':
/root/linux/kvm-65/qemu/hw/smbus_eeprom.c:68: error: structure has no
member named `addr'
make[1]: *** [smbus_eeprom.o] Error 1
make[1]: Leaving directory `/root/linux/kvm-65/qemu'
make: *** [qemu] Error 2
The error comes because structure SMBusDevice does not have a field
named
'addr' (probably name has changed since the debugging code was written).
Code conditionally compiled with a DEBUG macro appears in many places in
the Qemu code, but it is not driven by a central --debug option or
similar,
so it seems that the configuration used (with -DDEBUG) is a little
odd and a not supported one, so this error will appear only in
developer's
systems.
However, may be the code should be changed or else removed to avoid
these
useless lines there.
Attached is a simple patch which resolves the issue.
Regards,
Duilio Protti.
[-- Attachment #1.2: Type: text/html, Size: 10472 bytes --]
[-- Attachment #2: kvm-65-smbus_eeprom-DEBUG.patch --]
[-- Type: application/octet-stream, Size: 1464 bytes --]
diff -Nru kvm-65.orig/qemu/hw/smbus_eeprom.c kvm-65/qemu/hw/smbus_eeprom.c
--- kvm-65.orig/qemu/hw/smbus_eeprom.c 2008-04-04 18:22:20.000000000 -0300
+++ kvm-65/qemu/hw/smbus_eeprom.c 2008-04-17 14:19:19.000000000 -0300
@@ -37,7 +37,7 @@
static void eeprom_quick_cmd(SMBusDevice *dev, uint8_t read)
{
#ifdef DEBUG
- printf("eeprom_quick_cmd: addr=0x%02x read=%d\n", dev->addr, read);
+ printf("eeprom_quick_cmd: addr=0x%02x read=%d\n", dev->data_buf, read);
#endif
}
@@ -45,7 +45,7 @@
{
SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev;
#ifdef DEBUG
- printf("eeprom_send_byte: addr=0x%02x val=0x%02x\n", dev->addr, val);
+ printf("eeprom_send_byte: addr=0x%02x val=0x%02x\n", dev->data_buf, val);
#endif
eeprom->offset = val;
}
@@ -55,7 +55,7 @@
SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev;
uint8_t val = eeprom->data[eeprom->offset++];
#ifdef DEBUG
- printf("eeprom_receive_byte: addr=0x%02x val=0x%02x\n", dev->addr, val);
+ printf("eeprom_receive_byte: addr=0x%02x val=0x%02x\n", dev->data_buf, val);
#endif
return val;
}
@@ -65,7 +65,7 @@
SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev;
int n;
#ifdef DEBUG
- printf("eeprom_write_byte: addr=0x%02x cmd=0x%02x val=0x%02x\n", dev->addr,
+ printf("eeprom_write_byte: addr=0x%02x cmd=0x%02x val=0x%02x\n", dev->data_buf,
cmd, buf[0]);
#endif
/* An page write operation is not a valid SMBus command.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-02 1:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 17:30 [Qemu-devel] Compilation fails when configure with -DDEBUG Protti, Duilio J
2008-06-02 1:49 ` andrzej zaborowski
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).