[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Make NICInfo string fields non-const
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH] Make NICInfo string fields non-const |
Date: |
Tue, 6 Oct 2009 12:16:53 +0100 |
We now only assign strdup()ed strings to these fields, never static
strings.
Signed-off-by: Mark McLoughlin <address@hidden>
---
net.c | 8 ++++----
net.h | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
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;
--
1.6.2.5
- [Qemu-devel] [PATCH 00/19 v3] Port -net to QemuOpts, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Don't assign a static string to NICInfo::model, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Make NICInfo string fields non-const,
Mark McLoughlin <=
- [Qemu-devel] [PATCH] Register rtc options for -set, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Use qemu_strdup() for NICInfo string fields, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Use qemu_strdup() for VLANClientState string fields, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Make qemu_opts_parse() handle empty strings, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Move memset() from net_client_uninit() to net_client_init(), Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Don't exit() in config_error(), Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Add qemu_opts_validate() for post parsing validation, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Make net_client_init() consume slirp_configs even on error, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Remove bogus error message from qemu_opts_set(), Mark McLoughlin, 2009/10/06