Revision 59a5264b

b/Makefile.objs
259 259
vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
260 260

  
261 261
vl.o: qemu-options.def
262
os-posix.o: qemu-options.def
263
os-win32.o: qemu-options.def
262 264

  
263 265
qemu-options.def: $(SRC_PATH)/qemu-options.hx
264 266
	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
b/os-posix.c
33 33
/* Needed early for CONFIG_BSD etc. */
34 34
#include "config-host.h"
35 35
#include "sysemu.h"
36
#include "net/slirp.h"
37
#include "qemu-options.h"
36 38

  
37 39
void os_setup_early_signal_handling(void)
38 40
{
......
130 132
}
131 133
#undef SHARE_SUFFIX
132 134
#undef BUILD_SUFFIX
135

  
136
/*
137
 * Parse OS specific command line options.
138
 * return 0 if option handled, -1 otherwise
139
 */
140
void os_parse_cmd_args(int index, const char *optarg)
141
{
142
    switch (index) {
143
#ifdef CONFIG_SLIRP
144
    case QEMU_OPTION_smb:
145
        if (net_slirp_smb(optarg) < 0)
146
            exit(1);
147
        break;
148
#endif
149
    }
150
    return;
151
}
b/os-win32.c
31 31
#include <sys/time.h>
32 32
#include "config-host.h"
33 33
#include "sysemu.h"
34
#include "qemu-options.h"
34 35

  
35 36
/***********************************************************/
36 37
/* Polling handling */
......
204 205
    }
205 206
    return NULL;
206 207
}
208

  
209
/*
210
 * Parse OS specific command line options.
211
 * return 0 if option handled, -1 otherwise
212
 */
213
void os_parse_cmd_args(int index, const char *optarg)
214
{
215
    return;
216
}
b/qemu-options.h
1
/*
2
 * qemu-options.h
3
 *
4
 * Defines needed for command line argument processing.
5
 *
6
 * Copyright (c) 2003-2008 Fabrice Bellard
7
 * Copyright (c) 2010 Jes Sorensen <Jes.Sorensen@redhat.com>
8
 *
9
 * Permission is hereby granted, free of charge, to any person obtaining a copy
10
 * of this software and associated documentation files (the "Software"), to deal
11
 * in the Software without restriction, including without limitation the rights
12
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
 * copies of the Software, and to permit persons to whom the Software is
14
 * furnished to do so, subject to the following conditions:
15
 *
16
 * The above copyright notice and this permission notice shall be included in
17
 * all copies or substantial portions of the Software.
18
 *
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
 * THE SOFTWARE.
26
 */
27

  
28
#ifndef _QEMU_OPTIONS_H_
29
#define _QEMU_OPTIONS_H_
30

  
31
enum {
32
#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)     \
33
    opt_enum,
34
#define DEFHEADING(text)
35
#include "qemu-options.def"
36
#undef DEF
37
#undef DEFHEADING
38
#undef GEN_DOCS
39
};
40

  
41
#endif
b/sysemu.h
82 82
/* OS specific functions */
83 83
void os_setup_early_signal_handling(void);
84 84
char *os_find_datadir(const char *argv0);
85
void os_parse_cmd_args(int index, const char *optarg);
85 86

  
86 87
typedef enum DisplayType
87 88
{
b/vl.c
148 148
#include "qemu-option.h"
149 149
#include "qemu-config.h"
150 150
#include "qemu-objects.h"
151
#include "qemu-options.h"
151 152
#ifdef CONFIG_LINUX
152 153
#include "fsdev/qemu-fsdev.h"
153 154
#endif
......
1899 1900

  
1900 1901
#define HAS_ARG 0x0001
1901 1902

  
1902
enum {
1903
#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)     \
1904
    opt_enum,
1905
#define DEFHEADING(text)
1906
#include "qemu-options.def"
1907
#undef DEF
1908
#undef DEFHEADING
1909
#undef GEN_DOCS
1910
};
1911

  
1912 1903
typedef struct QEMUOption {
1913 1904
    const char *name;
1914 1905
    int flags;
......
2624 2615
            case QEMU_OPTION_bootp:
2625 2616
                legacy_bootp_filename = optarg;
2626 2617
                break;
2627
#ifndef _WIN32
2628
            case QEMU_OPTION_smb:
2629
                if (net_slirp_smb(optarg) < 0)
2630
                    exit(1);
2631
                break;
2632
#endif
2633 2618
            case QEMU_OPTION_redir:
2634 2619
                if (net_slirp_redir(optarg) < 0)
2635 2620
                    exit(1);
......
3126 3111
                    fclose(fp);
3127 3112
                    break;
3128 3113
                }
3114
            default:
3115
                os_parse_cmd_args(popt->index, optarg);
3129 3116
            }
3130 3117
        }
3131 3118
    }

Also available in: Unified diff