]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
Allow const QemuOptDesc
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 21 Feb 2010 16:01:30 +0000 (16:01 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 21 Feb 2010 16:01:30 +0000 (16:01 +0000)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
net.c
qemu-option.c
qemu-option.h

diff --git a/net.c b/net.c
index 88934dfff2014721d3beae625021cddb9a3eee23..a1bf49fa9c948a75aa46811255964c562ce68c05 100644 (file)
--- a/net.c
+++ b/net.c
@@ -840,7 +840,7 @@ typedef int (*net_client_init_func)(QemuOpts *opts,
 /* magic number, but compiler will warn if too small */
 #define NET_MAX_DESC 20
 
-static struct {
+static const struct {
     const char *type;
     net_client_init_func init;
     QemuOptDesc desc[NET_MAX_DESC];
index a52a4c4a081eb4fa57ad8fef01669c21cc1cd9a0..de40bffc7d8839a3d420f629f76ff9117aee7081 100644 (file)
@@ -470,7 +470,7 @@ struct QemuOpt {
     const char   *name;
     const char   *str;
 
-    QemuOptDesc  *desc;
+    const QemuOptDesc *desc;
     union {
         int      boolean;
         uint64_t uint;
@@ -565,7 +565,7 @@ static void qemu_opt_del(QemuOpt *opt)
 int qemu_opt_set(QemuOpts *opts, const char *name, const char *value)
 {
     QemuOpt *opt;
-    QemuOptDesc *desc = opts->list->desc;
+    const QemuOptDesc *desc = opts->list->desc;
     int i;
 
     for (i = 0; desc[i].name != NULL; i++) {
@@ -777,7 +777,7 @@ QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, const char *fi
 /* Validate parsed opts against descriptions where no
  * descriptions were provided in the QemuOptsList.
  */
-int qemu_opts_validate(QemuOpts *opts, QemuOptDesc *desc)
+int qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc)
 {
     QemuOpt *opt;
 
index 666b666b3352e16fe4858e9b92a51252d5092b80..f3f1de755dc3b485c530c5ca75c40e649e92cde8 100644 (file)
@@ -115,7 +115,7 @@ int qemu_opts_set(QemuOptsList *list, const char *id,
                   const char *name, const char *value);
 const char *qemu_opts_id(QemuOpts *opts);
 void qemu_opts_del(QemuOpts *opts);
-int qemu_opts_validate(QemuOpts *opts, QemuOptDesc *desc);
+int qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc);
 int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname);
 QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, const char *firstname);