aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-05-18 16:42:09 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-22 10:50:31 -0500
commitd3f243676addaef6c8d818934565292c698f91cc (patch)
tree4a834799306873ae91572e893bc66c5ced41d39e /vl.c
parentdaa91de28dd011a39b80d76da96c432273fb5bf2 (diff)
downloadqemu-d3f243676addaef6c8d818934565292c698f91cc.zip
qemu-d3f243676addaef6c8d818934565292c698f91cc.tar.gz
qemu-d3f243676addaef6c8d818934565292c698f91cc.tar.bz2
Create qemu-option.h
This patch creates a new header file and the corresponding implementation file for parsing of parameter strings for options (like used in -drive). Part of this is code moved from vl.c (so qemu-img can use it later). The idea is to have a data structure describing all accepted parameters. When parsing a parameter string, the structure is copied and filled with the parameter values. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/vl.c b/vl.c
index 5dfeb46..c9b2aa4 100644
--- a/vl.c
+++ b/vl.c
@@ -156,6 +156,7 @@ int main(int argc, char **argv)
#include "migration.h"
#include "kvm.h"
#include "balloon.h"
+#include "qemu-option.h"
#include "disas.h"
@@ -1809,43 +1810,6 @@ static int socket_init(void)
}
#endif
-const char *get_opt_name(char *buf, int buf_size, const char *p, char delim)
-{
- char *q;
-
- q = buf;
- while (*p != '\0' && *p != delim) {
- if (q && (q - buf) < buf_size - 1)
- *q++ = *p;
- p++;
- }
- if (q)
- *q = '\0';
-
- return p;
-}
-
-const char *get_opt_value(char *buf, int buf_size, const char *p)
-{
- char *q;
-
- q = buf;
- while (*p != '\0') {
- if (*p == ',') {
- if (*(p + 1) != ',')
- break;
- p++;
- }
- if (q && (q - buf) < buf_size - 1)
- *q++ = *p;
- p++;
- }
- if (q)
- *q = '\0';
-
- return p;
-}
-
int get_param_value(char *buf, int buf_size,
const char *tag, const char *str)
{