listen type socket support for rdp graphics
by Vasiliy Tolstov
Hi! How hard implement listen type socket support for rdp graphics? VNC and
SPICE already have such options?
And does this support for rdp available for qemu driver? (I need to access
qemu vm via rdp)
Thanks!
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
4 years, 9 months
[PATCH] qemu: reset await_event in all error paths in qemuAgentCommand
by Nikolay Shirokovskiy
A fixup to patch [1]. We need to reset await_event in all
error paths.
[1] 52532073d : qemu: remove redundant needReply argument of qemuAgentCommand
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_agent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 9ea2c59..6ff5b11 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -1113,7 +1113,7 @@ qemuAgentCommand(qemuAgentPtr agent,
}
if (qemuAgentGuestSync(agent) < 0)
- return -1;
+ goto cleanup;
if (!(cmdstr = virJSONValueToString(cmd, false)))
goto cleanup;
--
1.8.3.1
4 years, 9 months
[PATCH 0/6] Parse back some legacy backing store strings
by Peter Krempa
See patch 4 for code and 6 for what we try to parse back.
Peter Krempa (6):
virBitmapNewEmpty: Use g_new0 to allocate and remove error checking
virJSONValueObjectDeflattenWorker: Refactor cleanup
util: json: Extract deflattening of keys into a separate function
virjson: Deflatten arrays generated by the json->commandline generator
jsontest: Add test cases for deflattening of arrays
tests: virstoragetest: validate that array deflattening works for
gluster
src/util/virbitmap.c | 14 +--
src/util/virhostcpu.c | 6 +-
src/util/virjson.c | 105 ++++++++++++++----
src/util/virtpm.c | 3 +-
tests/virbitmaptest.c | 8 +-
.../deflatten-dotted-array-in.json | 27 +++++
.../deflatten-dotted-array-out.json | 43 +++++++
tests/virjsontest.c | 1 +
tests/virstoragetest.c | 18 +++
9 files changed, 182 insertions(+), 43 deletions(-)
create mode 100644 tests/virjsondata/deflatten-dotted-array-in.json
create mode 100644 tests/virjsondata/deflatten-dotted-array-out.json
--
2.24.1
4 years, 9 months
[PATCH] Minor doc fix
by Sebastian Mitterle
1. Fix link to knowledge base article
2. Use <h1> to make sure kbase.html has page title
Signed-off-by Sebastian Mitterle <smitterl(a)redhat.com>
---
docs/formatbackup.html.in | 2 +-
docs/kbase.html.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/formatbackup.html.in b/docs/formatbackup.html.in
index 543d913072..55acd13ddc 100644
--- a/docs/formatbackup.html.in
+++ b/docs/formatbackup.html.in
@@ -14,7 +14,7 @@
description of the actions to perform, as well as an optional
second XML document <a href="formatcheckpoint.html">describing a
checkpoint</a> to create at the same point in time. See
- also <a href="domainstatecapture.html">a comparison</a> between
+ also <a href="kbase/domainstatecapture.html">a comparison</a> between
the various state capture APIs.
</p>
<p>
diff --git a/docs/kbase.html.in b/docs/kbase.html.in
index 7055f4fda4..c586e0f676 100644
--- a/docs/kbase.html.in
+++ b/docs/kbase.html.in
@@ -2,7 +2,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body class="docs">
- <h2>Knowledge base</h2>
+ <h1>Knowledge base</h1>
<div class="panel">
<dl>
--
2.21.0
4 years, 9 months
[PULL v2 00/11] Bitmaps patches
by John Snow
The following changes since commit d649689a8ecb2e276cc20d3af6d416e3c299cb17:
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2020-03-17 18:33:05 +0000)
are available in the Git repository at:
https://github.com/jnsnow/qemu.git tags/bitmaps-pull-request
for you to fetch changes up to 2d00cbd8e222a4adc08f415c399e84590ee8ff9a:
block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty (2020-03-18 14:03:46 -0400)
----------------------------------------------------------------
Pull request
----------------------------------------------------------------
Eric Blake (1):
build: Silence clang warning on older glib autoptr usage
Vladimir Sementsov-Ogievskiy (10):
hbitmap: assert that we don't create bitmap larger than INT64_MAX
hbitmap: move hbitmap_iter_next_word to hbitmap.c
hbitmap: unpublish hbitmap_iter_skip_words
hbitmap: drop meta bitmaps as they are unused
block/dirty-bitmap: switch _next_dirty_area and _next_zero to int64_t
block/dirty-bitmap: add _next_dirty API
block/dirty-bitmap: improve _next_dirty_area API
nbd/server: introduce NBDExtentArray
nbd/server: use bdrv_dirty_bitmap_next_dirty_area
block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty
configure | 20 +++
include/block/dirty-bitmap.h | 9 +-
include/qemu/hbitmap.h | 95 +++--------
block/dirty-bitmap.c | 16 +-
block/qcow2-bitmap.c | 15 +-
nbd/server.c | 251 ++++++++++++++--------------
tests/test-hbitmap.c | 316 +++++++++++++----------------------
util/hbitmap.c | 134 +++++++++------
8 files changed, 395 insertions(+), 461 deletions(-)
--
2.21.1
4 years, 9 months
[PATCH] qemu: Don't crash when getting targets for a multipath
by Michal Privoznik
In one of my previous commits I've introduced code that creates
all devices for given (possible) multipath target. But I've made
a mistake there - the code accesses src->path without checking if
the disk source is local. Note that the path is NULL if the
source is not local.
Fixes: a30078cb832646177defd256e77c632905f1e6d0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1814947
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 0e2252f6cf..ef17829235 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -15862,19 +15862,19 @@ qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
}
tmpPath = g_strdup(next->path);
+
+ if (virDevMapperGetTargets(next->path, &targetPaths) < 0 &&
+ errno != ENOSYS && errno != EBADF) {
+ virReportSystemError(errno,
+ _("Unable to get devmapper targets for %s"),
+ next->path);
+ return -1;
+ }
}
if (virStringListAdd(&paths, tmpPath) < 0)
return -1;
- if (virDevMapperGetTargets(next->path, &targetPaths) < 0 &&
- errno != ENOSYS && errno != EBADF) {
- virReportSystemError(errno,
- _("Unable to get devmapper targets for %s"),
- next->path);
- return -1;
- }
-
if (virStringListMerge(&paths, &targetPaths) < 0)
return -1;
}
--
2.24.1
4 years, 9 months
[PATCH 0/2] Fix wrong copy of encryption 'usage' string
by Peter Krempa
Copying the pointer caused double-free when clearing the domain object.
Peter Krempa (2):
virSecretLookupDefCopy: Remove return value
virStorageEncryptionSecretCopy: Properly copy internals
src/util/virsecret.c | 3 +--
src/util/virsecret.h | 4 ++--
src/util/virstorageencryption.c | 8 +++-----
src/util/virstoragefile.c | 3 +--
4 files changed, 7 insertions(+), 11 deletions(-)
--
2.24.1
4 years, 9 months
[PATCH 0/4] qemu: Fix usage of 'slice' and 'luks'
by Peter Krempa
We special cased some behaviour and it broke on combination with other
special case.
Peter Krempa (4):
qemuxml2argvdata/disk-slices: Add test case for 'luks' encryption
qemu: block: Extract logic decision when to use a separate 'raw' layer
for slice
qemuBlockStorageSourceNeedsStorageSliceLayer: Deal with 'luks' files
qemu: block: Split up formatting of JSON props for 'raw' and 'luks'
drivers
src/qemu/qemu_block.c | 70 ++++++++++++++-----
src/qemu/qemu_block.h | 3 +
src/qemu/qemu_domain.c | 3 +-
.../disk-slices.x86_64-latest.args | 41 +++++++----
tests/qemuxml2argvdata/disk-slices.xml | 13 ++++
.../disk-slices.x86_64-latest.xml | 16 ++++-
6 files changed, 112 insertions(+), 34 deletions(-)
--
2.24.1
4 years, 9 months
[PATCH 1/1] conf: qemu 9pfs: add 'multidevs' option
by Christian Schoenebeck
Introduce new 'multidevs' option for filesystem.
<filesystem type='mount' accessmode='mapped' multidevs='remap'>
<source dir='/path'/>
<target dir='mount_tag'>
</filesystem>
This option prevents misbheaviours on guest if a 9pfs export
contains multiple devices, due to the potential file ID collisions
this otherwise may cause.
Signed-off-by: Christian Schoenebeck <qemu_oss(a)crudebyte.com>
---
docs/formatdomain.html.in | 47 ++++++++++++++++++++++++++++++++++-
docs/schemas/domaincommon.rng | 10 ++++++++
src/conf/domain_conf.c | 30 ++++++++++++++++++++++
src/conf/domain_conf.h | 13 ++++++++++
src/qemu/qemu_command.c | 7 ++++++
5 files changed, 106 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 594146009d..13c506988b 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3967,7 +3967,7 @@
<source name='my-vm-template'/>
<target dir='/'/>
</filesystem>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='passthrough' multidevs='remap'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/export/to/guest'/>
<target dir='/import/from/host'/>
@@ -4084,13 +4084,58 @@
</dd>
</dl>
+ <p>
<span class="since">Since 5.2.0</span>, the filesystem element
has an optional attribute <code>model</code> with supported values
"virtio-transitional", "virtio-non-transitional", or "virtio".
See <a href="#elementsVirtioTransitional">Virtio transitional devices</a>
for more details.
+ </p>
+
+ <p>
+ The filesystem element has an optional attribute <code>multidevs</code>
+ which specifies how to deal with a filesystem export containing more than
+ one device, in order to avoid file ID collisions on guest when using 9pfs
+ (<span class="since">since 6.2.0, requires QEMU 4.2</span>).
+ This attribute is not available for virtiofs. The possible values are:
+ </p>
+
+ <dl>
+ <dt><code>default</code></dt>
+ <dd>
+ Use QEMU's default setting (which currently is <code>warn</code>).
+ </dd>
+ <dt><code>remap</code></dt>
+ <dd>
+ This setting allows guest to access multiple devices per export without
+ encountering misbehaviours. Inode numbers from host are automatically
+ remapped on guest to actively prevent file ID collisions if guest
+ accesses one export containing multiple devices.
+ </dd>
+ <dt><code>forbid</code></dt>
+ <dd>
+ Only allow to access one device per export by guest. Attempts to access
+ additional devices on the same export will cause the individual
+ filesystem access by guest to fail with an error and being logged (once)
+ as error on host side.
+ </dd>
+ <dt><code>warn</code></dt>
+ <dd>
+ This setting resembles the behaviour of 9pfs prior to QEMU 4.2, that is
+ no action is performed to prevent any potential file ID collisions if an
+ export contains multiple devices, with the only exception: a warning is
+ logged (once) on host side now. This setting may lead to misbehaviours
+ on guest side if more than one device is exported per export, due to the
+ potential file ID collisions this may cause on guest side in that case.
+ </dd>
+ </dl>
+
</dd>
+ <p>
+ The <code>filesystem</code> element may contain the following subelements:
+ </p>
+
<dt><code>driver</code></dt>
<dd>
The optional driver element allows specifying further details
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 6805420451..9b37740e30 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2676,6 +2676,16 @@
</choice>
</attribute>
</optional>
+ <optional>
+ <attribute name="multidevs">
+ <choice>
+ <value>default</value>
+ <value>remap</value>
+ <value>forbid</value>
+ <value>warn</value>
+ </choice>
+ </attribute>
+ </optional>
<optional>
<element name='readonly'>
<empty/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 71535f53f5..b96f87063a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -501,6 +501,14 @@ VIR_ENUM_IMPL(virDomainFSModel,
"virtio-non-transitional",
);
+VIR_ENUM_IMPL(virDomainFSMultidevs,
+ VIR_DOMAIN_FS_MULTIDEVS_LAST,
+ "default",
+ "remap",
+ "forbid",
+ "warn",
+);
+
VIR_ENUM_IMPL(virDomainFSCacheMode,
VIR_DOMAIN_FS_CACHE_MODE_LAST,
"default",
@@ -11376,6 +11384,7 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
g_autofree char *usage = NULL;
g_autofree char *units = NULL;
g_autofree char *model = NULL;
+ g_autofree char *multidevs = NULL;
ctxt->node = node;
@@ -11414,6 +11423,17 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
}
}
+ multidevs = virXMLPropString(node, "multidevs");
+ if (multidevs) {
+ if ((def->multidevs = virDomainFSMultidevsTypeFromString(multidevs)) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown multidevs '%s'"), multidevs);
+ goto error;
+ }
+ } else {
+ def->multidevs = VIR_DOMAIN_FS_MULTIDEVS_DEFAULT;
+ }
+
if (virDomainParseScaledValue("./space_hard_limit[1]",
NULL, ctxt, &def->space_hard_limit,
1, ULLONG_MAX, false) < 0)
@@ -25397,6 +25417,7 @@ virDomainFSDefFormat(virBufferPtr buf,
const char *accessmode = virDomainFSAccessModeTypeToString(def->accessmode);
const char *fsdriver = virDomainFSDriverTypeToString(def->fsdriver);
const char *wrpolicy = virDomainFSWrpolicyTypeToString(def->wrpolicy);
+ const char *multidevs = virDomainFSMultidevsTypeToString(def->multidevs);
const char *src = def->src->path;
g_auto(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) driverBuf = VIR_BUFFER_INIT_CHILD(buf);
@@ -25415,6 +25436,12 @@ virDomainFSDefFormat(virBufferPtr buf,
return -1;
}
+ if (!multidevs) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected multidevs %d"), def->multidevs);
+ return -1;
+ }
+
virBufferAsprintf(buf,
"<filesystem type='%s' accessmode='%s'",
type, accessmode);
@@ -25422,6 +25449,9 @@ virDomainFSDefFormat(virBufferPtr buf,
virBufferAsprintf(buf, " model='%s'",
virDomainFSModelTypeToString(def->model));
}
+ if (def->multidevs) {
+ virBufferAsprintf(buf, " multidevs='%s'", multidevs);
+ }
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 91b776c28a..23b7924781 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -796,6 +796,18 @@ typedef enum {
VIR_DOMAIN_FS_WRPOLICY_LAST
} virDomainFSWrpolicy;
+/* How to handle exports containing multiple devices. */
+typedef enum {
+ VIR_DOMAIN_FS_MULTIDEVS_DEFAULT = 0, /* Use QEMU's default setting */
+ VIR_DOMAIN_FS_MULTIDEVS_REMAP, /* Remap inodes from host to guest */
+ VIR_DOMAIN_FS_MULTIDEVS_FORBID, /* Prohibit more than one device */
+ VIR_DOMAIN_FS_MULTIDEVS_WARN, /* Just log a warning if multiple devices */
+
+ VIR_DOMAIN_FS_MULTIDEVS_LAST
+} virDomainFSMultidevs;
+
+VIR_ENUM_DECL(virDomainFSMultidevs);
+
typedef enum {
VIR_DOMAIN_FS_MODEL_DEFAULT = 0,
VIR_DOMAIN_FS_MODEL_VIRTIO,
@@ -820,6 +832,7 @@ struct _virDomainFSDef {
int wrpolicy; /* enum virDomainFSWrpolicy */
int format; /* virStorageFileFormat */
int model; /* virDomainFSModel */
+ int multidevs; /* virDomainFSMultidevs */
unsigned long long usage; /* in bytes */
virStorageSourcePtr src;
char *dst;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9790c92cf8..7020e5448c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2632,6 +2632,13 @@ qemuBuildFSStr(virDomainFSDefPtr fs)
} else if (fs->accessmode == VIR_DOMAIN_FS_ACCESSMODE_SQUASH) {
virBufferAddLit(&opt, ",security_model=none");
}
+ if (fs->multidevs == VIR_DOMAIN_FS_MULTIDEVS_REMAP) {
+ virBufferAddLit(&opt, ",multidevs=remap");
+ } else if (fs->multidevs == VIR_DOMAIN_FS_MULTIDEVS_FORBID) {
+ virBufferAddLit(&opt, ",multidevs=forbid");
+ } else if (fs->multidevs == VIR_DOMAIN_FS_MULTIDEVS_WARN) {
+ virBufferAddLit(&opt, ",multidevs=warn");
+ }
} else if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE) {
/* removed since qemu 4.0.0 see v3.1.0-29-g93aee84f57 */
virBufferAddLit(&opt, "handle");
--
2.20.1
4 years, 9 months
[PATCH] tests: switch away from HAVE_SOCKETPAIR
by Pino Toscano
Since the removal of gnulib, HAVE_SOCKETPAIR is no more defined, making
these two tests effectively skipped.
Use the same strategy used in other generic library bits, i.e. exclude
the socketpair usage on Windows.
Semi-related change in virnetdaemontest.c to make it build: since
virutil.h does not include unistd.h anymore, we need to include it.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
tests/virnetdaemontest.c | 4 +++-
tests/virnetserverclienttest.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
index 825487f0a1..09d268627c 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -18,13 +18,15 @@
#include <config.h>
+#include <unistd.h>
+
#include "testutils.h"
#include "virerror.h"
#include "rpc/virnetdaemon.h"
#define VIR_FROM_THIS VIR_FROM_RPC
-#if defined(HAVE_SOCKETPAIR) && defined(WITH_YAJL)
+#if !defined(WIN32) && defined(WITH_YAJL)
struct testClientPriv {
int magic;
};
diff --git a/tests/virnetserverclienttest.c b/tests/virnetserverclienttest.c
index a9a56c48d5..668fd02a1e 100644
--- a/tests/virnetserverclienttest.c
+++ b/tests/virnetserverclienttest.c
@@ -24,7 +24,7 @@
#define VIR_FROM_THIS VIR_FROM_RPC
-#ifdef HAVE_SOCKETPAIR
+#ifndef WIN32
static void *
testClientNew(virNetServerClientPtr client G_GNUC_UNUSED,
--
2.25.1
4 years, 9 months