[libvirt] [RESEND PATCH] qemu: Add support for virt machine type with virtio-mmio devices on armv7
by Clark Laughlin
These changes allow the correct virtio-blk-device and virtio-net-device
devices to be used for the 'virt' machine type for armv7 rather than the
PCI virtio devices.
Signed-off-by: Clark Laughlin <clark.laughlin(a)linaro.org>
---
Resend, with signed-off-by added and updated subject.
---
src/qemu/qemu_command.c | 4 +++-
src/qemu/qemu_domain.c | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 63e235d..901120e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1335,12 +1335,14 @@ cleanup:
return ret;
}
+
static int
qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
if (def->os.arch == VIR_ARCH_ARMV7L &&
- STRPREFIX(def->os.machine, "vexpress-") &&
+ (STRPREFIX(def->os.machine, "vexpress-") ||
+ STREQ(def->os.machine, "virt")) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
qemuDomainPrimeVirtioDeviceAddresses(
def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 81d0ba9..346fec3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -797,6 +797,9 @@ qemuDomainDefaultNetModel(const virDomainDef *def)
if (STREQ(def->os.machine, "versatilepb"))
return "smc91c111";
+ if (STREQ(def->os.machine, "virt"))
+ return "virtio";
+
/* Incomplete. vexpress (and a few others) use this, but not all
* arm boards */
return "lan9118";
--
1.8.1.2
11 years
[libvirt] [PATCH] Fix off-by-1 in default SELinux MCS range
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
For a while we're have random failures of 'securityselinuxtest'
which were not at all reproducible. Fortunately we finally
caught a failure with VIR_TEST_DEBUG=1 enabled. This revealed
TEST: securityselinuxtest
1) GenLabel "dynamic unconfined, s0, c0.c1023" ... OK
2) GenLabel "dynamic unconfined, s0, c0.c1023" ... OK
3) GenLabel "dynamic unconfined, s0, c0.c1023" ... OK
4) GenLabel "dynamic virtd, s0, c0.c1023" ... OK
5) GenLabel "dynamic virtd, s0, c0.c10" ... OK
6) GenLabel "dynamic virtd, s2-s3, c0.c1023" ... OK
7) GenLabel "dynamic virtd, missing range" ... Category two 1024 is out of range 0-1023
FAILED
FAIL: securityselinuxtest
And sure enough we had an off-by-1 in the MCS range code when
the current process has no range set. The test suite randomly
allocates 2 categories from 0->1024 so the chances of hitting
this in the test suite were slim indeed :-)
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/security/security_selinux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 310e300..ace9cc0 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -218,10 +218,10 @@ virSecuritySELinuxMCSGetProcessRange(char **sens,
*tmp = '\0';
/* sens now just contains the sensitivity lower bound */
- /* If there was no category part, just assume c0.c1024 */
+ /* If there was no category part, just assume c0.c1023 */
if (!cat) {
*catMin = 0;
- *catMax = 1024;
+ *catMax = 1023;
ret = 0;
goto cleanup;
}
--
1.8.3.1
11 years
[libvirt] block-backup API for libvirt
by Ian Main
In qemu there will soon be drive-backup and block-backup commands that
allow you to create backups or point-in-time snapshots of VM images.
The original feature that drove this was to allow 'image fleecing',
which involves creating a light weight mechanism to take a point in time
snapshot of the running VM and access that remotely.
You can get a good idea of the API from this post:
http://lists.gnu.org/archive/html/qemu-devel/2013-10/msg02266.html
I would like to see this available via libvirt and wanted to start
working on a suitable API. I'm curious if anyone has any input on how
they would like to see this done? While I have done some work with and
on libvirt I'm no expert on the design philosophy behind the APIs so
some direction here before I get coding would be much appreciated.
>From what I can tell a volume based API that creates 'backups' and does
the NBD export call could work but I'd like to hear if that's
reasonable.
Thanks!
Ian
11 years
[libvirt] [PATCH] Rename virDomainGetRootFilesystem to virDomainGetFilesystemForTarget
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The virDomainGetRootFilesystem method can be generalized to allow
any filesystem path to be obtained.
While doing this, start a new test case for purpose of testing various
helper methods in the domain_conf.{c,h} files, such as this one.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
.gitignore | 1 +
src/conf/domain_conf.c | 5 +-
src/conf/domain_conf.h | 3 +-
src/libvirt_private.syms | 2 +-
src/lxc/lxc_container.c | 2 +-
src/lxc/lxc_process.c | 2 +-
tests/Makefile.am | 6 ++
tests/domainconfdata/getfilesystem.xml | 28 ++++++++
tests/domainconftest.c | 120 +++++++++++++++++++++++++++++++++
tests/testutils.c | 57 ++++++++++++++++
tests/testutils.h | 5 ++
11 files changed, 225 insertions(+), 6 deletions(-)
create mode 100644 tests/domainconfdata/getfilesystem.xml
create mode 100644 tests/domainconftest.c
diff --git a/.gitignore b/.gitignore
index 6b024e7..acf73a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -158,6 +158,7 @@
/tests/commandtest
/tests/conftest
/tests/cputest
+/tests/domainconftest
/tests/domainsnapshotxml2xmltest
/tests/esxutilstest
/tests/eventtest
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d3f1ca2..23fea0e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17600,12 +17600,13 @@ virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
}
virDomainFSDefPtr
-virDomainGetRootFilesystem(virDomainDefPtr def)
+virDomainGetFilesystemForTarget(virDomainDefPtr def,
+ const char *path)
{
size_t i;
for (i = 0; i < def->nfss; i++) {
- if (STREQ(def->fss[i]->dst, "/"))
+ if (STREQ(def->fss[i]->dst, path))
return def->fss[i];
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 4561ccc..22cbd5b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2497,7 +2497,8 @@ int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
int *busIdx,
int *devIdx);
-virDomainFSDefPtr virDomainGetRootFilesystem(virDomainDefPtr def);
+virDomainFSDefPtr virDomainGetFilesystemForTarget(virDomainDefPtr def,
+ const char *path);
int virDomainFSIndexByName(virDomainDefPtr def, const char *name);
int virDomainVideoDefaultType(const virDomainDef *def);
int virDomainVideoDefaultRAM(const virDomainDef *def, int type);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index a705c56..2d3d7f1 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -222,7 +222,7 @@ virDomainFSTypeFromString;
virDomainFSTypeToString;
virDomainFSWrpolicyTypeFromString;
virDomainFSWrpolicyTypeToString;
-virDomainGetRootFilesystem;
+virDomainGetFilesystemForTarget;
virDomainGraphicsAuthConnectedTypeFromString;
virDomainGraphicsAuthConnectedTypeToString;
virDomainGraphicsDefFree;
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 2bdf957..12d957a 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1847,7 +1847,7 @@ static int lxcContainerChild(void *data)
if (lxcContainerSetID(vmDef) < 0)
goto cleanup;
- root = virDomainGetRootFilesystem(vmDef);
+ root = virDomainGetFilesystemForTarget(vmDef, "/");
if (argv->nttyPaths) {
const char *tty = argv->ttyPaths[0];
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index c51c4d5..d15cde3 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -930,7 +930,7 @@ virLXCProcessReadLogOutput(virDomainObjPtr vm,
static int
virLXCProcessEnsureRootFS(virDomainObjPtr vm)
{
- virDomainFSDefPtr root = virDomainGetRootFilesystem(vm->def);
+ virDomainFSDefPtr root = virDomainGetFilesystemForTarget(vm->def, "/");
if (root)
return 0;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e46d5f7..0ef82fb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -64,6 +64,7 @@ EXTRA_DIST = \
commanddata \
confdata \
cputestdata \
+ domainconfdata \
domainschemadata \
domainschematest \
domainsnapshotschematest \
@@ -138,6 +139,7 @@ test_programs = virshtest sockettest \
virportallocatortest \
sysinfotest \
virstoragetest \
+ domainconftest \
$(NULL)
if WITH_REMOTE
@@ -884,6 +886,10 @@ sysinfotest_SOURCES = \
sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)
+domainconftest_SOURCES = \
+ domainconftest.c testutils.h testutils.c
+domainconftest_LDADD = $(LDADDS)
+
fdstreamtest_SOURCES = \
fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)
diff --git a/tests/domainconfdata/getfilesystem.xml b/tests/domainconfdata/getfilesystem.xml
new file mode 100644
index 0000000..2ee78b4
--- /dev/null
+++ b/tests/domainconfdata/getfilesystem.xml
@@ -0,0 +1,28 @@
+<domain type='test'>
+ <name>demo</name>
+ <uuid>8369f1ac-7e46-e869-4ca5-759d51478066</uuid>
+ <memory unit='KiB'>500000</memory>
+ <currentMemory unit='KiB'>500000</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ <init>/bin/sh</init>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <filesystem type='mount' accessmode='passthrough'>
+ <source dir='/'/>
+ <target dir='/'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='passthrough'>
+ <source dir='/'/>
+ <target dir='/dev'/>
+ </filesystem>
+ <console type='pty'>
+ <target type='lxc' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/domainconftest.c b/tests/domainconftest.c
new file mode 100644
index 0000000..d38ef5c
--- /dev/null
+++ b/tests/domainconftest.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2013 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Author: Daniel P. Berrange <berrange(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include "testutils.h"
+#include "virerror.h"
+#include "viralloc.h"
+#include "virlog.h"
+
+#include "domain_conf.h"
+
+#define VIR_FROM_THIS VIR_FROM_NONE
+
+static virCapsPtr caps;
+static virDomainXMLOptionPtr xmlopt;
+
+struct testGetFilesystemData {
+ const char *filename;
+ const char *path;
+ bool expectEntry;
+};
+
+static int testGetFilesystem(const void *opaque)
+{
+ int ret = -1;
+ char *xmlData = NULL;
+ virDomainDefPtr def = NULL;
+ char *filename = NULL;
+ const struct testGetFilesystemData *data = opaque;
+ virDomainFSDefPtr fsdef;
+
+ if (virAsprintf(&filename, "%s/domainconfdata/%s.xml",
+ abs_srcdir, data->filename) < 0)
+ goto cleanup;
+
+ if (virtTestLoadFile(filename, &xmlData) < 0)
+ goto cleanup;
+
+ if (!(def = virDomainDefParseString(xmlData, caps, xmlopt,
+ 1 << VIR_DOMAIN_VIRT_TEST, 0)))
+ goto cleanup;
+
+ fsdef = virDomainGetFilesystemForTarget(def,
+ data->path);
+ if (!fsdef) {
+ if (data->expectEntry) {
+ fprintf(stderr, "Expected FS for path '%s' in '%s'\n",
+ data->path, filename);
+ goto cleanup;
+ }
+ } else {
+ if (!data->expectEntry) {
+ fprintf(stderr, "Unexpected FS for path '%s' in '%s'\n",
+ data->path, filename);
+ goto cleanup;
+ }
+ }
+
+ ret = 0;
+
+cleanup:
+ virDomainDefFree(def);
+ VIR_FREE(xmlData);
+ VIR_FREE(filename);
+ return ret;
+}
+
+static int
+mymain(void)
+{
+ int ret = 0;
+
+ if ((caps = virTestGenericCapsInit()) == NULL)
+ goto cleanup;
+
+ if (!(xmlopt = virTestGenericDomainXMLConfInit()))
+ goto cleanup;
+
+#define DO_TEST_GET_FS(fspath, expect) \
+ do { \
+ struct testGetFilesystemData data = { \
+ .filename = "getfilesystem", \
+ .path = fspath, \
+ .expectEntry = expect, \
+ }; \
+ if (virtTestRun("Get FS " fspath, testGetFilesystem, &data) < 0) \
+ ret = -1; \
+ } while (0)
+
+ DO_TEST_GET_FS("/", true);
+ DO_TEST_GET_FS("/dev", true);
+ DO_TEST_GET_FS("/dev/pts", false);
+ DO_TEST_GET_FS("/doesnotexist", false);
+
+ virObjectUnref(caps);
+ virObjectUnref(xmlopt);
+
+ cleanup:
+ return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+VIRT_TEST_MAIN(mymain)
diff --git a/tests/testutils.c b/tests/testutils.c
index 5d634b4..5975715 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -654,3 +654,60 @@ int virtTestClearLineRegex(const char *pattern,
return 0;
}
+
+
+virCapsPtr virTestGenericCapsInit(void)
+{
+ virCapsPtr caps;
+ virCapsGuestPtr guest;
+
+ if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64,
+ 0, 0)) == NULL)
+ return NULL;
+
+ if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_I686,
+ "/usr/bin/acme-virt", NULL,
+ 0, NULL)) == NULL)
+ goto error;
+
+ if (!virCapabilitiesAddGuestDomain(guest, "test", NULL, NULL, 0, NULL))
+ goto error;
+
+
+ if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_X86_64,
+ "/usr/bin/acme-virt", NULL,
+ 0, NULL)) == NULL)
+ goto error;
+
+ if (!virCapabilitiesAddGuestDomain(guest, "test", NULL, NULL, 0, NULL))
+ goto error;
+
+
+ if (virTestGetDebug()) {
+ char *caps_str;
+
+ caps_str = virCapabilitiesFormatXML(caps);
+ if (!caps_str)
+ goto error;
+
+ fprintf(stderr, "Generic driver capabilities:\n%s", caps_str);
+
+ VIR_FREE(caps_str);
+ }
+
+ return caps;
+
+error:
+ virObjectUnref(caps);
+ return NULL;
+}
+
+static virDomainDefParserConfig virTestGenericDomainDefParserConfig;
+static virDomainXMLPrivateDataCallbacks virTestGenericPrivateDataCallbacks;
+
+virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void)
+{
+ return virDomainXMLOptionNew(&virTestGenericDomainDefParserConfig,
+ &virTestGenericPrivateDataCallbacks,
+ NULL);
+}
diff --git a/tests/testutils.h b/tests/testutils.h
index 478b53c..4781e04 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -27,6 +27,8 @@
# include "viralloc.h"
# include "virfile.h"
# include "virstring.h"
+# include "capabilities.h"
+# include "domain_conf.h"
# define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
# define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken */
@@ -98,4 +100,7 @@ int virtTestMain(int argc,
return virtTestMain(argc, argv, func); \
}
+virCapsPtr virTestGenericCapsInit(void);
+virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void);
+
#endif /* __VIT_TEST_UTILS_H__ */
--
1.8.3.1
11 years
[libvirt] [PATCH] Add missing break to switch-case block
by Doug Goldstein
The case label for VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED did not have its
own break statement but relied on falling through which we probably
don't want.
---
python/libvirt-override.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 2e58bf9..747c877 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -6399,6 +6399,7 @@ libvirt_virConnectDomainEventRegisterAny(ATTRIBUTE_UNUSED PyObject * self,
break;
case VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED:
cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventDeviceRemovedCallback);
+ break;
case VIR_DOMAIN_EVENT_ID_LAST:
break;
--
1.8.3.2
11 years
[libvirt] [libvirt-python 00/18] Remaining bits for libvirt-python split
by Doug Goldstein
As a follow up to Daniel Berrange's libvirt-python creation patchset [1],
I've added the following to allow the repo to build against multiple
versions of libvirt. I've successfully built it against libvirt 0.10.2.8
from Fedora 18 but will test further against some other distros as well.
If you just want something clone-able you can get the full repo from:
git clone https://github.com/cardoe/libvirt-python.git
And since its github you can see the web page at:
https://github.com/cardoe/libvirt-python
The patchset is still a work in progress for the following:
* commit message clean up
* tests against additional versions
I'm really curious to see how far back people want to support things.
[1] http://www.redhat.com/archives/libvir-list/2013-November/msg00416.html
Doug Goldstein (18):
Bump version number to current 1.1.5
Add missing URL attribute to setup.py
Add maintainer/maintainer_email to the libvirt list
Add libvirt version check macro from libvirt upstream
Break generator.py to be called per module
Create array of modules to be built
Don't build LXC module when building less than 1.0.2
virTypedParams* API appeared in 1.0.2
virNodeGetCPUMap API not added until 1.0.0
virDomainMigrate3 and virDomainMigrateToURI3 not added until 1.1.0
Wrap new domain create APIs added in 1.1.1
virConnectGetCPUModelNames() did not appear until 1.1.3
virDomainGetJobStats() was added in 1.0.3
virDomainMigrateGetCompressionCache() was added in 1.0.3
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK added in 1.0.0
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED was added in 1.1.1
Add missing break to switch-case block
Bring some virTypedParams* API from libvirt
generator.py | 24 ++++++++++++------------
libvirt-override.c | 40 ++++++++++++++++++++++++++++++++++++++--
libvirt-utils.c | 43 +++++++++++++++++++++++++++++++++++++++++++
libvirt-utils.h | 16 ++++++++++++++++
setup.py | 53 +++++++++++++++++++++++++++++++++++++++++------------
5 files changed, 150 insertions(+), 26 deletions(-)
--
1.8.3.2
11 years
[libvirt] [PATCH] qemumonitorjsontest: Introduce GetNonExistingCPUData test
by Michal Privoznik
In the 730af8f2cd commit we are fixing broken qemu startup on systems
with ancient qemu. This commit introduces the regression test for that
specific case to make sure we don't break it again.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/qemumonitorjsontest.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 4cdb938..2152e4a 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2038,6 +2038,49 @@ cleanup:
return ret;
}
+static int
+testQemuMonitorJSONGetNonExistingCPUData(const void *opaque)
+{
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr) opaque;
+ qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
+ virCPUDataPtr cpuData = NULL;
+ int rv, ret = -1;
+
+ if (!test)
+ return -1;
+
+ if (qemuMonitorTestAddItem(test, "qom-list",
+ "{"
+ " \"id\": \"libvirt-7\","
+ " \"error\": {"
+ " \"class\": \"CommandNotFound\","
+ " \"desc\": \"The command qom-list has not been found\""
+ " }"
+ "}") < 0)
+ goto cleanup;
+
+ rv = qemuMonitorJSONGetGuestCPU(qemuMonitorTestGetMonitor(test),
+ VIR_ARCH_X86_64,
+ &cpuData);
+ if (rv != -2) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "Unexpected return value %d, expecting -2", rv);
+ goto cleanup;
+ }
+
+ if (cpuData) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "Unexpected allocation of data = %p, expecting NULL",
+ cpuData);
+ goto cleanup;
+ }
+
+ ret = 0;
+cleanup:
+ qemuMonitorTestFree(test);
+ cpuDataFree(cpuData);
+ return ret;
+}
static int
mymain(void)
@@ -2094,6 +2137,7 @@ mymain(void)
DO_TEST(SetObjectProperty);
DO_TEST(GetDeviceAliases);
DO_TEST(CPU);
+ DO_TEST(GetNonExistingCPUData);
DO_TEST_SIMPLE("qmp_capabilities", qemuMonitorJSONSetCapabilities);
DO_TEST_SIMPLE("system_powerdown", qemuMonitorJSONSystemPowerdown);
DO_TEST_SIMPLE("system_reset", qemuMonitorJSONSystemReset);
--
1.8.3.2
11 years
[libvirt] [PATCH] qemuMonitorJSONGetCPUx86Data: Don't fail on ancient qemus
by Michal Privoznik
On the domain startup, this function is called to dump some info about
the CPUs. At the beginning of the function we check if we aren't running
older qemu which is not exposing the CPUs via 'qom-list'. However, we
are not checking for even older qemus, which throw 'CommandNotFound'
error.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e716fb3..ec3b958 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5528,11 +5528,13 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon,
goto cleanup;
/* check if device exists */
- if ((data = virJSONValueObjectGet(reply, "error")) &&
- STREQ_NULLABLE(virJSONValueObjectGetString(data, "class"),
- "DeviceNotFound")) {
- ret = -2;
- goto cleanup;
+ if ((data = virJSONValueObjectGet(reply, "error"))) {
+ const char *klass = virJSONValueObjectGetString(data, "class");
+ if (STREQ_NULLABLE(klass, "DeviceNotFound") ||
+ STREQ_NULLABLE(klass, "CommandNotFound")) {
+ ret = -2;
+ goto cleanup;
+ }
}
if (qemuMonitorJSONCheckError(cmd, reply))
--
1.8.3.2
11 years
[libvirt] ANNOUNCE: libvirt-sandbox "Cholistan" release 0.5.1
by Daniel P. Berrange
I pleased to announce the a new public release of libvirt-sandbox,
version 0.5.0, is now available for download
ftp://libvirt.org/libvirt/sandbox/
The packages are GPG signed with
Key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF (4096R)
The libvirt-sandbox package provides an API layer on top of libvirt-gobject
which facilitates the cration of application sandboxes using virtualization
technology. An application sandbox is a virtual machine or container that
runs a single application binary, directly from the host OS filesystem.
In other words there is no separate guest operating system install to build
or manager.
At this point in time libvirt-sandbox can create sandboxes using either LXC
or KVM, and should in theory be extendable to any libvirt driver.
This release focused on exclusively on bugfixing
Changed in this release:
- Fix path to systemd binary (prefers dir /lib/systemd not /bin)
- Remove obsolete commands from virt-sandbox-service man page
- Fix delete of running service container
- Allow use of custom root dirs with 'virt-sandbox --root DIR'
- Fix 'upgrade' command for virt-sandbox-service generic services
- Fix logrotate script to use virsh for listing sandboxed services
- Add 'inherit' option for virt-sandbox '-s' security context
option, to auto-copy calling process' context
- Remove non-existant '-S' option froom virt-sandbox-service man
page
- Fix line break formatting of man page
- Mention LIBVIRT_DEFAULT_URI in virt-sandbox-service man page
- Check some return values in libvirt-sandbox-init-qemu
- Remove unused variables
- Fix crash with partially specified mount option string
- Add man page docs for 'ram' mount type
- Avoid close of un-opened file descriptor
- Fix leak of file handles in init helpers
- Log a message if sandbox cleanup fails
- Cope with domain being missing when deleting container
- Improve stack trace diagnostics in virt-sandbox-service
- Fix virt-sandbox-service content copying code when faced with
non-regular files.
- Improve error reporting if kernel does not exist
- Allow kernel version/path/kmod to be set with virt-sandbox
- Don't overmount '/root' in QEMU sandboxes by default
- Fix nosuid / nodev mount options for tmpfs
- Force 9p2000.u protocol version to avoid QEMU bugs
- Fix cleanup when failing to start interactive sandbox
- Create copy of kernel from /boot to allow relabelling
- Bulk re-indent of code
- Avoid crash when gateway is missing in network options
- Fix symlink target created in multi-user.target.wants
- Add '-p PATH' option for virt-sandbox-service clone/delete
to match 'create' command option.
- Only allow 'lxc:///' URIs with virt-sandbox-service
until further notice
- Rollback state if cloning a service sandbox fails
- Add more kernel modules instead of assuming they are
all builtins
- Don't complain if some kmods are missing, as they may
be builtins
- Allow --mount to be repeated with virt-sandbox-service
Thanks to everyone who contributed to this release
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
11 years
[libvirt] [PATCH] Fix virsh net-info output for consistency
by hliu@redhat.com
From: Hao Liu <hliu(a)redhat.com>
All *-info virsh commands output a list of comma seperated key-val pairs.
But virsh net-info command misses this comma for key "Name" and "UUID".
Signed-off-by: Hao Liu <hliu(a)redhat.com>
---
tools/virsh-network.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index 8ddd5ca..44a676b 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -367,10 +367,10 @@ cmdNetworkInfo(vshControl *ctl, const vshCmd *cmd)
if (!(network = vshCommandOptNetwork(ctl, cmd, NULL)))
return false;
- vshPrint(ctl, "%-15s %s\n", _("Name"), virNetworkGetName(network));
+ vshPrint(ctl, "%-15s %s\n", _("Name:"), virNetworkGetName(network));
if (virNetworkGetUUIDString(network, uuid) == 0)
- vshPrint(ctl, "%-15s %s\n", _("UUID"), uuid);
+ vshPrint(ctl, "%-15s %s\n", _("UUID:"), uuid);
active = virNetworkIsActive(network);
if (active >= 0)
--
1.8.3.1
11 years