aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-02-25 23:15:57 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2010-02-25 23:15:57 -0300
commit4137e0a3052d9a78c4705248ae1e966e6348c7de (patch)
tree2f53a163d18a82bcb53a3ab518a44eabb112ba6b
parentDo not allow vcpu stop with in progress PIO (diff)
parentDocumentation: Add missing documentation for qdev related command line options (diff)
downloadqemu-kvm-4137e0a3052d9a78c4705248ae1e966e6348c7de.tar.gz
qemu-kvm-4137e0a3052d9a78c4705248ae1e966e6348c7de.tar.bz2
qemu-kvm-4137e0a3052d9a78c4705248ae1e966e6348c7de.zip
Merge commit 'c502715a74675b3554cf7bcd684b82c9733ecfae' into stable-0.12-merge
* commit 'c502715a74675b3554cf7bcd684b82c9733ecfae': Documentation: Add missing documentation for qdev related command line options pc: add driver version compat properties scsi: device version property ide: device version property QMP: Emit asynchronous events on all QMP monitors Fix QEMU_WARN_UNUSED_RESULT Conflicts: qemu-options.hx Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--hw/ide/core.c19
-rw-r--r--hw/ide/internal.h4
-rw-r--r--hw/ide/qdev.c3
-rw-r--r--hw/pc.c16
-rw-r--r--hw/scsi-disk.c5
-rw-r--r--hw/usb-net.c2
-rw-r--r--hw/usb-serial.c4
-rw-r--r--monitor.c12
-rw-r--r--qemu-common.h3
-rw-r--r--qemu-options.hx25
-rw-r--r--usb-linux.c2
11 files changed, 71 insertions, 24 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 76c382080..b6643e826 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -115,7 +115,7 @@ static void ide_identify(IDEState *s)
put_le16(p + 20, 3); /* XXX: retired, remove ? */
put_le16(p + 21, 512); /* cache size in sectors */
put_le16(p + 22, 4); /* ecc bytes */
- padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */
+ padstr((char *)(p + 23), s->version, 8); /* firmware version */
padstr((char *)(p + 27), "QEMU HARDDISK", 40); /* model */
#if MAX_MULT_SECTORS > 1
put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
@@ -186,7 +186,7 @@ static void ide_atapi_identify(IDEState *s)
put_le16(p + 20, 3); /* buffer type */
put_le16(p + 21, 512); /* cache size in sectors */
put_le16(p + 22, 4); /* ecc bytes */
- padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */
+ padstr((char *)(p + 23), s->version, 8); /* firmware version */
padstr((char *)(p + 27), "QEMU DVD-ROM", 40); /* model */
put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */
#ifdef USE_DMA_CDROM
@@ -238,7 +238,7 @@ static void ide_cfata_identify(IDEState *s)
put_le16(p + 8, s->nb_sectors); /* Sectors per card */
padstr((char *)(p + 10), s->drive_serial_str, 20); /* serial number */
put_le16(p + 22, 0x0004); /* ECC bytes */
- padstr((char *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */
+ padstr((char *) (p + 23), s->version, 8); /* Firmware Revision */
padstr((char *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */
#if MAX_MULT_SECTORS > 1
put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
@@ -1591,7 +1591,7 @@ static void ide_atapi_cmd(IDEState *s)
buf[7] = 0; /* reserved */
padstr8(buf + 8, 8, "QEMU");
padstr8(buf + 16, 16, "QEMU DVD-ROM");
- padstr8(buf + 32, 4, QEMU_VERSION);
+ padstr8(buf + 32, 4, s->version);
ide_atapi_cmd_reply(s, 36, max_len);
break;
case GPCMD_GET_CONFIGURATION:
@@ -2590,7 +2590,7 @@ void ide_bus_reset(IDEBus *bus)
ide_clear_hob(bus);
}
-void ide_init_drive(IDEState *s, DriveInfo *dinfo)
+void ide_init_drive(IDEState *s, DriveInfo *dinfo, const char *version)
{
int cylinders, heads, secs;
uint64_t nb_sectors;
@@ -2619,6 +2619,11 @@ void ide_init_drive(IDEState *s, DriveInfo *dinfo)
if (strlen(s->drive_serial_str) == 0)
snprintf(s->drive_serial_str, sizeof(s->drive_serial_str),
"QM%05d", s->drive_serial);
+ if (version) {
+ pstrcpy(s->version, sizeof(s->version), version);
+ } else {
+ pstrcpy(s->version, sizeof(s->version), QEMU_VERSION);
+ }
ide_reset(s);
}
@@ -2639,9 +2644,9 @@ void ide_init2(IDEBus *bus, DriveInfo *hd0, DriveInfo *hd1,
s->sector_write_timer = qemu_new_timer(vm_clock,
ide_sector_write_timer_cb, s);
if (i == 0)
- ide_init_drive(s, hd0);
+ ide_init_drive(s, hd0, NULL);
if (i == 1)
- ide_init_drive(s, hd1);
+ ide_init_drive(s, hd1, NULL);
}
bus->irq = irq;
}
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index f937daacf..f9a34b8a5 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -397,6 +397,7 @@ struct IDEState {
/* set for lba48 access */
uint8_t lba48;
BlockDriverState *bs;
+ char version[9];
/* ATAPI specific */
uint8_t sense_key;
uint8_t asc;
@@ -449,6 +450,7 @@ struct IDEDevice {
DeviceState qdev;
uint32_t unit;
DriveInfo *dinfo;
+ char *version;
};
typedef int (*ide_qdev_initfn)(IDEDevice *dev);
@@ -548,7 +550,7 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr);
void ide_data_writel(void *opaque, uint32_t addr, uint32_t val);
uint32_t ide_data_readl(void *opaque, uint32_t addr);
-void ide_init_drive(IDEState *s, DriveInfo *dinfo);
+void ide_init_drive(IDEState *s, DriveInfo *dinfo, const char *version);
void ide_init2(IDEBus *bus, DriveInfo *hd0, DriveInfo *hd1,
qemu_irq irq);
void ide_init_ioport(IDEBus *bus, int iobase, int iobase2);
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 81e79950d..0b84a4f1d 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -99,7 +99,7 @@ typedef struct IDEDrive {
static int ide_drive_initfn(IDEDevice *dev)
{
IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus);
- ide_init_drive(bus->ifs + dev->unit, dev->dinfo);
+ ide_init_drive(bus->ifs + dev->unit, dev->dinfo, dev->version);
return 0;
}
@@ -110,6 +110,7 @@ static IDEDeviceInfo ide_drive_info = {
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("unit", IDEDrive, dev.unit, -1),
DEFINE_PROP_DRIVE("drive", IDEDrive, dev.dinfo),
+ DEFINE_PROP_STRING("ver", IDEDrive, dev.version),
DEFINE_PROP_END_OF_LIST(),
}
};
diff --git a/hw/pc.c b/hw/pc.c
index 78a07c2fd..632f439cd 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1354,6 +1354,14 @@ static QEMUMachine pc_machine_v0_11 = {
.property = "vectors",
.value = stringify(0),
},{
+ .driver = "ide-drive",
+ .property = "ver",
+ .value = "0.11",
+ },{
+ .driver = "scsi-disk",
+ .property = "ver",
+ .value = "0.11",
+ },{
.driver = "PCI",
.property = "rombar",
.value = stringify(0),
@@ -1385,6 +1393,14 @@ static QEMUMachine pc_machine_v0_10 = {
.property = "vectors",
.value = stringify(0),
},{
+ .driver = "ide-drive",
+ .property = "ver",
+ .value = "0.10",
+ },{
+ .driver = "scsi-disk",
+ .property = "ver",
+ .value = "0.10",
+ },{
.driver = "PCI",
.property = "rombar",
.value = stringify(0),
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index eb5b5a847..e3924dec9 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -65,6 +65,7 @@ struct SCSIDiskState
int cluster_size;
uint64_t max_lba;
QEMUBH *bh;
+ char *version;
};
static SCSIDiskReq *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun)
@@ -315,6 +316,7 @@ static uint8_t *scsi_get_buf(SCSIDevice *d, uint32_t tag)
static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
{
BlockDriverState *bdrv = req->dev->dinfo->bdrv;
+ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
int buflen = 0;
if (req->cmd.buf[1] & 0x2) {
@@ -432,7 +434,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
memcpy(&outbuf[16], "QEMU HARDDISK ", 16);
}
memcpy(&outbuf[8], "QEMU ", 8);
- memcpy(&outbuf[32], QEMU_VERSION, 4);
+ memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION, 4);
/* Identify device as SCSI-3 rev 1.
Some later commands are also implemented. */
outbuf[2] = 3;
@@ -1029,6 +1031,7 @@ static SCSIDeviceInfo scsi_disk_info = {
.get_buf = scsi_get_buf,
.qdev.props = (Property[]) {
DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.dinfo),
+ DEFINE_PROP_STRING("ver", SCSIDiskState, version),
DEFINE_PROP_END_OF_LIST(),
},
};
diff --git a/hw/usb-net.c b/hw/usb-net.c
index 9744dfa5d..cfd2f62e0 100644
--- a/hw/usb-net.c
+++ b/hw/usb-net.c
@@ -1492,7 +1492,7 @@ static USBDevice *usb_net_init(const char *cmdline)
dev = usb_create(NULL /* FIXME */, "usb-net");
qdev_set_nic_properties(&dev->qdev, &nd_table[idx]);
- qdev_init(&dev->qdev);
+ qdev_init_nofail(&dev->qdev);
return dev;
}
diff --git a/hw/usb-serial.c b/hw/usb-serial.c
index 2775cf0f0..37293ea41 100644
--- a/hw/usb-serial.c
+++ b/hw/usb-serial.c
@@ -583,7 +583,7 @@ static USBDevice *usb_serial_init(const char *filename)
qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid);
if (productid)
qdev_prop_set_uint16(&dev->qdev, "productid", productid);
- qdev_init(&dev->qdev);
+ qdev_init_nofail(&dev->qdev);
return dev;
}
@@ -599,7 +599,7 @@ static USBDevice *usb_braille_init(const char *unused)
dev = usb_create(NULL /* FIXME */, "usb-braille");
qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
- qdev_init(&dev->qdev);
+ qdev_init_nofail(&dev->qdev);
return dev;
}
diff --git a/monitor.c b/monitor.c
index 8c36b1089..42bd9fd87 100644
--- a/monitor.c
+++ b/monitor.c
@@ -337,13 +337,10 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
{
QDict *qmp;
const char *event_name;
- Monitor *mon = cur_mon;
+ Monitor *mon;
assert(event < QEVENT_MAX);
- if (!monitor_ctrl_mode(mon))
- return;
-
switch (event) {
case QEVENT_DEBUG:
event_name = "DEBUG";
@@ -373,7 +370,12 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
qdict_put_obj(qmp, "data", data);
}
- monitor_json_emitter(mon, QOBJECT(qmp));
+ QLIST_FOREACH(mon, &mon_list, entry) {
+ if (!monitor_ctrl_mode(mon))
+ return;
+
+ monitor_json_emitter(mon, QOBJECT(qmp));
+ }
QDECREF(qmp);
}
diff --git a/qemu-common.h b/qemu-common.h
index 5fbe0f9db..1c5c0b222 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -2,6 +2,8 @@
#ifndef QEMU_COMMON_H
#define QEMU_COMMON_H
+#include "config-host.h"
+
#define QEMU_NORETURN __attribute__ ((__noreturn__))
#ifdef CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT
#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
@@ -29,7 +31,6 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
-#include "config-host.h"
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
diff --git a/qemu-options.hx b/qemu-options.hx
index ca73ba5db..e2fbebd9b 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -405,6 +405,12 @@ ETEXI
DEF("device", HAS_ARG, QEMU_OPTION_device,
"-device driver[,options] add device\n")
+STEXI
+@item -device @var{driver}[,@var{option}[,...]]
+Add device @var{driver}. Depending on the device type,
+@var{option} (typically @var{key}=@var{value}) may be useful.
+ETEXI
+
DEF("name", HAS_ARG, QEMU_OPTION_name,
"-name string1[,process=string2] set the name of the guest\n"
" string1 sets the window title and string2 the process name (on Linux)\n")
@@ -1894,6 +1900,8 @@ ETEXI
DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
"-nodefaults don't create default devices.\n")
STEXI
+@item -nodefaults
+Don't create default devices.
ETEXI
#ifndef _WIN32
@@ -1916,10 +1924,6 @@ Immediately before starting guest execution, drop root privileges, switching
to the specified user.
ETEXI
-STEXI
-@end table
-ETEXI
-
#if defined(TARGET_SPARC) || defined(TARGET_PPC)
DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
"-prom-env variable=value\n"
@@ -1935,9 +1939,17 @@ DEF("old-param", 0, QEMU_OPTION_old_param,
#endif
DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
"-readconfig <file>\n")
+STEXI
+@item -readconfig @var{file}
+Read device configuration from @var{file}.
+ETEXI
DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
"-writeconfig <file>\n"
" read/write config file\n")
+STEXI
+@item -writeconfig @var{file}
+Write device configuration to @var{file}.
+ETEXI
DEF("no-kvm", 0, QEMU_OPTION_no_kvm,
"-no-kvm disable KVM hardware virtualization\n")
@@ -1969,3 +1981,8 @@ DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
"-mem-prealloc preallocate guest memory (use with -mempath)\n")
#endif
+
+HXCOMM This is the last statement. Insert new options before this line!
+STEXI
+@end table
+ETEXI
diff --git a/usb-linux.c b/usb-linux.c
index 88728e927..5619b3060 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -1036,7 +1036,7 @@ USBDevice *usb_host_device_open(const char *devname)
qdev_prop_set_uint32(&dev->qdev, "hostaddr", filter.addr);
qdev_prop_set_uint32(&dev->qdev, "vendorid", filter.vendor_id);
qdev_prop_set_uint32(&dev->qdev, "productid", filter.product_id);
- qdev_init(&dev->qdev);
+ qdev_init_nofail(&dev->qdev);
return dev;
fail: