[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [COMMIT 9203f52] Make NICInfo string fields non-const
From: |
Anthony Liguori |
Subject: |
[Qemu-commits] [COMMIT 9203f52] Make NICInfo string fields non-const |
Date: |
Tue, 06 Oct 2009 20:05:36 -0000 |
From: Mark McLoughlin <address@hidden>
We now only assign strdup()ed strings to these fields, never static
strings.
aliguori: fix build for ppc_prep and mips_jazz
Signed-off-by: Mark McLoughlin <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index 9578f28..3ff367d 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -209,7 +209,7 @@ void mips_jazz_init (ram_addr_t ram_size,
for (n = 0; n < nb_nics; n++) {
nd = &nd_table[n];
if (!nd->model)
- nd->model = "dp83932";
+ nd->model = qemu_strdup("dp83932");
if (strcmp(nd->model, "dp83932") == 0) {
dp83932_init(nd, 0x80001000, 2, rc4030[4],
rc4030_opaque, rc4030_dma_memory_rw);
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 104874f..e674e45 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -692,7 +692,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
nb_nics1 = NE2000_NB_MAX;
for(i = 0; i < nb_nics1; i++) {
if (nd_table[i].model == NULL) {
- nd_table[i].model = "ne2k_isa";
+ nd_table[i].model = qemu_strdup("ne2k_isa");
}
if (strcmp(nd_table[i].model, "ne2k_isa") == 0) {
isa_ne2000_init(ne2000_io[i], ne2000_irq[i], &nd_table[i]);
diff --git a/net.c b/net.c
index f2b954c..76e44c9 100644
--- a/net.c
+++ b/net.c
@@ -2813,10 +2813,10 @@ void net_client_uninit(NICInfo *nd)
nd->vlan->nb_guest_devs--;
nb_nics--;
- qemu_free((void *)nd->model);
- qemu_free((void *)nd->name);
- qemu_free((void *)nd->devaddr);
- qemu_free((void *)nd->id);
+ qemu_free(nd->model);
+ qemu_free(nd->name);
+ qemu_free(nd->devaddr);
+ qemu_free(nd->id);
memset(nd, 0, sizeof(*nd));
}
diff --git a/net.h b/net.h
index dfce8d6..a36df45 100644
--- a/net.h
+++ b/net.h
@@ -95,10 +95,10 @@ enum {
struct NICInfo {
uint8_t macaddr[6];
- const char *model;
- const char *name;
- const char *devaddr;
- const char *id;
+ char *model;
+ char *name;
+ char *devaddr;
+ char *id;
VLANState *vlan;
VLANClientState *vc;
void *private;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [COMMIT 9203f52] Make NICInfo string fields non-const,
Anthony Liguori <=