aboutsummaryrefslogtreecommitdiff
path: root/spice-qemu-char.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-01-15 18:01:43 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-01-15 18:01:43 +0000
commit19b6d84316892c8086e0115d6f09cb01abb86cfc (patch)
tree2c4470c8995aac4b747299d751255639138c0a48 /spice-qemu-char.c
parent5a57acb66f19ee52723aa05b8afbbc41c3e9ec99 (diff)
parentfefd749ce29837d399a38d6052ca9968fa7352e7 (diff)
downloadqemu-19b6d84316892c8086e0115d6f09cb01abb86cfc.zip
qemu-19b6d84316892c8086e0115d6f09cb01abb86cfc.tar.gz
qemu-19b6d84316892c8086e0115d6f09cb01abb86cfc.tar.bz2
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* qemu-char logfile facility * NBD coroutine based negotiation * bugfixes # gpg: Signature made Fri 15 Jan 2016 17:58:28 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: qemu-char: do not leak QemuMutex when freeing a character device qemu-char: add logfile facility to all chardev backends nbd-server: do not exit on failed memory allocation nbd-server: do not check request length except for reads and writes nbd-server: Coroutine based negotiation nbd: Split nbd.c nbd: Always call "close_fn" in nbd_client_new SCSI device: fix to incomplete QOMify iscsi: send readcapacity10 when readcapacity16 failed qemu-char: delete send_all/recv_all helper methods vmw_pvscsi: x-disable-pcie, x-old-pci-configuration back-compat props are 2.5 specific scsi: initialise info object with appropriate size i386: avoid null pointer dereference target-i386: do not duplicate page protection checks scsi: revert change to scsi_req_cancel_async and add assertions Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'spice-qemu-char.c')
-rw-r--r--spice-qemu-char.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index e70e0f7..8951d7c 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -271,13 +271,18 @@ static void spice_chr_accept_input(struct CharDriverState *chr)
}
static CharDriverState *chr_open(const char *subtype,
- void (*set_fe_open)(struct CharDriverState *, int))
-
+ void (*set_fe_open)(struct CharDriverState *,
+ int),
+ ChardevCommon *backend,
+ Error **errp)
{
CharDriverState *chr;
SpiceCharDriver *s;
- chr = qemu_chr_alloc();
+ chr = qemu_chr_alloc(backend, errp);
+ if (!chr) {
+ return NULL;
+ }
s = g_malloc0(sizeof(SpiceCharDriver));
s->chr = chr;
s->active = false;
@@ -303,6 +308,7 @@ static CharDriverState *qemu_chr_open_spice_vmc(const char *id,
{
const char *type = backend->u.spicevmc->type;
const char **psubtype = spice_server_char_device_recognized_subtypes();
+ ChardevCommon *common = qapi_ChardevSpiceChannel_base(backend->u.spicevmc);
for (; *psubtype != NULL; ++psubtype) {
if (strcmp(type, *psubtype) == 0) {
@@ -315,7 +321,7 @@ static CharDriverState *qemu_chr_open_spice_vmc(const char *id,
return NULL;
}
- return chr_open(type, spice_vmc_set_fe_open);
+ return chr_open(type, spice_vmc_set_fe_open, common, errp);
}
#if SPICE_SERVER_VERSION >= 0x000c02
@@ -325,6 +331,7 @@ static CharDriverState *qemu_chr_open_spice_port(const char *id,
Error **errp)
{
const char *name = backend->u.spiceport->fqdn;
+ ChardevCommon *common = qapi_ChardevSpicePort_base(backend->u.spiceport);
CharDriverState *chr;
SpiceCharDriver *s;
@@ -333,7 +340,10 @@ static CharDriverState *qemu_chr_open_spice_port(const char *id,
return NULL;
}
- chr = chr_open("port", spice_port_set_fe_open);
+ chr = chr_open("port", spice_port_set_fe_open, common, errp);
+ if (!chr) {
+ return NULL;
+ }
s = chr->opaque;
s->sin.portname = g_strdup(name);