summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-06-26 19:15:14 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 14:18:08 -0500
commit7d4c3d535c6f33e1d6d158aaf2108a27b45d743d (patch)
treef7d84eeecedb731b67f50ffe319c0d5efc67434d /vl.c
parent74efd61a75f1a400aa480ad08231ba31ccdec895 (diff)
downloadqemu-7d4c3d535c6f33e1d6d158aaf2108a27b45d743d.tar.gz
Replace -no-virtio-balloon by -balloon
We want to do (at least) two things to the virtio-balloon device: suppress it, and control its PCI address. Option -no-virtio-balloon lets us do only the former. To get the latter, replace -no-virtio-balloon with -balloon none disable balloon device -balloon virtio[,addr=str] enable virtio balloon device (default) Syntax suggested by Anthony Liguori. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/vl.c b/vl.c
index 9d1fe87f44..7b7489c7ce 100644
--- a/vl.c
+++ b/vl.c
@@ -242,7 +242,8 @@ int smp_cpus = 1;
const char *vnc_display;
int acpi_enabled = 1;
int no_hpet = 0;
-int no_virtio_balloon = 0;
+int virtio_balloon = 1;
+const char *virtio_balloon_devaddr;
int fd_bootchk = 1;
int no_reboot = 0;
int no_shutdown = 0;
@@ -4762,6 +4763,29 @@ static void select_vgahw (const char *p)
}
}
+#ifdef TARGET_I386
+static int balloon_parse(const char *arg)
+{
+ char buf[128];
+ const char *p;
+
+ if (!strcmp(arg, "none")) {
+ virtio_balloon = 0;
+ } else if (!strncmp(arg, "virtio", 6)) {
+ virtio_balloon = 1;
+ if (arg[6] == ',') {
+ p = arg + 7;
+ if (get_param_value(buf, sizeof(buf), "addr", p)) {
+ virtio_balloon_devaddr = strdup(buf);
+ }
+ }
+ } else {
+ return -1;
+ }
+ return 0;
+}
+#endif
+
#ifdef _WIN32
static BOOL WINAPI qemu_ctrl_handler(DWORD type)
{
@@ -5578,8 +5602,11 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_no_hpet:
no_hpet = 1;
break;
- case QEMU_OPTION_no_virtio_balloon:
- no_virtio_balloon = 1;
+ case QEMU_OPTION_balloon:
+ if (balloon_parse(optarg) < 0) {
+ fprintf(stderr, "Unknown -balloon argument %s\n", optarg);
+ exit(1);
+ }
break;
#endif
case QEMU_OPTION_no_reboot: