[libvirt] Guest log getting written in cache directory rather /var/log/libvirt/qemu
by Richa Marwaha
Hi Everyone
I am running libvirt with selinux driver under unprivileged user and the
Guest.log file is not written into /var/log/libvirt/qemu/Guest.log but
remains in Home Directory/.cache/libvirt/qemu/log/Guest.log.
Does anyone know why its not writing to the required log location.
Thanks
Regards,
Richa Marwaha
LTC Security
Email address:rmarwah@us.ibm.com
12 years, 3 months
[libvirt] [PATCH] network: fix virtual network bridge delay setting
by Laine Stump
libvirt's network config documents that a bridge's STP "forward delay"
(called "delay" in the XML) should be specified in seconds, but
virNetDevBridgeSetSTPDelay() assumes that it is given a delay in
milliseconds (although the comment at the top of the function
incorrectly says "seconds".
This fixes the comment, and converts the delay to milliseconds before
calling virNetDevBridgeSetSTPDelay().
---
(Fortunately the default delay (and what most people set) is 0)
src/network/bridge_driver.c | 6 +++++-
src/util/virnetdevbridge.c | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 59b2c10..53eebed 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1826,8 +1826,12 @@ networkStartNetworkVirtual(struct network_driver *driver,
}
/* Set bridge options */
+
+ /* delay is configured in seconds, but virNetDevBridgeSetSTPDelay
+ * expects milliseconds
+ */
if (virNetDevBridgeSetSTPDelay(network->def->bridge,
- network->def->delay) < 0)
+ network->def->delay * 1000) < 0)
goto err1;
if (virNetDevBridgeSetSTP(network->def->bridge,
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index a616d8e..7b11bee 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007-2011 Red Hat, Inc.
+ * Copyright (C) 2007-2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -378,7 +378,7 @@ int virNetDevBridgeRemovePort(const char *brname,
/**
* virNetDevBridgeSetSTPDelay:
* @brname: the bridge name
- * @delay: delay in seconds
+ * @delay: delay in milliseconds
*
* Set the bridge forward delay
*
--
1.7.11.4
12 years, 3 months
[libvirt] [PATCH v4 0/3] Per-guest S3/S4 configuration
by Martin Kletzander
There is a way to tell qemu how (not) to advertise S3/S4 ACPI sleep
state capability to the guest OS. This series includes the capability
to set this in the XML and also covers all the handling from qemu
point of view including checking for the support, parameter parsing,
command building, checking before sending the signals through guest
agent and also tests and documentation.
--
v4:
- Changed attributes to elements
- Merged documentation with XML extension
- Fixed error reporting and other tweaks Michal pointed out
v3:
- Option names are change according to Eric and Doug
- Added docs (formatdomain)
v2:
- Modified the patch to reflect danpb's notes (according to qemu
people the setting the disable_s[34] parameter to 0/1 ensures that
the states will be enabled/disabled respectively)
*** BLURB HERE ***
Martin Kletzander (3):
Add per-guest S3/S4 state configuration
qemu: Add support for S3/S4 state configuration
tests: Add tests for qemu S3/S4 state configuration
docs/formatdomain.html.in | 24 +++++++++
docs/schemas/domaincommon.rng | 39 ++++++++++++++
src/conf/domain_conf.c | 52 +++++++++++++++++-
src/conf/domain_conf.h | 15 ++++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 7 +++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 62 ++++++++++++++++++++++
src/qemu/qemu_driver.c | 17 ++++++
tests/qemuargv2xmltest.c | 3 ++
.../qemuxml2argv-misc-disable-s3.args | 4 ++
.../qemuxml2argv-misc-disable-s3.xml | 29 ++++++++++
.../qemuxml2argv-misc-disable-suspends.args | 4 ++
.../qemuxml2argv-misc-disable-suspends.xml | 30 +++++++++++
.../qemuxml2argv-misc-enable-s4.args | 4 ++
.../qemuxml2argv-misc-enable-s4.xml | 29 ++++++++++
tests/qemuxml2argvtest.c | 4 ++
tests/qemuxml2xmltest.c | 3 ++
18 files changed, 329 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.xml
--
1.7.12
12 years, 3 months
[libvirt] [PATCH] qemu: forbid suspend if already pmsuspended
by Michal Privoznik
If a domain is pmsuspended then virsh suspend will succeed. Beside
obvious flaw, virsh resume will report success and change domain
state to running which is another mistake. Therefore we must forbid
any attempts for suspend and resume when pmsuspended.
---
src/libvirt.c | 4 ++++
src/qemu/qemu_driver.c | 18 ++++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index e0ac391..b034ed6 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2329,6 +2329,8 @@ virDomainRef(virDomainPtr domain)
* hypervisor level will stay allocated. Use virDomainResume() to reactivate
* the domain.
* This function may require privileged access.
+ * Moreover, suspend may not be supported if domain is in some
+ * special state like VIR_DOMAIN_PMSUSPENDED.
*
* Returns 0 in case of success and -1 in case of failure.
*/
@@ -2375,6 +2377,8 @@ error:
* Resume a suspended domain, the process is restarted from the state where
* it was frozen by calling virDomainSuspend().
* This function may require privileged access
+ * Moreover, resume may not be supported if domain is in some
+ * special state like VIR_DOMAIN_PMSUSPENDED.
*
* Returns 0 in case of success and -1 in case of failure.
*/
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8c7b34d..256fa71 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1572,6 +1572,7 @@ static int qemudDomainSuspend(virDomainPtr dom) {
qemuDomainObjPrivatePtr priv;
virDomainPausedReason reason;
int eventDetail;
+ int state;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -1607,7 +1608,13 @@ static int qemudDomainSuspend(virDomainPtr dom) {
"%s", _("domain is not running"));
goto endjob;
}
- if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
+
+ state = virDomainObjGetState(vm, NULL);
+ if (state == VIR_DOMAIN_PMSUSPENDED) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is pmsuspended"));
+ goto endjob;
+ } else if (state != VIR_DOMAIN_PAUSED) {
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0) {
goto endjob;
}
@@ -1639,6 +1646,7 @@ static int qemudDomainResume(virDomainPtr dom) {
virDomainObjPtr vm;
int ret = -1;
virDomainEventPtr event = NULL;
+ int state;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -1659,7 +1667,13 @@ static int qemudDomainResume(virDomainPtr dom) {
"%s", _("domain is not running"));
goto endjob;
}
- if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
+
+ state = virDomainObjGetState(vm, NULL);
+ if (state == VIR_DOMAIN_PMSUSPENDED) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is pmsuspended"));
+ goto endjob;
+ } else if (state == VIR_DOMAIN_PAUSED) {
if (qemuProcessStartCPUs(driver, vm, dom->conn,
VIR_DOMAIN_RUNNING_UNPAUSED,
QEMU_ASYNC_JOB_NONE) < 0) {
--
1.7.8.6
12 years, 3 months
[libvirt] [PATCH] qemu-agent: available in 0.10.0
by Eric Blake
The recent virDomainQemuAgentCommand addition is part of 0.10.0;
also, grouping all libvirt-qemu.so callbacks together makes them
easier to identify.
* src/libvirt_qemu.syms: Fix release symbol.
* src/qemu/qemu_driver.c (qemuDriver): Likewise.
* src/remote/remote_driver.c (remote_driver): Likewise.
* src/driver.h (_virDriver): Group qemu-specific callbacks.
---
Pushing under the trivial rule.
src/driver.h | 2 +-
src/libvirt_qemu.syms | 2 +-
src/qemu/qemu_driver.c | 2 +-
src/remote/remote_driver.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/driver.h b/src/driver.h
index ccb01dc..e88ab28 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -1043,6 +1043,7 @@ struct _virDriver {
virDrvDomainSnapshotDelete domainSnapshotDelete;
virDrvDomainQemuMonitorCommand qemuDomainMonitorCommand;
virDrvDomainQemuAttach qemuDomainAttach;
+ virDrvDomainQemuAgentCommand qemuDomainArbitraryAgentCommand;
virDrvDomainOpenConsole domainOpenConsole;
virDrvDomainOpenGraphics domainOpenGraphics;
virDrvDomainInjectNMI domainInjectNMI;
@@ -1067,7 +1068,6 @@ struct _virDriver {
virDrvDomainGetDiskErrors domainGetDiskErrors;
virDrvDomainSetMetadata domainSetMetadata;
virDrvDomainGetMetadata domainGetMetadata;
- virDrvDomainQemuAgentCommand qemuDomainArbitraryAgentCommand;
};
typedef int
diff --git a/src/libvirt_qemu.syms b/src/libvirt_qemu.syms
index 6e11509..f968d91 100644
--- a/src/libvirt_qemu.syms
+++ b/src/libvirt_qemu.syms
@@ -20,7 +20,7 @@ LIBVIRT_QEMU_0.9.4 {
virDomainQemuAttach;
} LIBVIRT_QEMU_0.8.3;
-LIBVIRT_QEMU_0.10.1 {
+LIBVIRT_QEMU_0.10.0 {
global:
virDomainQemuAgentCommand;
} LIBVIRT_QEMU_0.9.4;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3948bef..baeb03b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14013,6 +14013,7 @@ static virDriver qemuDriver = {
.domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */
.qemuDomainMonitorCommand = qemuDomainMonitorCommand, /* 0.8.3 */
.qemuDomainAttach = qemuDomainAttach, /* 0.9.4 */
+ .qemuDomainArbitraryAgentCommand = qemuDrvDomainAgentCommand, /* 0.10.0 */
.domainOpenConsole = qemuDomainOpenConsole, /* 0.8.6 */
.domainOpenGraphics = qemuDomainOpenGraphics, /* 0.9.7 */
.domainInjectNMI = qemuDomainInjectNMI, /* 0.9.2 */
@@ -14042,7 +14043,6 @@ static virDriver qemuDriver = {
.domainPMSuspendForDuration = qemuDomainPMSuspendForDuration, /* 0.9.11 */
.domainPMWakeup = qemuDomainPMWakeup, /* 0.9.11 */
.domainGetCPUStats = qemuDomainGetCPUStats, /* 0.9.11 */
- .qemuDomainArbitraryAgentCommand = qemuDrvDomainAgentCommand, /* 0.10.1 */
};
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index f0484a7..cf1f079 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -5530,6 +5530,7 @@ static virDriver remote_driver = {
.domainSnapshotDelete = remoteDomainSnapshotDelete, /* 0.8.0 */
.qemuDomainMonitorCommand = remoteQemuDomainMonitorCommand, /* 0.8.3 */
.qemuDomainAttach = qemuDomainAttach, /* 0.9.4 */
+ .qemuDomainArbitraryAgentCommand = qemuDomainAgentCommand, /* 0.10.0 */
.domainOpenConsole = remoteDomainOpenConsole, /* 0.8.6 */
.domainOpenGraphics = remoteDomainOpenGraphics, /* 0.9.7 */
.domainInjectNMI = remoteDomainInjectNMI, /* 0.9.2 */
@@ -5557,7 +5558,6 @@ static virDriver remote_driver = {
.domainSetMetadata = remoteDomainSetMetadata, /* 0.9.10 */
.domainGetMetadata = remoteDomainGetMetadata, /* 0.9.10 */
.domainGetHostname = remoteDomainGetHostname, /* 0.10.0 */
- .qemuDomainArbitraryAgentCommand = qemuDomainAgentCommand, /* 0.10.1 */
};
static virNetworkDriver network_driver = {
--
1.7.11.4
12 years, 3 months
[libvirt] [PATCH v4 0/7] support guest agent general command
by MATSUDA, Daiki
Hi. All.
I rewrote the patched for git head tree, adding some code.
And @timeout must be following
VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK(-2) : does not block and wait forever.
VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT(-1) : use default time for waiting
VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWIAT(0) : does not wait and out soon
positive value : wait for pointed seconds.
And I also add VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN for not writing static value.
In addition, I added the some options for virsh command qemu-agent-command
--block : it means taht @timeout is VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK.
--async : it means taht @timeout is VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWIAT.
--timeout @seconds : @seconds must be positive value and it means that @timeout
is positive value case.
These upper options are exclusive.
If no options are given, it means taht @timeout is IR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT.
virsh # help qemu-agent-command
NAME
qemu-agent-command - QEMU Guest Agent Command
SYNOPSIS
qemu-agent-command <domain> [--timeout <number>] [--async] [--block] {[--cmd] <string>}...
DESCRIPTION
Run an arbitrary qemu guest agent command; use at your own risk
OPTIONS
[--domain] <string> domain name, id or uuid
--timeout <number> timeout seconds. must be positive.
--async execute command without waiting for timeout
--block execute command without timeout
[--cmd] <string> command
virsh # qemu-agent-command RHEL58_64 '{"execute":"guest-info"}'
{"return":{"version":"1.1.50","supported_commands":[{"enabled":true,"name":"guest-network-get-interfaces"},{"enabled":true,"name":"guest-suspend-hybrid"},{"enabled":true,"name":"guest-suspend-ram"},{"enabled":true,"name":"guest-suspend-disk"},{"enabled":true,"name":"guest-fsfreeze-thaw"},{"enabled":true,"name":"guest-fsfreeze-freeze"},{"enabled":true,"name":"guest-fsfreeze-status"},{"enabled":true,"name":"guest-file-flush"},{"enabled":true,"name":"guest-file-seek"},{"enabled":true,"name":"guest-file-write"},{"enabled":true,"name":"guest-file-read"},{"enabled":true,"name":"guest-file-close"},{"enabled":true,"name":"guest-file-open"},{"enabled":true,"name":"guest-shutdown"},{"enabled":true,"name":"guest-info"},{"enabled":true,"name":"guest-ping"},{"enabled":true,"name":"guest-sync"},{"enabled":true,"name":"guest-sync-delimited"}]}}
virsh # qemu-agent-command --block RHEL58_64 '{"execute":"guest-sync","arguments":{"id":123}}'
{"return":123}
12 years, 3 months
[libvirt] [PATCH v2 libvirt-virshcmdref] Add blockpull and blockjob commands
by Stefan Hajnoczi
The blockpull and blockjob commands have been present since 0.9.4. This
patch adds basic usage examples and command syntax.
Signed-off-by: Stefan Hajnoczi <stefanha(a)linux.vnet.ibm.com>
---
v2:
* Linewrap to 80 chars except pre-formatted <terminal> tag [Eric]
* 'path' argument can be <target dev='name'> or <source file='name'> [Eric]
* s/cancelation/cancellation/ [Eric]
* Use blockpull --base option to avoid bandwidth 0 positional argument [Eric]
* Drop blockjob --pivot argument, it doesn't work yet and I didn't document it
common.sh | 8 ++--
source/blockjob.xml | 81 ++++++++++++++++++++++++++++++++++++
source/blockpull.xml | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 196 insertions(+), 4 deletions(-)
create mode 100644 source/blockjob.xml
create mode 100644 source/blockpull.xml
diff --git a/common.sh b/common.sh
index 9da1b13..7e3a3a0 100755
--- a/common.sh
+++ b/common.sh
@@ -1,9 +1,9 @@
# List of source files
DOMAIN_COMMANDS="attach-device attach-disk attach-interface autostart
- blkiotune console cpu-baseline cpu-compare create define destroy
- detach-device detach-disk detach-interface domid domjobabort domjobinfo
- domname domuuid domxml-from-native domxml-to-native dump dumpxml echo
- edit freecell hostname inject-nmi managedsave managedsave-remove
+ blkiotune blockjob blockpull console cpu-baseline cpu-compare create define
+ destroy detach-device detach-disk detach-interface domid domjobabort
+ domjobinfo domname domuuid domxml-from-native domxml-to-native dump dumpxml
+ echo edit freecell hostname inject-nmi managedsave managedsave-remove
maxvcpus memtune migrate migrate-setmaxdowntime migrate-getspeed
migrate-setspeed reboot restore resume save schedinfo send-key
setmaxmem setmem setvcpus shutdown start suspend ttyconsole undefine
diff --git a/source/blockjob.xml b/source/blockjob.xml
new file mode 100644
index 0000000..1763c3c
--- /dev/null
+++ b/source/blockjob.xml
@@ -0,0 +1,81 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+<command>
+ <name>blockjob</name>
+
+ <description>
+ <text>
+ Manage active block operations
+ </text>
+ </description>
+
+ <options>
+ <parameter requirement="required">
+ <value type="string" requirement="required">domain</value>
+ <description>
+ The name of the domain on which to act.
+ </description>
+ </parameter>
+ <parameter requirement="required">
+ <value type="string" requirement="required">path</value>
+ <description>
+ Either the <italic><source file='path'></italic> filename or the
+ <italic><target dev='path'></italic> device name. See
+ "domblklist" for listing these names.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--abort</keyword>
+ <description>
+ Abort the active job on the specified disk.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--async</keyword>
+ <description>
+ Return immediately instead of waiting for cancellation to complete,
+ when specified together with "--abort".
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--info</keyword>
+ <description>
+ Print information about any active block operation.
+ </description>
+ </parameter>
+ </options>
+
+ <availability from="0.9.4" />
+
+ <notes />
+
+ <examples type="usage">
+ <example>
+ <terminal>virsh # <bold>blockjob</bold> <value>example-domain</value> <value>vda</value> <italic>--info</italic></terminal>
+ <text>
+ Prints information about any active block operation on
+ <value>vda</value> from <value>example-domain</value>.
+ </text>
+ </example>
+ <example>
+ <terminal>virsh # <bold>blockjob</bold> <value>example-domain</value> <value>vda</value> <italic>--abort</italic></terminal>
+ <text>
+ Cancels the active block operation on <value>vda</value> from
+ <value>example-domain</value>.
+ </text>
+ </example>
+ </examples>
+
+ <examples type="fullcontext" />
+
+ <reference type="seealso">
+ <item>
+ <link type="internal" href="blockpull" />
+ <name>blockpull</name>
+ <description>
+ populate a disk from its backing image chain
+ </description>
+ </item>
+ </reference>
+
+</command>
diff --git a/source/blockpull.xml b/source/blockpull.xml
new file mode 100644
index 0000000..15014a6
--- /dev/null
+++ b/source/blockpull.xml
@@ -0,0 +1,111 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+<command>
+ <name>blockpull</name>
+
+ <description>
+ <text>
+ Populate a disk from its backing image chain
+ </text>
+ </description>
+
+ <options>
+ <parameter requirement="required">
+ <value type="string" requirement="required">domain</value>
+ <description>
+ The name of the domain on which to act.
+ </description>
+ </parameter>
+ <parameter requirement="required">
+ <value type="string" requirement="required">path</value>
+ <description>
+ Either the <italic><source file='path'></italic> filename or the
+ <italic><target dev='path'></italic> device name. See
+ "domblklist" for listing these names.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <value type="number" requirement="required">bandwidth</value>
+ <description>
+ Copying bandwidth limit in MiB/s.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <value type="string" requirement="required">base</value>
+ <description>
+ Stop at a specific backing image instead of flattening the entire
+ chain.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--wait</keyword>
+ <description>
+ Block until the operation completes instead of returning as soon as
+ possible while the operation runs in the background.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--verbose</keyword>
+ <description>
+ Print periodic status updates when used together with "--wait".
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--timeout</keyword>
+ <value type="number" requirement="required">seconds</value>
+ <description>
+ Cancel the operation if the timeout elapses. Use together with
+ "--wait".
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--async</keyword>
+ <description>
+ Return as soon as possible.
+ </description>
+ </parameter>
+ </options>
+
+ <availability from="0.9.4" />
+
+ <notes />
+
+ <examples type="usage">
+ <example>
+ <terminal>virsh # <bold>blockpull</bold> <value>example-domain</value> <value>vda</value></terminal>
+ <text>
+ Start populating <value>vda</value> from its backing image chain and
+ return immediately.
+ </text>
+ </example>
+ <example>
+ <terminal>virsh # <bold>blockpull</bold> <value>example-domain</value> <value>vda</value> <italic>--wait</italic></terminal>
+ <text>
+ Populate <value>vda</value> from its backing image chain and wait for
+ the operation to complete.
+ </text>
+ </example>
+ <example>
+ <terminal>virsh # <bold>blockpull</bold> <value>example-domain</value> <value>vda</value> <italic>--base</italic> <value>/path/to/backing.img</value></terminal>
+ <text>
+ Start populating <value>vda</value> from its backing image chain up to
+ <value>/path/to/backing.img</value> and return immediately.
+ <value>/path/to/backing.img</value> and its backing images will not be
+ flattened.
+ </text>
+ </example>
+ </examples>
+
+ <examples type="fullcontext" />
+
+ <reference type="seealso">
+ <item>
+ <link type="internal" href="blockjob" />
+ <name>blockjob</name>
+ <description>
+ manage active block operations
+ </description>
+ </item>
+ </reference>
+
+</command>
--
1.7.10.4
12 years, 3 months
[libvirt] [PATCH] Fix a missing build requirement on dbus-devel
by Daniel Veillard
Communication with the firewall daemon uses DBus
so if we compile with firewalld support, the dbus-devel
is required for building
pushed under build breaker rules
diff --git a/libvirt.spec.in b/libvirt.spec.in
index ea2fd88..18a7fb8 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -521,6 +521,11 @@ BuildRequires: util-linux
BuildRequires: nfs-utils
%endif
+%if %{with_firewalld}
+# Communication with the firewall daemon uses DBus
+BuildRequires: dbus-devel
+%endif
+
# Fedora build root suckage
BuildRequires: gawk
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 3 months
[libvirt] [PATCH] docs: fix blockpull/blockcopy bandwidth Mbps -> MiB/s
by Stefan Hajnoczi
The bandwidth units for blockpull and blockcopy are in Megabytes per
Second, not Megabits per Second.
Signed-off-by: Stefan Hajnoczi <stefanha(a)linux.vnet.ibm.com>
---
src/libvirt.c | 10 +++++-----
tools/virsh.pod | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 60ce6d1..e0ac391 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -18344,7 +18344,7 @@ error:
* virDomainBlockJobSetSpeed:
* @dom: pointer to domain object
* @disk: path to the block device, or device shorthand
- * @bandwidth: specify bandwidth limit in Mbps
+ * @bandwidth: specify bandwidth limit in MiB/s
* @flags: extra flags; not used yet, so callers should always pass 0
*
* Set the maximimum allowable bandwidth that a block job may consume. If
@@ -18402,7 +18402,7 @@ error:
* virDomainBlockPull:
* @dom: pointer to domain object
* @disk: path to the block device, or device shorthand
- * @bandwidth: (optional) specify copy bandwidth limit in Mbps
+ * @bandwidth: (optional) specify copy bandwidth limit in MiB/s
* @flags: extra flags; not used yet, so callers should always pass 0
*
* Populate a disk image with data from its backing image. Once all data from
@@ -18419,7 +18419,7 @@ error:
* can be found by calling virDomainGetXMLDesc() and inspecting
* elements within //domain/devices/disk.
*
- * The maximum bandwidth (in Mbps) that will be used to do the copy can be
+ * The maximum bandwidth (in MiB/s) that will be used to do the copy can be
* specified with the bandwidth parameter. If set to 0, libvirt will choose a
* suitable default. Some hypervisors do not support this feature and will
* return an error if bandwidth is not 0; in this case, it might still be
@@ -18475,7 +18475,7 @@ error:
* @dom: pointer to domain object
* @disk: path to the block device, or device shorthand
* @base: path to backing file to keep, or NULL for no backing file
- * @bandwidth: (optional) specify copy bandwidth limit in Mbps
+ * @bandwidth: (optional) specify copy bandwidth limit in MiB/s
* @flags: bitwise-OR of virDomainBlockRebaseFlags
*
* Populate a disk image with data from its backing image chain, and
@@ -18535,7 +18535,7 @@ error:
* can be found by calling virDomainGetXMLDesc() and inspecting
* elements within //domain/devices/disk.
*
- * The maximum bandwidth (in Mbps) that will be used to do the copy can be
+ * The maximum bandwidth (in MiB/s) that will be used to do the copy can be
* specified with the bandwidth parameter. If set to 0, libvirt will choose a
* suitable default. Some hypervisors do not support this feature and will
* return an error if bandwidth is not 0; in this case, it might still be
diff --git a/tools/virsh.pod b/tools/virsh.pod
index e932d7c..424f1d9 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -723,7 +723,7 @@ the command may continue to block a little while longer until the job
is done cleaning up.
I<path> specifies fully-qualified path of the disk.
-I<bandwidth> specifies copying bandwidth limit in Mbps.
+I<bandwidth> specifies copying bandwidth limit in MiB/s.
=item B<blockpull> I<domain> I<path> [I<bandwidth>] [I<base>]
[I<--wait> [I<--verbose>] [I<--timeout> B<seconds>] [I<--async]]
@@ -750,7 +750,7 @@ I<path> specifies fully-qualified path of the disk; it corresponds
to a unique target name (<target dev='name'/>) or source file (<source
file='name'/>) for one of the disk devices attached to I<domain> (see
also B<domblklist> for listing these names).
-I<bandwidth> specifies copying bandwidth limit in Mbps.
+I<bandwidth> specifies copying bandwidth limit in MiB/s.
=item B<blkdeviotune> I<domain> I<device>
[[I<--config>] [I<--live>] | [I<--current>]]
--
1.7.10.4
12 years, 3 months
[libvirt] [PATCH libvirt-virshcmdref] Add blockpull and blockjob commands
by Stefan Hajnoczi
The blockpull and blockjob commands have been present since 0.9.4. This
patch adds basic usage examples and command syntax.
Signed-off-by: Stefan Hajnoczi <stefanha(a)linux.vnet.ibm.com>
---
common.sh | 8 ++--
source/blockjob.xml | 79 +++++++++++++++++++++++++++++++++++++++
source/blockpull.xml | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 184 insertions(+), 4 deletions(-)
create mode 100644 source/blockjob.xml
create mode 100644 source/blockpull.xml
diff --git a/common.sh b/common.sh
index 9da1b13..7e3a3a0 100755
--- a/common.sh
+++ b/common.sh
@@ -1,9 +1,9 @@
# List of source files
DOMAIN_COMMANDS="attach-device attach-disk attach-interface autostart
- blkiotune console cpu-baseline cpu-compare create define destroy
- detach-device detach-disk detach-interface domid domjobabort domjobinfo
- domname domuuid domxml-from-native domxml-to-native dump dumpxml echo
- edit freecell hostname inject-nmi managedsave managedsave-remove
+ blkiotune blockjob blockpull console cpu-baseline cpu-compare create define
+ destroy detach-device detach-disk detach-interface domid domjobabort
+ domjobinfo domname domuuid domxml-from-native domxml-to-native dump dumpxml
+ echo edit freecell hostname inject-nmi managedsave managedsave-remove
maxvcpus memtune migrate migrate-setmaxdowntime migrate-getspeed
migrate-setspeed reboot restore resume save schedinfo send-key
setmaxmem setmem setvcpus shutdown start suspend ttyconsole undefine
diff --git a/source/blockjob.xml b/source/blockjob.xml
new file mode 100644
index 0000000..0c34bae
--- /dev/null
+++ b/source/blockjob.xml
@@ -0,0 +1,79 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+<command>
+ <name>blockjob</name>
+
+ <description>
+ <text>
+ Manage active block operations
+ </text>
+ </description>
+
+ <options>
+ <parameter requirement="required">
+ <value type="string" requirement="required">domain</value>
+ <description>
+ The name of the domain on which to act.
+ </description>
+ </parameter>
+ <parameter requirement="required">
+ <value type="string" requirement="required">path</value>
+ <description>
+ The fully-qualified path of the disk. See "domblklist" for listing these names.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--abort</keyword>
+ <description>
+ Abort the active job on the specified disk.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--async</keyword>
+ <description>
+ Return immediately instead of waiting for cancelation to complete, when specified together with "--abort".
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--pivot</keyword>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--info</keyword>
+ <description>
+ Print information about any active block operation.
+ </description>
+ </parameter>
+ </options>
+
+ <availability from="0.9.4" />
+
+ <notes />
+
+ <examples type="usage">
+ <example>
+ <terminal>virsh # <bold>blockjob</bold> <value>example-domain</value> <value>vda</value> <italic>--info</italic></terminal>
+ <text>
+ Prints information about any active block operation on <value>vda</value> from <value>example-domain</value>.
+ </text>
+ </example>
+ <example>
+ <terminal>virsh # <bold>blockjob</bold> <value>example-domain</value> <value>vda</value> <italic>--abort</italic></terminal>
+ <text>
+ Cancels the active block operation on <value>vda</value> from <value>example-domain</value>.
+ </text>
+ </example>
+ </examples>
+
+ <examples type="fullcontext" />
+
+ <reference type="seealso">
+ <item>
+ <link type="internal" href="blockpull" />
+ <name>blockpull</name>
+ <description>
+ populate a disk from its backing image chain
+ </description>
+ </item>
+ </reference>
+
+</command>
diff --git a/source/blockpull.xml b/source/blockpull.xml
new file mode 100644
index 0000000..81b58da
--- /dev/null
+++ b/source/blockpull.xml
@@ -0,0 +1,101 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+<command>
+ <name>blockpull</name>
+
+ <description>
+ <text>
+ Populate a disk from its backing image chain
+ </text>
+ </description>
+
+ <options>
+ <parameter requirement="required">
+ <value type="string" requirement="required">domain</value>
+ <description>
+ The name of the domain on which to act.
+ </description>
+ </parameter>
+ <parameter requirement="required">
+ <value type="string" requirement="required">path</value>
+ <description>
+ The fully-qualified path of the disk. See "domblklist" for listing these names.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <value type="number" requirement="required">bandwidth</value>
+ <description>
+ Copying bandwidth limit in MiB/s.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <value type="string" requirement="required">base</value>
+ <description>
+ Stop at a specific backing image instead of flattening the entire chain.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--wait</keyword>
+ <description>
+ Block until the operation completes instead of returning as soon as possible while the operation runs in the background.
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--verbose</keyword>
+ <description>
+ Print periodic status updates when used together with "--wait".
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--timeout</keyword>
+ <value type="number" requirement="required">seconds</value>
+ <description>
+ Cancel the operation if the timeout elapses. Use together with "--wait".
+ </description>
+ </parameter>
+ <parameter requirement="optional">
+ <keyword requirement="required">--async</keyword>
+ <description>
+ Return as soon as possible.
+ </description>
+ </parameter>
+ </options>
+
+ <availability from="0.9.4" />
+
+ <notes />
+
+ <examples type="usage">
+ <example>
+ <terminal>virsh # <bold>blockpull</bold> <value>example-domain</value> <value>vda</value></terminal>
+ <text>
+ Start populating <value>vda</value> from its backing image chain and return immediately.
+ </text>
+ </example>
+ <example>
+ <terminal>virsh # <bold>blockpull</bold> <value>example-domain</value> <value>vda</value> <value>--wait</value></terminal>
+ <text>
+ Populate <value>vda</value> from its backing image chain and wait for the operation to complete.
+ </text>
+ </example>
+ <example>
+ <terminal>virsh # <bold>blockpull</bold> <value>example-domain</value> <value>vda</value> <value>0</value> <value>/path/to/backing.img</value></terminal>
+ <text>
+ Start populating <value>vda</value> from its backing image chain up to <value>/path/to/backing.img</value> and return immediately. <value>/path/to/backing.img</value> and its backing images will not be flattened. Note that the <value>0</value> means unlimited bandwidth and is necessary because <value>bandwidth</value> and <value>base</value> are positional arguments.
+ </text>
+ </example>
+ </examples>
+
+ <examples type="fullcontext" />
+
+ <reference type="seealso">
+ <item>
+ <link type="internal" href="blockjob" />
+ <name>blockjob</name>
+ <description>
+ manage active block operations
+ </description>
+ </item>
+ </reference>
+
+</command>
--
1.7.10.4
12 years, 3 months