[libvirt] [PATCH] Libvirt: virTypedParamsValidate: Fix detection of multiple parameters
by Jason J. Herne
virTypedParamsValidate currently uses an index based check to find
duplicate parameters. This check does not work. Consider the following
simple example:
We have only 2 keys
A (multiples allowed)
B (multiples NOT allowed)
We are given the following list of parameters to check:
A
A
B
If you work through the validation loop you will see that our last iteration
through the loop has i=2 and j=1. In this case, i > j and keys[j].value.i will
indicate that multiples are not allowed. Both conditionals are satisfied so
an incorrect error will be given: "parameter '%s' occurs multiple times"
This patch replaces the index based check with code that remembers
the name of the last parameter seen and only triggers the error case if
the current parameter name equals the last one. This works because the
list is sorted and duplicate parameters will be grouped together.
In reality, we hit this bug while using selective block migration to migrate
a guest with 5 disks. 5 was apparently just the right number to push i > j
and hit this bug.
virsh migrate --live guestname --copy-storage-all
--migrate-disks vdb,vdc,vdd,vde,vdf
qemu+ssh://dsthost/system
Signed-off-by: Jason J. Herne <jjherne(a)linux.vnet.ibm.com>
Reviewed-by: Eric Farman <farman(a)linux.vnet.ibm.com>
---
src/util/virtypedparam.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 138fc64..23109e1 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -66,7 +66,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
va_list ap;
int ret = -1;
size_t i, j;
- const char *name;
+ const char *name, *last_name = NULL;
int type;
size_t nkeys = 0, nkeysalloc = 0;
virTypedParameterPtr sorted = NULL, keys = NULL;
@@ -106,7 +106,8 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
if (STRNEQ(sorted[i].field, keys[j].field)) {
j++;
} else {
- if (i > j && !(keys[j].value.i & VIR_TYPED_PARAM_MULTIPLE)) {
+ if (STREQ_NULLABLE(last_name, sorted[i].field) &&
+ !(keys[j].value.i & VIR_TYPED_PARAM_MULTIPLE)) {
virReportError(VIR_ERR_INVALID_ARG,
_("parameter '%s' occurs multiple times"),
sorted[i].field);
@@ -125,6 +126,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
virTypedParameterTypeToString(keys[j].type));
goto cleanup;
}
+ last_name = sorted[i].field;
i++;
}
}
--
1.9.1
8 years, 7 months
[libvirt] [PATCH 00/18] Refactor event-test
by Peter Krempa
I was asked to add the new event to the test. My eyes started bleeding after
opening the file. Refactor the mega-ancient code and add missing stuff.
As a finishing touch add a static check that new events are not forgotten.
P.S: I contemplated just deleting that ... stuff ... at first. But I coudn't
think of a bulletproof justification other than the state of the code.
Peter Krempa (18):
event-test: Remove forward declarations
event-test: Get rid of useless and ambiguous VIR_DEBUG macro
event-test: Remove unnecessary 'usage' function
event-test: touch up coding style
event-test: Use functions with typecasted switch to convert enums
lib: document fields virConnectDomainEventDiskChangeReason
event-test: Force compiler check in switch for connectClose callback
event-test: Use typecasted enum to convert graphics event phase
event-test: Use switch instead of if/else if chains for lifecycle
event translation
event-test: make few switch statements future proof
event-test: Enable enum sentinels and warn on not fully populated
enums
event-test: make domain event registration declarative
event-test: Add VIR_DOMAIN_EVENT_ID_BLOCK_JOB and
VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2
event-test: Add VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION callback
event-test: Add VIR_DOMAIN_EVENT_ID_JOB_COMPLETED
event-test: Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
event-test: Add VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
event-test: Enforce domain event sync
examples/Makefile.am | 5 +
examples/object-events/event-test.c | 973 +++++++++++++++++++++---------------
include/libvirt/libvirt-domain.h | 6 +-
3 files changed, 580 insertions(+), 404 deletions(-)
--
2.8.0
8 years, 7 months
[libvirt] [PATCH v3] security: Rename DomainSetDirLabel to DomainSetPathLabel
by Martin Kletzander
It already labels abritrary paths, so it's just the naming that was
wrong.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
v3: The other patch from the series was pushed, so this is the only
one missing right now, so it needed rebasing.
src/libvirt_private.syms | 2 +-
src/qemu/qemu_domain.c | 4 ++--
src/qemu/qemu_process.c | 4 ++--
src/security/security_dac.c | 8 ++++----
src/security/security_driver.h | 8 ++++----
src/security/security_manager.c | 10 +++++-----
src/security/security_manager.h | 6 +++---
src/security/security_selinux.c | 8 ++++----
src/security/security_stack.c | 12 ++++++------
9 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 61fc5004bbb7..1118fdcfa3bc 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1055,7 +1055,7 @@ virSecurityDriverLookup;
# security/security_manager.h
virSecurityManagerCheckAllLabel;
virSecurityManagerClearSocketLabel;
-virSecurityManagerDomainSetDirLabel;
+virSecurityManagerDomainSetPathLabel;
virSecurityManagerGenLabel;
virSecurityManagerGetBaseLabel;
virSecurityManagerGetDOI;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ed1e0e502925..e031e0fc42c8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -527,8 +527,8 @@ qemuDomainWriteMasterKeyFile(virQEMUDriverPtr driver,
goto cleanup;
}
- if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
- vm->def, path) < 0)
+ if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
+ vm->def, path) < 0)
goto cleanup;
ret = 0;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 81d86c2d1aa2..c0873007d397 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4486,8 +4486,8 @@ qemuProcessMakeDir(virQEMUDriverPtr driver,
goto cleanup;
}
- if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
- vm->def, path) < 0)
+ if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
+ vm->def, path) < 0)
goto cleanup;
ret = 0;
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index a09aba5f62c6..df3ed4793be8 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -1542,9 +1542,9 @@ virSecurityDACGetBaseLabel(virSecurityManagerPtr mgr,
}
static int
-virSecurityDACDomainSetDirLabel(virSecurityManagerPtr mgr,
- virDomainDefPtr def,
- const char *path)
+virSecurityDACDomainSetPathLabel(virSecurityManagerPtr mgr,
+ virDomainDefPtr def,
+ const char *path)
{
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
virSecurityLabelDefPtr seclabel;
@@ -1607,5 +1607,5 @@ virSecurityDriver virSecurityDriverDAC = {
.getBaseLabel = virSecurityDACGetBaseLabel,
- .domainSetDirLabel = virSecurityDACDomainSetDirLabel,
+ .domainSetPathLabel = virSecurityDACDomainSetPathLabel,
};
diff --git a/src/security/security_driver.h b/src/security/security_driver.h
index 784b0dee65ea..7cb62f029343 100644
--- a/src/security/security_driver.h
+++ b/src/security/security_driver.h
@@ -118,9 +118,9 @@ typedef int (*virSecurityDomainSetImageLabel) (virSecurityManagerPtr mgr,
typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManagerPtr mgr,
virDomainDefPtr def,
virStorageSourcePtr src);
-typedef int (*virSecurityDomainSetDirLabel) (virSecurityManagerPtr mgr,
- virDomainDefPtr def,
- const char *path);
+typedef int (*virSecurityDomainSetPathLabel) (virSecurityManagerPtr mgr,
+ virDomainDefPtr def,
+ const char *path);
struct _virSecurityDriver {
@@ -172,7 +172,7 @@ struct _virSecurityDriver {
virSecurityDriverGetBaseLabel getBaseLabel;
- virSecurityDomainSetDirLabel domainSetDirLabel;
+ virSecurityDomainSetPathLabel domainSetPathLabel;
};
virSecurityDriverPtr virSecurityDriverLookup(const char *name,
diff --git a/src/security/security_manager.c b/src/security/security_manager.c
index 07a05224e0be..ecb4a40f05c8 100644
--- a/src/security/security_manager.c
+++ b/src/security/security_manager.c
@@ -987,14 +987,14 @@ virSecurityManagerSetHugepages(virSecurityManagerPtr mgr,
int
-virSecurityManagerDomainSetDirLabel(virSecurityManagerPtr mgr,
- virDomainDefPtr vm,
- const char *path)
+virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
+ virDomainDefPtr vm,
+ const char *path)
{
- if (mgr->drv->domainSetDirLabel) {
+ if (mgr->drv->domainSetPathLabel) {
int ret;
virObjectLock(mgr);
- ret = mgr->drv->domainSetDirLabel(mgr, vm, path);
+ ret = mgr->drv->domainSetPathLabel(mgr, vm, path);
virObjectUnlock(mgr);
return ret;
}
diff --git a/src/security/security_manager.h b/src/security/security_manager.h
index e534e31d4a55..4cbc2d85d0f1 100644
--- a/src/security/security_manager.h
+++ b/src/security/security_manager.h
@@ -160,8 +160,8 @@ int virSecurityManagerRestoreImageLabel(virSecurityManagerPtr mgr,
virDomainDefPtr vm,
virStorageSourcePtr src);
-int virSecurityManagerDomainSetDirLabel(virSecurityManagerPtr mgr,
- virDomainDefPtr vm,
- const char *path);
+int virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
+ virDomainDefPtr vm,
+ const char *path);
#endif /* VIR_SECURITY_MANAGER_H__ */
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 04760a1f41d1..b33d54a81d58 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -2594,9 +2594,9 @@ virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr,
}
static int
-virSecuritySELinuxDomainSetDirLabel(virSecurityManagerPtr mgr,
- virDomainDefPtr def,
- const char *path)
+virSecuritySELinuxDomainSetPathLabel(virSecurityManagerPtr mgr,
+ virDomainDefPtr def,
+ const char *path)
{
virSecurityLabelDefPtr seclabel;
@@ -2652,5 +2652,5 @@ virSecurityDriver virSecurityDriverSELinux = {
.domainGetSecurityMountOptions = virSecuritySELinuxGetSecurityMountOptions,
.getBaseLabel = virSecuritySELinuxGetBaseLabel,
- .domainSetDirLabel = virSecuritySELinuxDomainSetDirLabel,
+ .domainSetPathLabel = virSecuritySELinuxDomainSetPathLabel,
};
diff --git a/src/security/security_stack.c b/src/security/security_stack.c
index 00d1fa7012bb..3ea27518fcc1 100644
--- a/src/security/security_stack.c
+++ b/src/security/security_stack.c
@@ -600,17 +600,17 @@ virSecurityStackRestoreImageLabel(virSecurityManagerPtr mgr,
}
static int
-virSecurityStackDomainSetDirLabel(virSecurityManagerPtr mgr,
- virDomainDefPtr vm,
- const char *path)
+virSecurityStackDomainSetPathLabel(virSecurityManagerPtr mgr,
+ virDomainDefPtr vm,
+ const char *path)
{
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
virSecurityStackItemPtr item = priv->itemsHead;
int rc = 0;
for (; item; item = item->next) {
- if (virSecurityManagerDomainSetDirLabel(item->securityManager,
- vm, path) < 0)
+ if (virSecurityManagerDomainSetPathLabel(item->securityManager,
+ vm, path) < 0)
rc = -1;
}
@@ -667,5 +667,5 @@ virSecurityDriver virSecurityDriverStack = {
.getBaseLabel = virSecurityStackGetBaseLabel,
- .domainSetDirLabel = virSecurityStackDomainSetDirLabel,
+ .domainSetPathLabel = virSecurityStackDomainSetPathLabel,
};
--
2.8.1
8 years, 7 months
[libvirt] [PATCH v4 0/2] persistent live migration with specified XML
by Dmitry Andreev
v4: wrong param name in commit msg
v3:
- use shorter name for param and rename args
- move qemuMigrationCookieAddPersistent out from
qemuMigrationBakeCookie
- rebase to master
v2: reimplemented with new migration param
Libvirt doesn't allow to specify destination persistent domain
configuration. VIR_MIGRATE_PARAM_DEST_XML migration param is used for
active configuration and persistent configuration is taken from source
domain. The problem is mentioned in this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=835300
This patch-set introduces new migration param VIR_MIGRATE_PARAM_PERSIST_XML
and implements its support in qemu driver.
Dmitry Andreev (2):
qemuMigrationCookieAddPersistent: move it out and change argument type
qemu: migration: new migration param for persistent destination XML
include/libvirt/libvirt-domain.h | 15 ++++++++++
src/qemu/qemu_driver.c | 12 +++++---
src/qemu/qemu_migration.c | 64 ++++++++++++++++++++++++----------------
src/qemu/qemu_migration.h | 2 ++
4 files changed, 63 insertions(+), 30 deletions(-)
--
1.8.3.1
8 years, 7 months
[libvirt] [PATCH] qemu: reject min_guarantee at parse time
by Cole Robinson
min_guarantee isn't implemented for qemu, and an explicit check was
added in june 2014 to reject the VM at qemu startup time. It's a weird
place to do XML validation, so move it to the post parse area where
we have similar checks.
Also drop a validation check against min_guarantee in the command line
building; it will never see min_guarantee there.
---
src/qemu/qemu_command.c | 1 -
src/qemu/qemu_domain.c | 7 +++++++
src/qemu/qemu_process.c | 7 -------
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 26c19ff..2fb967a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9143,7 +9143,6 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver,
if (virMemoryLimitIsSet(def->mem.hard_limit) ||
virMemoryLimitIsSet(def->mem.soft_limit) ||
- def->mem.min_guarantee ||
virMemoryLimitIsSet(def->mem.swap_hard_limit)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Memory tuning is not available in session mode"));
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 73187ce..f5fafc8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1690,6 +1690,13 @@ qemuDomainDefPostParse(virDomainDefPtr def,
return ret;
}
+ if (def->mem.min_guarantee) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Parameter 'min_guarantee' "
+ "not supported by QEMU."));
+ return -1;
+ }
+
if (def->os.loader &&
def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
def->os.loader->readonly == VIR_TRISTATE_SWITCH_ON &&
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 81d86c2..387aff5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4550,13 +4550,6 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
virDomainDefCheckDuplicateDiskInfo(vm->def) < 0)
return -1;
- if (vm->def->mem.min_guarantee) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Parameter 'min_guarantee' "
- "not supported by QEMU."));
- return -1;
- }
-
VIR_DEBUG("Checking for any possible (non-fatal) issues");
/*
--
2.7.3
8 years, 7 months
[libvirt] [python PATCH] event: Add support VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
by Peter Krempa
---
examples/event-test.py | 4 +++
libvirt-override-virConnect.py | 9 +++++++
libvirt-override.c | 60 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 73 insertions(+)
diff --git a/examples/event-test.py b/examples/event-test.py
index 5be4978..f96c917 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -535,6 +535,9 @@ def myDomainEventMigrationIteration(conn, dom, iteration, opaque):
dom.name(), dom.ID(), iteration))
def myDomainEventJobCompletedCallback(conn, dom, params, opaque):
print("myDomainEventJobCompletedCallback: Domain %s(%s) %s" % (dom.name(), dom.ID(), params))
+def myDomainEventDeviceRemovalFailedCallback(conn, dom, dev, opaque):
+ print("myDomainEventDeviceRemovalFailedCallback: Domain %s(%s) failed to remove device: %s" % (
+ dom.name(), dom.ID(), dev))
##########################################################################
# Network events
@@ -649,6 +652,7 @@ def main():
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_DEVICE_ADDED, myDomainEventDeviceAddedCallback, None)
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION, myDomainEventMigrationIteration, None)
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, myDomainEventJobCompletedCallback, None)
+ vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, myDomainEventDeviceRemovalFailedCallback, None)
vc.networkEventRegisterAny(None, libvirt.VIR_NETWORK_EVENT_ID_LIFECYCLE, myNetworkEventLifecycleCallback, None)
diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py
index 396a6ed..0f76c59 100644
--- a/libvirt-override-virConnect.py
+++ b/libvirt-override-virConnect.py
@@ -234,6 +234,15 @@
cb(self, virDomain(self, _obj=dom), params, opaque)
return 0
+ def _dispatchDomainEventDeviceRemovalFailedCallback(self, dom, devAlias, cbData):
+ """Dispatches event to python user domain device removal failed event callbacks
+ """
+ cb = cbData["cb"]
+ opaque = cbData["opaque"]
+
+ cb(self, virDomain(self, _obj=dom), devAlias, opaque)
+ return 0
+
def domainEventDeregisterAny(self, callbackID):
"""Removes a Domain Event Callback. De-registering for a
domain callback will disable delivery of this event type """
diff --git a/libvirt-override.c b/libvirt-override.c
index ee355da..4640ed5 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -6894,6 +6894,61 @@ libvirt_virConnectDomainEventJobCompletedCallback(virConnectPtr conn ATTRIBUTE_U
}
#endif /* VIR_DOMAIN_EVENT_ID_JOB_COMPLETED */
+
+#ifdef VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
+static int
+libvirt_virConnectDomainEventDeviceRemovalFailedCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virDomainPtr dom,
+ const char *devAlias,
+ void *opaque)
+{
+ PyObject *pyobj_cbData = (PyObject*)opaque;
+ PyObject *pyobj_dom;
+ PyObject *pyobj_ret = NULL;
+ PyObject *pyobj_conn;
+ PyObject *dictKey;
+ int ret = -1;
+
+ LIBVIRT_ENSURE_THREAD_STATE;
+
+ if (!(dictKey = libvirt_constcharPtrWrap("conn")))
+ goto cleanup;
+ pyobj_conn = PyDict_GetItem(pyobj_cbData, dictKey);
+ Py_DECREF(dictKey);
+
+ /* Create a python instance of this virDomainPtr */
+ virDomainRef(dom);
+ if (!(pyobj_dom = libvirt_virDomainPtrWrap(dom))) {
+ virDomainFree(dom);
+ goto cleanup;
+ }
+ Py_INCREF(pyobj_cbData);
+
+ /* Call the Callback Dispatcher */
+ pyobj_ret = PyObject_CallMethod(pyobj_conn,
+ (char*)"_dispatchDomainEventDeviceRemovalFailedCallback",
+ (char*)"OsO",
+ pyobj_dom, devAlias, pyobj_cbData);
+
+ Py_DECREF(pyobj_cbData);
+ Py_DECREF(pyobj_dom);
+
+ cleanup:
+ if (!pyobj_ret) {
+ DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
+ PyErr_Print();
+ } else {
+ Py_DECREF(pyobj_ret);
+ ret = 0;
+ }
+
+ LIBVIRT_RELEASE_THREAD_STATE;
+ return ret;
+
+}
+#endif /* VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED */
+
+
static PyObject *
libvirt_virConnectDomainEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
@@ -7004,6 +7059,11 @@ libvirt_virConnectDomainEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED,
cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventJobCompletedCallback);
break;
#endif /* VIR_DOMAIN_EVENT_ID_JOB_COMPLETED */
+#ifdef VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
+ case VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED:
+ cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventDeviceRemovalFailedCallback);
+ break;
+#endif /* VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED */
case VIR_DOMAIN_EVENT_ID_LAST:
break;
}
--
2.8.0
8 years, 7 months
[libvirt] [libvirt-glib v2] spec: Add verification of the tarball GPG signature
by Christophe Fergeau
This at least allows to make sure that all tarballs are signed with the
same GPG key, and that the tarball was not corrupted between the time it
was uploaded upstream, and the time the RPM is built.
danpb-BE86EBB415104FDF.gpg is generated with:
gpg2 -v --armor --export 15104FDF | gpg2 --no-default-keyring --keyring ./danpb-BE86EBB415104FDF.gpg --import
We cannot unconditionally enable gpg signature checks as when
building from tarballs with rpmbuild -ta (for example), the needed
keyring file will no be available, so this commit checks that
BE86EBB415104FDF.gpg exists before attempting to do the check.
---
libvirt-glib.spec.in | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Hey, here is my attempt at addressing the issue raised with v1 (rpmbuild -ta
being broken by the change). I cannot rely on the usual test on %{fedora} and %{rhel} as
they are set when running rpmbuild on a fedora. Instead I added a test for the
existence of the keyring file. Maybe there are better ways of writing this file existence
check..
Christophe
diff --git a/libvirt-glib.spec.in b/libvirt-glib.spec.in
index 32ce4f0..02a27d5 100644
--- a/libvirt-glib.spec.in
+++ b/libvirt-glib.spec.in
@@ -1,5 +1,12 @@
# -*- rpm-spec -*-
+# We cannot unconditionally enable gpg signature checks as when
+# building from tarballs with rpmbuild -ta (for example), the needed
+# keyring file will no be available
+%define gpg_keyring danpb-BE86EBB415104FDF.gpg
+%define has_gpg_keyring %(if [ -f %{gpg_keyring} ]; then echo 1; else echo 0; fi)
+%define with_gpg_check %{has_gpg_keyring}
+
%define with_introspection 0
%define with_python 0
%define with_vala 0
@@ -28,6 +35,10 @@ Group: Development/Libraries
License: LGPLv2+
URL: http://libvirt.org/
Source0: ftp://libvirt.org/libvirt/glib/%{name}-%{version}.tar.gz
+%if %{with_gpg_check}
+Source1: ftp://libvirt.org/libvirt/glib/%{name}-%{version}.tar.gz.asc
+Source2: %{gpg_keyring}
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glib2-devel >= @GLIB2_REQUIRED@
@@ -45,6 +56,9 @@ BuildRequires: libtool
%if %{with_vala}
BuildRequires: vala-tools
%endif
+%if %{with_gpg_check}
+BuildRequires: gnupg2
+%endif
%package devel
Group: Development/Libraries
@@ -109,6 +123,9 @@ libvirt and the glib event loop
%endif
%prep
+%if %{with_gpg_check}
+gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
+%endif
%setup -q
%build
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] tests: Fix syntax in iSCSI auth/secret tests
by John Ferlan
While working on the tests for the secret initialization vector, I found
that the existing iSCSI tests were lacking in how they defined the IQN.
Many had IQN's of just 'iqn.1992-01.com.example' for one disk while using
'iqn.1992-01.com.example/1' for the second disk (same for hostdevs - guess
how they were copied/generated).
Typically (and documented this way), IQN's would include be of the form
'iqn.1992-01.com.example:storage/1' indicating an IQN using "storage" for
naming authority specific string and "/1" for the iSCSI LUN.
So modify the input XML's to use the more proper format - this of course
has a ripple effect on the output XML and the args.
Also note that the "%3A" is generated by the virURIFormat/xmlSaveUri
to represent the colon.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
.../qemuargv2xml-disk-drive-network-iscsi-auth.args | 6 +++---
.../qemuargv2xml-disk-drive-network-iscsi-auth.xml | 4 ++--
.../qemuxml2argv-disk-drive-network-iscsi-auth.args | 8 +++++---
.../qemuxml2argv-disk-drive-network-iscsi-auth.xml | 7 +++++--
.../qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args | 4 ++--
.../qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml | 4 ++--
.../qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args | 4 ++--
.../qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml | 4 ++--
.../qemuxml2xmlout-disk-drive-network-iscsi-auth.xml | 7 +++++--
.../qemuxml2xmlout-hostdev-scsi-lsi-iscsi-auth.xml | 4 ++--
.../qemuxml2xmlout-hostdev-scsi-virtio-iscsi-auth.xml | 4 ++--
11 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.args b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.args
index 5bebcae..44c9506 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.args
+++ b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.args
@@ -17,9 +17,9 @@ QEMU_AUDIO_DRV=none \
-boot c \
-usb \
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
-6000/iqn.1992-01.com.example,format=raw,if=virtio \
--drive file=iscsi://example.org:6000/iqn.1992-01.com.example/1,format=raw,\
-if=virtio \
+6000/iqn.1992-01.com.example%3Astorage/1,format=raw,if=virtio \
+-drive file=iscsi://example.org:6000/iqn.1992-01.com.example%3Astorage/2,\
+format=raw,if=virtio \
-net none \
-serial none \
-parallel none
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml
index 35b3abc..b5f948b 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-iscsi-auth.xml
@@ -19,14 +19,14 @@
<auth username='myname'>
<secret type='iscsi' usage='qemuargv2xml_usage'/>
</auth>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='6000'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='6000'/>
</source>
<target dev='vdb' bus='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args
index 735a0ae..66e2497 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args
@@ -18,10 +18,12 @@ QEMU_AUDIO_DRV=none \
-boot c \
-usb \
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
-6000/iqn.1992-01.com.example,format=raw,if=none,id=drive-virtio-disk0 \
+6000/iqn.1992-01.com.example%3Astorage/1,format=raw,if=none,\
+id=drive-virtio-disk0 \
-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
id=virtio-disk0 \
--drive file=iscsi://example.org:6000/iqn.1992-01.com.example/1,format=raw,\
-if=none,id=drive-virtio-disk1 \
+-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
+6000/iqn.1992-01.com.example%3Astorage/2,format=raw,if=none,\
+id=drive-virtio-disk1 \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
id=virtio-disk1
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml
index 5ac4abf..1f80d3b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml
@@ -19,14 +19,17 @@
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
</auth>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='6000'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <auth username='myname'>
+ <secret type='iscsi' usage='mycluster_myname'/>
+ </auth>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='6000'/>
</source>
<target dev='vdb' bus='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args
index 2bd98e5..ff6655f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args
@@ -21,9 +21,9 @@ QEMU_AUDIO_DRV=none \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
-3260/iqn.1992-01.com.example,if=none,format=raw,id=drive-hostdev0 \
+3260/iqn.1992-01.com.example%3Astorage/1,if=none,format=raw,id=drive-hostdev0 \
-device scsi-generic,bus=scsi0.0,scsi-id=4,drive=drive-hostdev0,id=hostdev0 \
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
-3260/iqn.1992-01.com.example/1,if=none,format=raw,id=drive-hostdev1 \
+3260/iqn.1992-01.com.example%3Astorage/2,if=none,format=raw,id=drive-hostdev1 \
-device scsi-generic,bus=scsi0.0,scsi-id=5,drive=drive-hostdev1,id=hostdev1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
index ed2bf25..f988165 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
@@ -26,7 +26,7 @@
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
@@ -35,7 +35,7 @@
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args
index 624be94..42113c8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args
@@ -21,11 +21,11 @@ QEMU_AUDIO_DRV=none \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
-3260/iqn.1992-01.com.example,if=none,format=raw,id=drive-hostdev0 \
+3260/iqn.1992-01.com.example%3Astorage/1,if=none,format=raw,id=drive-hostdev0 \
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=2,lun=4,drive=drive-hostdev0,\
id=hostdev0 \
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
-3260/iqn.1992-01.com.example/1,if=none,format=raw,id=drive-hostdev1 \
+3260/iqn.1992-01.com.example%3Astorage/2,if=none,format=raw,id=drive-hostdev1 \
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=2,lun=5,drive=drive-hostdev1,\
id=hostdev1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
index 33577ab..b70b84e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
@@ -26,7 +26,7 @@
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
@@ -35,7 +35,7 @@
<address type='drive' controller='0' bus='0' target='2' unit='4'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-iscsi-auth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-iscsi-auth.xml
index 4f0e87f..fc8aba1 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-iscsi-auth.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-iscsi-auth.xml
@@ -19,7 +19,7 @@
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
</auth>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='6000'/>
</source>
<target dev='vda' bus='virtio'/>
@@ -27,7 +27,10 @@
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <auth username='myname'>
+ <secret type='iscsi' usage='mycluster_myname'/>
+ </auth>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='6000'/>
</source>
<target dev='vdb' bus='virtio'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-lsi-iscsi-auth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-lsi-iscsi-auth.xml
index 5ed4095..1db5ed9 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-lsi-iscsi-auth.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-lsi-iscsi-auth.xml
@@ -32,7 +32,7 @@
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
@@ -41,7 +41,7 @@
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-virtio-iscsi-auth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-virtio-iscsi-auth.xml
index a5d3b8e..64c149f 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-virtio-iscsi-auth.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-virtio-iscsi-auth.xml
@@ -32,7 +32,7 @@
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
@@ -41,7 +41,7 @@
<address type='drive' controller='0' bus='0' target='2' unit='4'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
- <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
+ <source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
<host name='example.org' port='3260'/>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] ZFS: Support sparse volumes
by Richard Laager
By default, `zfs create -V ...` reserves space for the entire volsize,
plus some extra (which attempts to account for overhead).
If `zfs create -s -V ...` is used instead, zvols are (fully) sparse.
A middle ground (partial allocation) can be achieved with
`zfs create -s -o refreservation=... -V ...`. Both libvirt and ZFS
support this approach, so the ZFS storage backend should support it.
Signed-off-by: Richard Laager <rlaager(a)wiktel.com>
---
src/storage/storage_backend_zfs.c | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index 2e6e407..6dc3cec 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -112,7 +112,7 @@ virStorageBackendZFSParseVol(virStoragePoolObjPtr pool,
if (!(tokens = virStringSplitCount(volume_string, "\t", 0, &count)))
return -1;
- if (count != 2)
+ if (count != 3)
goto cleanup;
if (!(name_tokens = virStringSplit(tokens[0], "/", 2)))
@@ -151,6 +151,20 @@ virStorageBackendZFSParseVol(virStoragePoolObjPtr pool,
goto cleanup;
}
+ if (virStrToLong_ull(tokens[2], NULL, 10, &volume->target.allocation) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("malformed refreservation reported"));
+ goto cleanup;
+ }
+ if (volume->target.allocation >= volume->target.capacity) {
+ /* A zvol created without -s will have a refreservation slightly larger
+ * than volblocksize.
+ */
+ volume->target.allocation = volume->target.capacity;
+ } else {
+ volume->target.sparse = true;
+ }
+
if (is_new_vol &&
VIR_APPEND_ELEMENT(pool->volumes.objs,
pool->volumes.count,
@@ -190,7 +204,7 @@ virStorageBackendZFSFindVols(virStoragePoolObjPtr pool,
cmd = virCommandNewArgList(ZFS,
"list", "-Hp",
"-t", "volume", "-r",
- "-o", "name,volsize",
+ "-o", "name,volsize,refreservation",
pool->def->source.name,
NULL);
virCommandSetOutputBuffer(cmd, &volumes_list);
@@ -320,15 +334,28 @@ virStorageBackendZFSCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
goto cleanup;
/**
* $ zfs create -o volmode=dev -V 10240K test/volname
+ * $ zfs create -o volmode=dev -s -V 10240K test/volname
+ * $ zfs create -o volmode=dev -s -o refreservation=1024K -V 10240K test/volname
*
* -o volmode=dev -- we want to get volumes exposed as cdev
* devices. If we don't specify that zfs
* will lookup vfs.zfs.vol.mode sysctl value
+ * -s -- create a sparse volume
+ * -o refreservation -- reserve the specified amount of space
* -V -- tells to create a volume with the specified size
*/
cmd = virCommandNewArgList(ZFS, "create", NULL);
if (volmode_needed)
virCommandAddArgList(cmd, "-o", "volmode=dev", NULL);
+ if (vol->target.capacity != vol->target.allocation) {
+ virCommandAddArg(cmd, "-s");
+ if (vol->target.allocation > 0) {
+ virCommandAddArg(cmd, "-o");
+ virCommandAddArgFormat(cmd, "refreservation=%lluK",
+ VIR_DIV_UP(vol->target.allocation, 1024));
+ }
+ vol->target.sparse = true;
+ }
virCommandAddArg(cmd, "-V");
virCommandAddArgFormat(cmd, "%lluK",
VIR_DIV_UP(vol->target.capacity, 1024));
--
2.1.4
8 years, 7 months
[libvirt] [libvirt-sandbox PATCH] virt-sandbox: document how to pass arguments to commands
by Guido Günther
The example was already correct but the synopsis didn't mention '--' is
required.
---
bin/virt-sandbox.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/virt-sandbox.c b/bin/virt-sandbox.c
index 9495e85..d6a441c 100644
--- a/bin/virt-sandbox.c
+++ b/bin/virt-sandbox.c
@@ -345,7 +345,9 @@ virt-sandbox - Run cmd under a virtual machine sandbox
=head1 SYNOPSIS
-virt-sandbox [OPTIONS...] COMMAND [CMDARG1 [CMDARG2 [...]]]
+virt-sandbox [OPTIONS...] COMMAND
+
+virt-sandbox [OPTIONS...] -- COMMAND [CMDARG1 [CMDARG2 [...]]]
=head1 DESCRIPTION
--
2.8.0.rc3
8 years, 7 months