[libvirt] [PATCH] virBitmap: fix build without HAVE_NUMACTL
by Ján Tomko
Commit 75b198b3e7b2c8b4106afbd42f8bb795c4773511 forgot to change
arguments of dummy qemuProcessInitNumaMemoryPolicy from char* to
virBitmapPtr.
---
src/qemu/qemu_process.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5095381..c28f5a5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1798,7 +1798,7 @@ cleanup:
#else
static int
qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
- const char *nodemask ATTRIBUTE_UNUSED)
+ virBitmapPtr nodemask ATTRIBUTE_UNUSED)
{
if (vm->def->numatune.memory.nodemask) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
--
1.7.8.6
12 years, 2 months
[libvirt] [PATCHv3 0/4] qemu: Add seccomp sandbox support
by Ján Tomko
This series adds support to run QEMU with seccomp sandbox enabled. It can be
configured in qemu.conf to on, off, or the QEMU default, which is off in 1.2.
Default value is the QEMU default.
V1 of the patches supports tri-state configuration and includes a test for
detecting the capability.
V2 includes libvirtd_qemu.aug, renames vague 'sandbox' to 'seccompSandbox'
and prints an error if the sandbox was requested but QEMU doesn't have the
capability.
V3 is a rebase, needed after the addition of usb-redir.filter and the change
of virBitmapPtr to qemuCapsPtr.
Ján Tomko (4):
qemu: add capability flag for seccomp sandbox
qemu: conf: add seccomp_sandbox option
qemu: add -sandbox to command line if requested
tests: add qemu-1.2.0 help data
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 8 +
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 11 ++
src/qemu/qemu_conf.c | 5 +
src/qemu/qemu_conf.h | 1 +
tests/qemuhelpdata/qemu-1.2.0 | 270 ++++++++++++++++++++++++++++++++++
tests/qemuhelpdata/qemu-1.2.0-device | 181 +++++++++++++++++++++++
tests/qemuhelptest.c | 82 ++++++++++
10 files changed, 563 insertions(+), 0 deletions(-)
create mode 100644 tests/qemuhelpdata/qemu-1.2.0
create mode 100644 tests/qemuhelpdata/qemu-1.2.0-device
--
1.7.8.6
12 years, 2 months
[libvirt] [PATCH] qemu: Avoid deadlock on HandleAgentEOF
by Michal Privoznik
On agent EOF the qemuProcessHandleAgentEOF() callback is called
which locks virDomainObjPtr. Then qemuAgentClose() is called
(with domain object locked) which eventually calls qemuAgentFree()
and qemuProcessHandleAgentDestroy(). This tries to lock the
domain object again. Hence the deadlock.
---
src/qemu/qemu_process.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5ac1d2b..8f42c83 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -115,7 +115,7 @@ extern struct qemud_driver *qemu_driver;
* performed
*/
static void
-qemuProcessHandleAgentEOF(qemuAgentPtr agent ATTRIBUTE_UNUSED,
+qemuProcessHandleAgentEOF(qemuAgentPtr agent,
virDomainObjPtr vm)
{
struct qemud_driver *driver = qemu_driver;
@@ -127,12 +127,12 @@ qemuProcessHandleAgentEOF(qemuAgentPtr agent ATTRIBUTE_UNUSED,
virDomainObjLock(vm);
priv = vm->privateData;
-
- qemuAgentClose(agent);
priv->agent = NULL;
virDomainObjUnlock(vm);
qemuDriverUnlock(driver);
+
+ qemuAgentClose(agent);
}
--
1.7.8.6
12 years, 2 months
[libvirt] [PATCH 0/4 v3] Support to set disk wwn
by Osier Yang
v2 - v3:
* Just rebase on the top.
v1 - v2:
* Validate wwn while parsing
* Error out earlier "if (disk->device == "lun" && disk->wwn)", no
logic change.
This introduces new element <wwn> for disk, to allow to set wwn
(just like setting serial number) for the virtual disk (Only QEMU
devices like ide-drive, ide-hd, ide-cd, scsi-disk, scsi-hd, and
scsi-cd support it).
Osier Yang (4):
schema: Add schema for disk <wwn>
conf: Parse and format disk <wwn>
qemu: Add caps to indentify if setting wwn is supported by qemu
qemu: Use disk wwn in qemu command line
docs/formatdomain.html.in | 6 +++
docs/schemas/basictypes.rng | 6 +++
docs/schemas/domaincommon.rng | 5 +++
docs/schemas/nodedev.rng | 6 ---
src/conf/domain_conf.c | 12 +++++++
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 8 ++++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 33 ++++++++++++++++++
src/util/util.c | 17 +++++++++
src/util/util.h | 2 +
.../qemuxml2argv-disk-ide-wwn.args | 6 +++
.../qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml | 28 ++++++++++++++++
.../qemuxml2argv-disk-scsi-disk-wwn.args | 10 ++++++
.../qemuxml2argv-disk-scsi-disk-wwn.xml | 35 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 7 ++++
17 files changed, 179 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.xml
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH 0/3] block commit support
by Eric Blake
I'm still working on the qemu implementation of this API, but
want to get the API reviewed and included in 0.10.2 before adding
piecewise support for more and more of the API. My biggest issues
for current implementations are:
online qemu: Jeff's block-commit API is still not part of qemu.git,
and might be subject to change, in particular based on review from
Paolo's drive-mirror changes (since both patch series will be
sharing related code on how to handle error reporting).
offline qemu: qemu-img is a blocking command, but this API promises
to be asynchronous. I'll have to run qemu-img in a worker thread,
and I still need to figure out whether qemu-img can display progress
for virDomainBlockJobInfo (can you send it a SIGUSR1, like for dd?),
otherwise, the job will look like it is making no progress.
But as neither of those issues invalidate the API, I'm comfortable
with committing the API now (after all, that's what we did back in
0.9.12 with the virDomainBlockRebase API - we committed code in
preparation for qemu to implement drive-mirror, and we are STILL
waiting on qemu to follow through with that promise...)
Obviously, there will be more patches to come as I get more things
working at the qemu layer (I'm not sure whether online or offline
qemu will be done first, as I have branches working on both approaches
while I am testing against Jeff's qemu patch proposals).
Eric Blake (3):
blockjob: add virDomainBlockCommit
blockjob: add virsh blockcommit
blockjob: add blockcommit support to rpc
docs/apibuild.py | 1 +
include/libvirt/libvirt.h.in | 20 ++++++
src/driver.h | 5 ++
src/libvirt.c | 105 +++++++++++++++++++++++++++++
src/libvirt_public.syms | 1 +
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 12 +++-
src/remote_protocol-structs | 9 +++
src/rpc/gendispatch.pl | 1 +
tools/virsh-domain.c | 153 ++++++++++++++++++++++++++++++++++++++++++-
tools/virsh.pod | 30 +++++++++
11 files changed, 336 insertions(+), 2 deletions(-)
--
1.7.11.4
12 years, 2 months
[libvirt] [PATCH] qemu: drop unused arguments for dump-guest-memory
by Eric Blake
Upstream qemu has raised a concern about whether dumping guest
memory by reading guest paging tables is a security hole:
https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02607.html
While auditing libvirt to see if we would be impacted, I noticed
that we had some dead code. It is simpler to nuke the dead code
and limit our monitor code to just the subset we make use of.
* src/qemu/qemu_monitor.h (QEMU_MONITOR_DUMP): Drop poorly named
and mostly-unused enum.
* src/qemu/qemu_monitor.c (qemuMonitorDumpToFd): Drop arguments.
* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDump): Likewise.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDump): Likewise.
* src/qemu/qemu_driver.c (qemuDumpToFd): Update caller.
---
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_monitor.c | 12 ++++--------
src/qemu/qemu_monitor.h | 11 +----------
src/qemu/qemu_monitor_json.c | 24 +++++++-----------------
src/qemu/qemu_monitor_json.h | 5 +----
5 files changed, 14 insertions(+), 40 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f14c220..e6e5d02 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3136,7 +3136,7 @@ static int qemuDumpToFd(struct qemud_driver *driver, virDomainObjPtr vm,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
return -1;
- ret = qemuMonitorDumpToFd(priv->mon, 0, fd, 0, 0);
+ ret = qemuMonitorDumpToFd(priv->mon, fd);
qemuDomainObjExitMonitorWithDriver(driver, vm);
return ret;
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index b7730fd..b772b28 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2045,15 +2045,11 @@ int qemuMonitorMigrateCancel(qemuMonitorPtr mon)
return ret;
}
-int qemuMonitorDumpToFd(qemuMonitorPtr mon,
- unsigned int flags,
- int fd,
- unsigned long long begin,
- unsigned long long length)
+int
+qemuMonitorDumpToFd(qemuMonitorPtr mon, int fd)
{
int ret;
- VIR_DEBUG("mon=%p fd=%d flags=%x begin=%llx length=%llx",
- mon, fd, flags, begin, length);
+ VIR_DEBUG("mon=%p fd=%d", mon, fd);
if (!mon) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -2073,7 +2069,7 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
if (qemuMonitorSendFileHandle(mon, "dump", fd) < 0)
return -1;
- ret = qemuMonitorJSONDump(mon, flags, "fd:dump", begin, length);
+ ret = qemuMonitorJSONDump(mon, "fd:dump");
if (ret < 0) {
if (qemuMonitorCloseFileHandle(mon, "dump") < 0)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index e37dac8..232ae96 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -387,17 +387,8 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
int qemuMonitorMigrateCancel(qemuMonitorPtr mon);
-typedef enum {
- QEMU_MONITOR_DUMP_HAVE_FILTER = 1 << 0,
- QEMU_MONITOR_DUMP_PAGING = 1 << 1,
- QEMU_MONITOR_DUMP_FLAGS_LAST
-} QEMU_MONITOR_DUMP;
-
int qemuMonitorDumpToFd(qemuMonitorPtr mon,
- unsigned int flags,
- int fd,
- unsigned long long begin,
- unsigned long long length);
+ int fd);
int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
int type,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index b23be1e..a5198b0 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2552,28 +2552,18 @@ int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon)
return ret;
}
-int qemuMonitorJSONDump(qemuMonitorPtr mon,
- unsigned int flags,
- const char *protocol,
- unsigned long long begin,
- unsigned long long length)
+int
+qemuMonitorJSONDump(qemuMonitorPtr mon,
+ const char *protocol)
{
int ret;
virJSONValuePtr cmd = NULL;
virJSONValuePtr reply = NULL;
- if (flags & QEMU_MONITOR_DUMP_HAVE_FILTER)
- cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
- "b:paging", flags & QEMU_MONITOR_DUMP_PAGING ? 1 : 0,
- "s:protocol", protocol,
- "U:begin", begin,
- "U:length", length,
- NULL);
- else
- cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
- "b:paging", flags & QEMU_MONITOR_DUMP_PAGING ? 1 : 0,
- "s:protocol", protocol,
- NULL);
+ cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
+ "b:paging", false,
+ "s:protocol", protocol,
+ NULL);
if (!cmd)
return -1;
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index bdcf819..b592d12 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -138,10 +138,7 @@ int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);
int qemuMonitorJSONDump(qemuMonitorPtr mon,
- unsigned int flags,
- const char *protocol,
- unsigned long long begin,
- unsigned long long length);
+ const char *protocol);
int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
int type,
--
1.7.11.4
12 years, 2 months
[libvirt] [PATCH 0/3]generate man pages to describe valid keycodes
by Guannan Ren
This patchset will try to generate manpages to describe valid keycodes.
It does this job via a helper perl script passing file src/util/keymaps.csv.
we have 1 man page per keycode set, that is, 11 manpages to be generated
in total. Each of them corresponds to codeset defined in virsh manpage.
libvirt-keycode-linux.5
libvirt-keycode-xt.5
libvirt-keycode-atset1.5
libvirt-keycode-atset2.5
libvirt-keycode-atset3.5
libvirt-keycode-os_x.5
libvirt-keycode-kbd.5
libvirt-keycode-win32.5
libvirt-keycode-usb.5
libvirt-keycode-rfb.5
I really think that the words in these manpages still be polished again.
If anyone could help, that would be appreciated.
Guannan Ren(3)
doc: Add a perl script to generate keycodes mapping
automake: generate libvirt keycodes manpages
doc: fix some typoes on virsh manpage
.gitignore | 2 +-
tools/Makefile.am | 31 +++++++++++++++++++++++++---
tools/keymap-gen.pl | 202 +++++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 27 +++++++++++++------------
4 files changed, 245 insertions(+), 17 deletions(-)
12 years, 2 months
[libvirt] [PATCH] build: Fix build failure on mingw32 platform
by Osier Yang
---
I'm not sure if we prefer indentions inside the block between
"#ifdef __linux__" ... "#else" clause. nodeinfo.c uses both
(indentions/no indentions).
---
src/nodeinfo.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 7af6512..1ec3ada 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -971,13 +971,14 @@ cleanup:
int
nodeSetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
- virTypedParameterPtr params,
- int nparams,
+ virTypedParameterPtr params ATTRIBUTE_UNUSED,
+ int nparams ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCheckFlags(0, -1);
#ifdef __linux__
+ {
int ret = 0;
int i;
@@ -1010,6 +1011,7 @@ nodeSetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
}
return ret;
+ }
#else
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("node set memory parameters not implemented"
@@ -1066,13 +1068,14 @@ cleanup:
#define NODE_MEMORY_PARAMETERS_NUM 7
int
nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
- virTypedParameterPtr params,
- int *nparams,
+ virTypedParameterPtr params ATTRIBUTE_UNUSED,
+ int *nparams ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
#ifdef __linux__
+ {
unsigned int pages_to_scan;
unsigned int sleep_millisecs;
unsigned long long pages_shared;
@@ -1174,6 +1177,7 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
}
return 0;
+ }
#else
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("node get memory parameters not implemented"
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH] virsh: Clarify behavior of domain list filtering.
by Peter Krempa
Some combinations of filtering flags produce no result. This patch tries
to clarify this.
Also fix unintentional double space.
---
tools/virsh.pod | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index c6f205a..2efb277 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -395,10 +395,11 @@ into s3 state.
Normally only active domains are listed. To list inactive domains specify
I<--inactive> or I<--all> to list both active and inactive domains.
-To filter the list of domains present on the hypervisor you may specify one or
-more of filtering flags supported by the B<list> command. These flags are
-grouped by function. Specifying one or more flags from a group enables the
-filter group. Supported filtering flags and groups:
+To further filter the list of domains you may specify one or more of filtering
+flags supported by the B<list> command. These flags are grouped by function.
+Specifying one or more flags from a group enables the filter group. Note that
+some combinations of flags may yield no results. Supported filtering flags and
+groups:
=over 4
@@ -435,7 +436,7 @@ domains without a snapshot I<--without-snapshot>.
When talking to older servers, this command is forced to use a series of API
calls with an inherent race, where a domain might not be listed or might appear
more than once if it changed state between calls while the list was being
-collected. Newer servers do not have this problem.
+collected. Newer servers do not have this problem.
If I<--managed-save> is specified, then domains that have managed save state
(only possible if they are in the B<shut off> state, so you need to specify
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] build: fix missing include
by Dwight Engen
virNWFilterSnoopAdjustPoll() uses a struct pollfd but poll.h is never included
nwfilter/nwfilter_dhcpsnoop.c:1297: error: 'struct pollfd' declared inside parameter list
---
src/nwfilter/nwfilter_dhcpsnoop.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index eb03f9d..04dd37a 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -47,6 +47,7 @@
#endif
#include <fcntl.h>
+#include <poll.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
--
1.7.1
12 years, 2 months