[libvirt] Bug 736983 SSH GSSAPI login broken
by Matthias Witte
Hi,
after I upgraded from libvirt-0.9.0 I noticed that GSSAPIAuthentication for
openssh was no longer working, I always ended up with the password prompt.
stracing and debug logging on the server revealed that gssapi was never
tried.
Adding KRB5CCNAME to the ssh command's environment solved the problem.
https://bugzilla.redhat.com/show_bug.cgi?id=736983
I would like to propose the following patch:
Index: libvirt-0.9.5-rc1/src/rpc/virnetsocket.c
===================================================================
--- libvirt-0.9.5-rc1.orig/src/rpc/virnetsocket.c 2011-09-08 19:37:31.000000000 +0200
+++ libvirt-0.9.5-rc1/src/rpc/virnetsocket.c 2011-09-08 19:37:54.000000000 +0200
@@ -615,6 +615,7 @@
cmd = virCommandNew(binary ? binary : "ssh");
virCommandAddEnvPassCommon(cmd);
+ virCommandAddEnvPass(cmd, "KRB5CCNAME");
virCommandAddEnvPass(cmd, "SSH_AUTH_SOCK");
virCommandAddEnvPass(cmd, "SSH_ASKPASS");
virCommandAddEnvPass(cmd, "DISPLAY");
--
Matthias Witte - witte(a)netzquadrat.de
Telefon: +49 (0)211-30 20 33-18
Telefax: +49 (0)211-30 20 33-22
[netzquadrat] GmbH - Gladbacher Str. 74 - 40219 Düsseldorf
HRB Düsseldorf 36121 - Geschäftsführer: Thilo Salmon, Tim Mois
Steuernummer: 106/5719/1836, Umsatzsteuer-ID: DE246863050
13 years, 2 months
[libvirt] [BUG,RFC] directory traversal vulnerability / qemu: name→uuid
by Philipp Hahn
Hello,
I just tried the following command with libvirt-0.9.5git:
# virsh snapshot-create "$VM" /dev/stdin
<<<'<domainsnapshot><name>../../../../../../etc/passwd</name></domainsnapshot>'
"Luckily" it adds a .xml suffix, but this still looks like a security problem
to me, because you can overwrite any .xml-file with libvirt gibberish.
Actually this was found by a user trying to create a snapshot with an
embedded /, which didn't work, because the sub-directory didn't exist. I know
SELinux can solve this, but I really would prefer the Qemu driver to reject
such names.
Another problem is, that I sometimes would like to rename a VM to a new name,
because the old name doesn't describe the VM good enough. <description> is
not an option, because 1) Xen doesn't store it, and 2) virsh list doesn't
show it.
Renaming a Qemu-VM is currently impossible, since the name of the VM is used
for several files and directories and a undefine+define would loose state:
/etc/libvirt/qemu/$VM.xml
/var/lib/libvirt/qemu/$VM.monitor
/var/lib/libvirt/qemu/save/$VM.save
/var/lib/libvirt/qemu/snapshot/$VM/$SNAPSHOT.xml
(Renaming outside of libvirtd can be done by hand, but requires a restart of
libvirtd to get it to reload it's state.)
Compared to Xen and VirtualBox (as far as I know) they both use the UUID to
name their files and directroy, which looks a lot more sane to me than using
the name of the VM.
Would it be possible and feasible to convert the Qemu driver to use the UUID
instead for file and directory naming?
Sincerely
Philipp
--
Philipp Hahn Open Source Software Engineer hahn(a)univention.de
Univention GmbH Linux for Your Business fon: +49 421 22 232- 0
Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99
http://www.univention.de/
----------------------------------------------------------------------------
Treffen Sie Univention auf der IT&Business vom 20. bis 22. September 2011
auf dem Gemeinschaftsstand der Open Source Business Alliance in Stuttgart in
Halle 3 Stand 3D27-7.
13 years, 2 months
Re: [libvirt] [virt-tools-list] Are requests for new virsh commands acceptable?
by Richard W.M. Jones
On Mon, Aug 22, 2011 at 09:06:29PM +1000, dave bl wrote:
> Are requests/patches for new virsh commands acceptable? ... I keep
> typing in "boot" instead of "start", If I submit a patch to add
> ('boot') this would anyone have anything against it?
Certainly I've long wanted better aliases for virsh commands.
This should be discussed on libvir-list. I suggest sending patches
there instead of here.
There was some discussion about 4-8 months ago about this subject. It
might be a good idea to search the archives and familiarize yourself
with that first.
We can't remove the existing commands, and we should be careful about
aliases which might clash with future commands. Something to think
about ...
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
13 years, 2 months
[libvirt] how did libvirt manage Virtual Network?
by Wayne Xia
Working at the network management, I am a bit confused about the
VLAN model in libvirt.
in the xml definition, there is a section as following:
<devices>
<interface type='network'>
<source network='default'/>
</interface>
...
<interface type='network'>
<source network='default' portgroup='engineering'/>
<target dev='vnet7'/>
<mac address="00:11:22:33:44:55"/>
<virtualport type='802.1Qbg'>
<parameters managerid='11' typeid='1193047' typeidversion='2'
instanceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
</virtualport>
</interface>
</devices>
What is the really meaning of its related parameters of
"virtualport"? I want to discover informations such as VLAN id,
the switch type( software switch or hardware switch), connecting
relationship, but from the xml I can only found "managerid". I am not
sure how to map these xml information to those I needed, could I
consider managerid as VLAN id, and a portgroup as a specified VLAN group?
By the way to use virtualport, what components should I install on
Linux?
--
Best Regards
Wayne Xia
mail:xiawenc@linux.vnet.ibm.com
tel:86-010-82450803
_______________________________________________________
kvm-cstl mailing list <kvm-cstl(a)lists.linux.ibm.com>
To unsubscribe from the list, change your list options
or if you have forgotten your list password visit:
http://lists.linux.ibm.com/mailman/listinfo/kvm-cstl
13 years, 2 months
[libvirt] [PATCH] Fix URL-escaping for domainDefine
by Philipp Hahn
'+' in strings get translated to ' ' when editing domains.
While xenDaemonDomainCreateXML() did URL-escape the sexpr,
xenDaemonDomainDefineXML() did not.
Remove the explicit urlencode() in xenDaemonDomainCreateXML() and add
the direct encoding calls to xend_op_ext() because it calls xend_post()
which uses "Content-Type: application/x-www-form-urlencoded". According
to <http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1> this
requires all parameters to be url-encoded as specified in rfc1738.
Notice: virBufferAsprintf(..., "%s=%s", ...) is again replaced by three
calls to virBufferURIEncodeString() and virBufferAddChar() because '='
is a "reserved" character, which would get escaped by
virBufferURIEncodeString(), which - by the way - escapes anything not
c_isalnum().
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
src/xen/xend_internal.c | 62
++++-------------------------------------------
1 files changed, 5 insertions(+), 57 deletions(-)
13 years, 2 months
[libvirt] [PATCH] selinux: Detect virt_use_nfs boolean set
by Michal Privoznik
If we fail setting label on a file and this file is on NFS share,
it is wise to advise user to set virt_use_nfs selinux boolean
variable.
---
src/security/security_selinux.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index ca54f9b..028f5b2 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -420,8 +420,17 @@ SELinuxSetFilecon(const char *path, char *tcon)
* virt_use_{nfs,usb,pci} boolean tunables to allow it...
*/
if (setfilecon_errno != EOPNOTSUPP) {
+ const char *errmsg;
+ if ((virStorageFileIsSharedFSType(path,
+ VIR_STORAGE_FILE_SHFS_NFS) == 1) &&
+ security_get_boolean_active("virt_use_nfs") != 1) {
+ errmsg = _("unable to set security context '%s' on '%s'. "
+ "Consider setting virt_use_nfs");
+ } else {
+ errmsg = _("unable to set security context '%s' on '%s'");
+ }
virReportSystemError(setfilecon_errno,
- _("unable to set security context '%s' on '%s'"),
+ errmsg,
tcon, path);
if (security_getenforce() == 1)
return -1;
--
1.7.3.4
13 years, 2 months
[libvirt] [PATCH v2] xml: Change virtual file names of xml documents parsed in memory
by Peter Krempa
While parsing XML strings from memory, the previous convention in
libvirt was to set the virtual file name to "domain.xml" or something
similar. This could potentialy trick the user into looking for a file
named domain.xml on the disk in an attempt to fix the error.
This patch changes these filenames to something that can't be as easily
confused for a valid filename.
Examples of error messages:
---------------------------
Error while loading file from disk:
15:07:59.015: 527: error : catchXMLError:709 : /path/to/domain.xml:1: StartTag: invalid element name
<domain type='kvm'><
--------------------^
Error while parsing definintion in memory:
15:08:43.581: 525: error : catchXMLError:709 : (domain definition):2: error parsing attribute name
<name>vm1</name>
--^
Changes to v1:
--------------
- Change strings to nicer lowercase versions (suggested by Eric Blake)
- Add translation macros
- Add example error messages to commit message
---
src/conf/domain_conf.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
tools/virsh.c | 27 ++++++++++++++-------------
3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 74f8d6a..a4adef0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7461,7 +7461,7 @@ virDomainDefParse(const char *xmlStr,
xmlDocPtr xml;
virDomainDefPtr def = NULL;
- if ((xml = virXMLParse(filename, xmlStr, "domain.xml"))) {
+ if ((xml = virXMLParse(filename, xmlStr, _("(domain definition)")))) {
def = virDomainDefParseNode(caps, xml, xmlDocGetRootElement(xml),
expectedVirtTypes, flags);
xmlFreeDoc(xml);
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index bb577d3..39f30de 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -641,7 +641,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL;
- if (!(xml = virXMLParseStringCtxt(xmlStr, "domain.xml", &ctxt))) {
+ if (!(xml = virXMLParseStringCtxt(xmlStr, _("(domain definition)"), &ctxt))) {
goto cleanup;
}
diff --git a/tools/virsh.c b/tools/virsh.c
index cf3e816..f57dc37 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1306,7 +1306,7 @@ cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
flags = VIR_DOMAIN_AFFECT_CONFIG;
/* extract current network device description */
- xml = virXMLParseStringCtxt(desc, "domain configuration", &ctxt);
+ xml = virXMLParseStringCtxt(desc, _("(domain definition)"), &ctxt);
VIR_FREE(desc);
if (!xml) {
vshError(ctl, _("Failed to parse domain description xml"));
@@ -1453,7 +1453,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- xml = virXMLParseStringCtxt(desc, "domain configuration", &ctxt);
+ xml = virXMLParseStringCtxt(desc, _("(domain definition)"), &ctxt);
VIR_FREE(desc);
if (!xml) {
vshError(ctl, _("Failed to parse domain description xml"));
@@ -1662,7 +1662,7 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
if (!xml)
goto cleanup;
- xmldoc = virXMLParseStringCtxt(xml, "domain.xml", &ctxt);
+ xmldoc = virXMLParseStringCtxt(xml, _("(domain definition)"), &ctxt);
if (!xmldoc)
goto cleanup;
@@ -3492,7 +3492,7 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- xml = virXMLParseStringCtxt(cap_xml, "node.xml", &ctxt);
+ xml = virXMLParseStringCtxt(cap_xml, _("(capabilities)"), &ctxt);
if (!xml) {
vshError(ctl, "%s", _("unable to get node capabilities"));
goto cleanup;
@@ -9032,7 +9032,8 @@ cleanup:
}
static xmlChar *
-makeCloneXML(const char *origxml, const char *newname) {
+makeCloneXML(const char *origxml, const char *newname)
+{
xmlDocPtr doc = NULL;
xmlXPathContextPtr ctxt = NULL;
@@ -9040,7 +9041,7 @@ makeCloneXML(const char *origxml, const char *newname) {
xmlChar *newxml = NULL;
int size;
- doc = virXMLParseStringCtxt(origxml, "domain.xml", &ctxt);
+ doc = virXMLParseStringCtxt(origxml, _("(volume definition)"), &ctxt);
if (!doc)
goto cleanup;
@@ -10831,7 +10832,7 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
VIR_FREE(doc);
if (!xml)
goto cleanup;
@@ -10899,7 +10900,7 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
VIR_FREE(doc);
if (!xml)
goto cleanup;
@@ -11286,7 +11287,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
VIR_FREE(doc);
if (!xml) {
vshError(ctl, "%s", _("Failed to get interface information"));
@@ -11753,7 +11754,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
VIR_FREE(doc);
if (!xml) {
vshError(ctl, "%s", _("Failed to get disk information"));
@@ -12904,7 +12905,7 @@ cmdSnapshotCurrent(vshControl *ctl, const vshCmd *cmd)
xmlDocPtr xmldoc = NULL;
xmlXPathContextPtr ctxt = NULL;
- xmldoc = virXMLParseStringCtxt(xml, "domainsnapshot.xml", &ctxt);
+ xmldoc = virXMLParseStringCtxt(xml, _("(domain snapshot)"), &ctxt);
if (!xmldoc)
goto cleanup;
@@ -13046,7 +13047,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
if (!doc)
continue;
- xml = virXMLParseStringCtxt(doc, "domainsnapshot.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, _("(domain snapshot)"), &ctxt);
if (!xml)
continue;
@@ -13207,7 +13208,7 @@ cmdSnapshotParent(vshControl *ctl, const vshCmd *cmd)
if (!xml)
goto cleanup;
- xmldoc = virXMLParseStringCtxt(xml, "domainsnapshot.xml", &ctxt);
+ xmldoc = virXMLParseStringCtxt(xml, _("(domain snapshot)"), &ctxt);
if (!xmldoc)
goto cleanup;
--
1.7.3.4
13 years, 2 months
[libvirt] [PATCH v4] virsh: Add more human-friendly output of domblkstat command
by Peter Krempa
Users of virsh complain that output of the domblkstat command
is not intuitive enough. This patch adds explanation of fields
returned by this command to the help section for domblkstat and
the man page of virsh. Also a switch --human is added for
domblkstat that prints the fields with more descriptive
texts.
https://bugzilla.redhat.com/show_bug.cgi?id=731656
Changes to v3:
- Add units to duration values
- Add missing write doc/stranslation
- Add translation from new api names to legacy names used in previous
versions in virsh
Changes to v2:
- Modify for new fields in virDomainBlockStatsFlags
Changes to v1:
- Rebase to current head
---
tools/virsh.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++-------
tools/virsh.pod | 15 ++++++-
2 files changed, 123 insertions(+), 18 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index cf3e816..f281d7a 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1054,16 +1054,53 @@ cleanup:
*/
static const vshCmdInfo info_domblkstat[] = {
{"help", N_("get device block stats for a domain")},
- {"desc", N_("Get device block stats for a running domain.")},
+ {"desc", N_("Get device block stats for a running domain.\n\n"
+ " Explanation of fields:\n"
+ " rd_req - count of read operations\n"
+ " rd_bytes - count of read bytes\n"
+ " rd_total_times - total time read operations took (ns)\n"
+ " wr_req - count of write operations\n"
+ " wr_bytes - count of written bytes\n"
+ " wr_total_times - total time write operations took (ns)\n"
+ " flush_operations - count of flush operations\n"
+ " flush_total_times - total time flush operations took (ns)\n"
+ " errs - error count")},
{NULL,NULL}
};
static const vshCmdOptDef opts_domblkstat[] = {
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
{"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")},
+ {"human", VSH_OT_BOOL, 0, N_("print a more human readable output")},
{NULL, 0, 0, NULL}
};
+struct _domblkstat_translate {
+ const char *from;
+ const char *to;
+};
+
+/* translations into a more human readable form */
+static const struct _domblkstat_translate domblkstat_human[] = {
+ { VIR_DOMAIN_BLOCK_STATS_READ_BYTES, N_("number of read bytes: ") }, /* 0 */
+ { VIR_DOMAIN_BLOCK_STATS_READ_REQ, N_("number of read operations: ") }, /* 1 */
+ { VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES, N_("total duration of reads: ") }, /* 2 */
+ { VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES, N_("number of bytes written: ") }, /* 3 */
+ { VIR_DOMAIN_BLOCK_STATS_WRITE_REQ, N_("number of write operations:") }, /* 4 */
+ { VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES, N_("total duration of writes: ") }, /* 5 */
+ { VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ, N_("number of flush operations:") }, /* 6 */
+ { VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES, N_("total duration of flushes: ") }, /* 7 */
+ { VIR_DOMAIN_BLOCK_STATS_ERRS, N_("error count: ") }, /* 8 */
+ { NULL, NULL }
+};
+
+/* translations into legacy field values used in previous versions */
+static const struct _domblkstat_translate domblkstat_legacy[] = {
+ { VIR_DOMAIN_BLOCK_STATS_READ_REQ, "rd_req"},
+ { VIR_DOMAIN_BLOCK_STATS_WRITE_REQ, "wr_req"},
+ { NULL, NULL }
+};
+
static bool
cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
{
@@ -1071,8 +1108,11 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
const char *name = NULL, *device = NULL;
struct _virDomainBlockStats stats;
virTypedParameterPtr params = NULL;
+ const char *field_name = NULL;
+ int j = 0;
int rc, nparams = 0;
bool ret = false;
+ bool human = vshCommandOptBool(cmd, "human"); /* enable human readable output */
if (!vshConnectionUsability (ctl, ctl->conn))
return false;
@@ -1104,20 +1144,41 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- if (stats.rd_req >= 0)
- vshPrint (ctl, "%s rd_req %lld\n", device, stats.rd_req);
+ if (human) {
+ /* human friendly output */
+ vshPrint(ctl, N_("Device: %s\n"), device);
+
+ if (stats.rd_req >= 0)
+ vshPrint (ctl, "%s %lld\n", domblkstat_human[1].to, stats.rd_req);
+
+ if (stats.rd_bytes >= 0)
+ vshPrint (ctl, "%s %lld\n", domblkstat_human[0].to, stats.rd_bytes);
+
+ if (stats.wr_req >= 0)
+ vshPrint (ctl, "%s %lld\n", domblkstat_human[4].to, stats.wr_req);
+
+ if (stats.wr_bytes >= 0)
+ vshPrint (ctl, "%s %lld\n", domblkstat_human[3].to, stats.wr_bytes);
+
+ if (stats.errs >= 0)
+ vshPrint (ctl, "%s %lld\n", domblkstat_human[8].to, stats.errs);
+ } else {
+
+ if (stats.rd_req >= 0)
+ vshPrint (ctl, "%s rd_req %lld\n", device, stats.rd_req);
- if (stats.rd_bytes >= 0)
- vshPrint (ctl, "%s rd_bytes %lld\n", device, stats.rd_bytes);
+ if (stats.rd_bytes >= 0)
+ vshPrint (ctl, "%s rd_bytes %lld\n", device, stats.rd_bytes);
- if (stats.wr_req >= 0)
- vshPrint (ctl, "%s wr_req %lld\n", device, stats.wr_req);
+ if (stats.wr_req >= 0)
+ vshPrint (ctl, "%s wr_req %lld\n", device, stats.wr_req);
- if (stats.wr_bytes >= 0)
- vshPrint (ctl, "%s wr_bytes %lld\n", device, stats.wr_bytes);
+ if (stats.wr_bytes >= 0)
+ vshPrint (ctl, "%s wr_bytes %lld\n", device, stats.wr_bytes);
- if (stats.errs >= 0)
- vshPrint (ctl, "%s errs %lld\n", device, stats.errs);
+ if (stats.errs >= 0)
+ vshPrint (ctl, "%s errs %lld\n", device, stats.errs);
+ }
}
} else {
params = vshMalloc(ctl, sizeof(*params) * nparams);
@@ -1129,32 +1190,63 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
}
int i;
+
+ /* set for prettier output */
+ if (human) {
+ vshPrint(ctl, N_("Device: %s\n"), device);
+ device = "";
+ }
+
/* XXX: The output sequence will be different. */
for (i = 0; i < nparams; i++) {
+ /* translate messages into a human readable form, if requested */
+ field_name = NULL;
+
+ if (human)
+ for (j = 0; domblkstat_human[j].from != NULL; j++)
+ if (STREQ(params[i].field, domblkstat_human[j].from)) {
+ field_name = domblkstat_human[j].to;
+
+ break;
+ }
+
+ /* translate new QEmu style field names into legacy names used by virsh */
+ if (!field_name)
+ for (j = 0; domblkstat_legacy[j].from != NULL; j++)
+ if (STREQ(params[i].field, domblkstat_legacy[j].from)) {
+ field_name = domblkstat_legacy[j].to;
+
+ break;
+ }
+
+ /* translation not found, stick with the default field name */
+ if (!field_name)
+ field_name = params[i].field;
+
switch(params[i].type) {
case VIR_TYPED_PARAM_INT:
vshPrint (ctl, "%s %s %d\n", device,
- params[i].field, params[i].value.i);
+ field_name, params[i].value.i);
break;
case VIR_TYPED_PARAM_UINT:
vshPrint (ctl, "%s %s %u\n", device,
- params[i].field, params[i].value.ui);
+ field_name, params[i].value.ui);
break;
case VIR_TYPED_PARAM_LLONG:
vshPrint (ctl, "%s %s %lld\n", device,
- params[i].field, params[i].value.l);
+ field_name, params[i].value.l);
break;
case VIR_TYPED_PARAM_ULLONG:
vshPrint (ctl, "%s %s %llu\n", device,
- params[i].field, params[i].value.ul);
+ field_name, params[i].value.ul);
break;
case VIR_TYPED_PARAM_DOUBLE:
vshPrint (ctl, "%s %s %f\n", device,
- params[i].field, params[i].value.d);
+ field_name, params[i].value.d);
break;
case VIR_TYPED_PARAM_BOOLEAN:
vshPrint (ctl, "%s %s %s\n", device,
- params[i].field, params[i].value.b ? _("yes") : _("no"));
+ field_name, params[i].value.b ? _("yes") : _("no"));
break;
default:
vshError(ctl, _("unimplemented block statistics parameter type"));
diff --git a/tools/virsh.pod b/tools/virsh.pod
index e82567d..a2f87cd 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -501,13 +501,26 @@ be lost once the guest stops running, but the snapshot contents still
exist, and a new domain with the same name and UUID can restore the
snapshot metadata with B<snapshot-create>.
-=item B<domblkstat> I<domain> I<block-device>
+=item B<domblkstat> I<domain> I<block-device> [I<--human>]
Get device block stats for a running domain. A I<block-device> 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).
+Use I<--human> for a more human readable output.
+
+B<Explanation of fields:>
+ rd_req - count of read operations
+ rd_bytes - count of read bytes
+ rd_total_times - total time read operations took (ns)
+ wr_req - count of write operations
+ wr_bytes - count of written bytes
+ wr_total_times - total time write operations took (ns)
+ flush_operations - count of flush operations
+ flush_total_times - total time flush operations took (ns)
+ errs - error count
+
=item B<domifstat> I<domain> I<interface-device>
Get network interface stats for a running domain.
--
1.7.3.4
13 years, 2 months
[libvirt] [PATCH] snapshot: fix regression with system checkpoints
by Eric Blake
Regression introduced in commit d6f6b2d194c.
* src/conf/domain_conf.c (virDomainSnapshotDefParseString): Only
give error about no disk support when <disk> was found.
---
src/conf/domain_conf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 74f8d6a..560c773 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11622,7 +11622,7 @@ virDomainSnapshotDefParseString(const char *xmlStr,
goto cleanup;
}
VIR_FREE(nodes);
- } else {
+ } else if (i) {
virDomainReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("unable to handle disk requests in snapshot"));
goto cleanup;
--
1.7.4.4
13 years, 2 months
[libvirt] A question about create image for sheepdog
by chang liu
Hi everyone:
I want to build a VM Manage System, and I use libvirt to create and delete
VM. But now I has used sheepdog as the disk, but I have to create sheepdog
image by hand. If I have a thousand of servers, how can I create the image?
I think if I can write a API for create the sheepdog image by call the
qemu-img or kvm-img? (My English is rather poor, please forgive me)
13 years, 2 months