[libvirt] [PATCH] virsh-domain: Check if domain is running for ttyconsole cmd
by Yanbing Du
Signed-off-by: Yanbing Du <ydu(a)redhat.com>
---
tools/virsh-domain.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4081451..9ccbc35 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9139,6 +9139,12 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
+ /* Check if the domain is active */
+ if (!virDomainIsActive(dom)) {
+ vshError(ctl, _("Domain is not running"));
+ goto cleanup;
+ }
+
doc = virDomainGetXMLDesc(dom, 0);
if (!doc)
goto cleanup;
--
1.7.1
11 years, 2 months
[libvirt] [PATCH] Fix parallel runs of TLS test suites
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Use a seperate keyfile name for the two TLS test suites so that
they don't clash when running tests in parallel
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
tests/virnettlscontexttest.c | 10 ++++++----
tests/virnettlshelpers.c | 6 ++----
tests/virnettlshelpers.h | 6 ++----
tests/virnettlssessiontest.c | 10 ++++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index 9ade785..53792ee 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -40,6 +40,8 @@
# define VIR_FROM_THIS VIR_FROM_RPC
+# define KEYFILE "key-ctx.pem"
+
struct testTLSContextData {
bool isServer;
const char *cacrt;
@@ -66,7 +68,7 @@ static int testTLSContextInit(const void *opaque)
ctxt = virNetTLSContextNewServer(data->cacrt,
NULL,
data->crt,
- keyfile,
+ KEYFILE,
NULL,
true,
true);
@@ -74,7 +76,7 @@ static int testTLSContextInit(const void *opaque)
ctxt = virNetTLSContextNewClient(data->cacrt,
NULL,
data->crt,
- keyfile,
+ KEYFILE,
true,
true);
}
@@ -109,7 +111,7 @@ mymain(void)
{
int ret = 0;
- testTLSInit();
+ testTLSInit(KEYFILE);
# define DO_CTX_TEST(_isServer, _caCrt, _crt, _expectFail) \
do { \
@@ -617,7 +619,7 @@ mymain(void)
testTLSDiscardCert(&clientcertlevel2breq);
unlink("cacertchain.pem");
- testTLSCleanup();
+ testTLSCleanup(KEYFILE);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c
index 39a2df6..8a10340 100644
--- a/tests/virnettlshelpers.c
+++ b/tests/virnettlshelpers.c
@@ -34,8 +34,6 @@
# define VIR_FROM_THIS VIR_FROM_RPC
-const char *keyfile = abs_builddir "/virnettlscontexttest-key.pem";
-
/*
* These store some static data that is needed when
* encoding extensions in the x509 certs
@@ -99,7 +97,7 @@ static gnutls_x509_privkey_t testTLSLoadKey(void)
}
-void testTLSInit(void)
+void testTLSInit(const char *keyfile)
{
gnutls_global_init();
@@ -112,7 +110,7 @@ void testTLSInit(void)
}
-void testTLSCleanup(void)
+void testTLSCleanup(const char *keyfile)
{
asn1_delete_structure(&pkix_asn1);
unlink(keyfile);
diff --git a/tests/virnettlshelpers.h b/tests/virnettlshelpers.h
index 7c3f8da..3f6afb9 100644
--- a/tests/virnettlshelpers.h
+++ b/tests/virnettlshelpers.h
@@ -28,8 +28,6 @@
# include "rpc/virnettlscontext.h"
-extern const char *keyfile;
-
/*
* This contains parameter about how to generate
* certificates.
@@ -76,7 +74,7 @@ void testTLSWriteCertChain(const char *filename,
size_t ncerts);
void testTLSDiscardCert(struct testTLSCertReq *req);
-void testTLSInit(void);
-void testTLSCleanup(void);
+void testTLSInit(const char *keyfile);
+void testTLSCleanup(const char *keyfile);
#endif
diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
index bc176aa..9b171ed 100644
--- a/tests/virnettlssessiontest.c
+++ b/tests/virnettlssessiontest.c
@@ -38,6 +38,8 @@
# define VIR_FROM_THIS VIR_FROM_RPC
+# define KEYFILE "key-sess.pem"
+
struct testTLSSessionData {
const char *servercacrt;
const char *clientcacrt;
@@ -107,7 +109,7 @@ static int testTLSSessionInit(const void *opaque)
serverCtxt = virNetTLSContextNewServer(data->servercacrt,
NULL,
data->servercrt,
- keyfile,
+ KEYFILE,
data->wildcards,
false,
true);
@@ -115,7 +117,7 @@ static int testTLSSessionInit(const void *opaque)
clientCtxt = virNetTLSContextNewClient(data->clientcacrt,
NULL,
data->clientcrt,
- keyfile,
+ KEYFILE,
false,
true);
@@ -236,7 +238,7 @@ mymain(void)
{
int ret = 0;
- testTLSInit();
+ testTLSInit(KEYFILE);
# define DO_SESS_TEST(_caCrt, _serverCrt, _clientCrt, _expectServerFail, \
_expectClientFail, _hostname, _wildcards) \
@@ -474,7 +476,7 @@ mymain(void)
testTLSDiscardCert(&clientcertlevel2breq);
unlink("cacertchain.pem");
- testTLSCleanup();
+ testTLSCleanup(KEYFILE);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] docs: mention VIR_TEST_RANGE
by Eric Blake
Commit ab92ae333 added a cool feature, but didn't document it.
* docs/hacking.html.in: Document debugging a subset of tests.
* HACKING: Regenerate.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the trivial rule, as I found myself wanting to
use this during development today.
HACKING | 5 +++++
docs/hacking.html.in | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/HACKING b/HACKING
index 256e8ae..f9f8381 100644
--- a/HACKING
+++ b/HACKING
@@ -123,6 +123,11 @@ VIR_TEST_DEBUG may provide larger amounts of information:
VIR_TEST_DEBUG=1 make check (or)
VIR_TEST_DEBUG=2 make check
+When debugging failures during development, it is possible to focus in on just
+the failing subtests by using TESTS and VIR_TEST_RANGE:
+
+ make check VIR_TEST_DEBUG=1 VIR_TEST_RANGE=3-5 TESTS=qemuxml2argvtest
+
Also, individual tests can be run from inside the "tests/" directory, like:
./qemuxml2xmltest
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 0892b73..543c77e 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -141,6 +141,17 @@
VIR_TEST_DEBUG=1 make check (or)
VIR_TEST_DEBUG=2 make check
</pre>
+
+ <p>
+ When debugging failures during development, it is possible
+ to focus in on just the failing subtests by using TESTS and
+ VIR_TEST_RANGE:
+ </p>
+
+<pre>
+ make check VIR_TEST_DEBUG=1 VIR_TEST_RANGE=3-5 TESTS=qemuxml2argvtest
+</pre>
+
<p>
Also, individual tests can be run from inside the <code>tests/</code>
directory, like:
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH v2 1/5] cgroup macros refactoring
by Roman Bogorodskiy
- Introduce VIR_CGROUP_SUPPORTED conditional
- Convert virCgroupKill* to use it
- Convert virCgroupIsolateMount() to use it
---
src/util/vircgroup.c | 59 ++++++++++++++++++++++++++++------------------------
1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index cfb4b3f..5f656b1 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -56,6 +56,11 @@
#define VIR_FROM_THIS VIR_FROM_CGROUP
+#if defined(__linux__) && defined(HAVE_GETMNTENT_R) \
+ && defined(_DIRENT_HAVE_D_TYPE)
+# define VIR_CGROUP_SUPPORTED
+#endif
+
VIR_ENUM_IMPL(virCgroupController, VIR_CGROUP_CONTROLLER_LAST,
"cpu", "cpuacct", "cpuset", "memory", "devices",
"freezer", "blkio", "net_cls", "perf_event",
@@ -2682,7 +2687,7 @@ int virCgroupGetFreezerState(virCgroupPtr group, char **state)
}
-#if defined HAVE_KILL && defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#ifdef VIR_CGROUP_SUPPORTED
/*
* Returns 1 if some PIDs are killed, 0 if none are killed, or -1 on error
*/
@@ -2866,6 +2871,7 @@ cleanup:
return ret;
}
+
int virCgroupKillRecursive(virCgroupPtr group, int signum)
{
int ret;
@@ -2911,31 +2917,7 @@ int virCgroupKillPainfully(virCgroupPtr group)
return ret;
}
-#else /* !(HAVE_KILL, HAVE_MNTENT_H, HAVE_GETMNTENT_R) */
-int virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
- int signum ATTRIBUTE_UNUSED)
-{
- virReportSystemError(ENOSYS, "%s",
- _("Control groups not supported on this platform"));
- return -1;
-}
-int virCgroupKillRecursive(virCgroupPtr group ATTRIBUTE_UNUSED,
- int signum ATTRIBUTE_UNUSED)
-{
- virReportSystemError(ENOSYS, "%s",
- _("Control groups not supported on this platform"));
- return -1;
-}
-int virCgroupKillPainfully(virCgroupPtr group ATTRIBUTE_UNUSED)
-{
- virReportSystemError(ENOSYS, "%s",
- _("Control groups not supported on this platform"));
- return -1;
-}
-#endif /* HAVE_KILL, HAVE_MNTENT_H, HAVE_GETMNTENT_R */
-
-#ifdef __linux__
static char *virCgroupIdentifyRoot(virCgroupPtr group)
{
char *ret = NULL;
@@ -3048,7 +3030,30 @@ cleanup:
VIR_FREE(opts);
return ret;
}
-#else /* __linux__ */
+#else /* VIR_CGROUP_SUPPORTED */
+int virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
+ int signum ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Control groups not supported on this platform"));
+ return -1;
+}
+
+int virCgroupKillRecursive(virCgroupPtr group ATTRIBUTE_UNUSED,
+ int signum ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Control groups not supported on this platform"));
+ return -1;
+}
+
+int virCgroupKillPainfully(virCgroupPtr group ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Control groups not supported on this platform"));
+ return -1;
+}
+
int virCgroupIsolateMount(virCgroupPtr group ATTRIBUTE_UNUSED,
const char *oldroot ATTRIBUTE_UNUSED,
const char *mountopts ATTRIBUTE_UNUSED)
@@ -3057,4 +3062,4 @@ int virCgroupIsolateMount(virCgroupPtr group ATTRIBUTE_UNUSED,
_("Control groups not supported on this platform"));
return -1;
}
-#endif /* __linux__ */
+#endif /* VIR_CGROUP_SUPPORTED */
--
1.8.2.3
11 years, 2 months
[libvirt] [PATCH] xen: fix memory corruption in legacy driver
by Jim Fehlig
Commit 632180d1 introduced memory corruption in xenDaemonListDefinedDomains
by starting to populate the names array at index -1, causing all sorts
of havoc in libvirtd such as aborts like the following
*** Error in `/usr/sbin/libvirtd': double free or corruption (out): 0x00007fffe00ccf20 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7abf6)[0x7ffff3fa0bf6]
/lib64/libc.so.6(+0x7b973)[0x7ffff3fa1973]
/lib64/libc.so.6(xdr_array+0xde)[0x7ffff403cbae]
/usr/sbin/libvirtd(+0x50251)[0x5555555a4251]
/lib64/libc.so.6(xdr_free+0x15)[0x7ffff403ccd5]
/usr/lib64/libvirt.so.0(+0x1fad34)[0x7ffff76b1d34]
/usr/lib64/libvirt.so.0(virNetServerProgramDispatch+0x1fc)[0x7ffff76b16f1]
/usr/lib64/libvirt.so.0(+0x1f214a)[0x7ffff76a914a]
/usr/lib64/libvirt.so.0(+0x1f222d)[0x7ffff76a922d]
/usr/lib64/libvirt.so.0(+0xbcc4f)[0x7ffff7573c4f]
/usr/lib64/libvirt.so.0(+0xbc5e5)[0x7ffff75735e5]
/lib64/libpthread.so.0(+0x7e0f)[0x7ffff48f7e0f]
/lib64/libc.so.6(clone+0x6d)[0x7ffff400e7dd]
Fix by initializing ret to 0 and only setting to error on failure path.
---
src/xen/xend_internal.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 1ce36e6..f698c8d 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2896,7 +2896,7 @@ xenDaemonListDefinedDomains(virConnectPtr conn,
{
struct sexpr *root = NULL;
size_t i;
- int ret = -1;
+ int ret = 0;
struct sexpr *_for_i, *node;
if (maxnames == 0)
@@ -2919,16 +2919,15 @@ xenDaemonListDefinedDomains(virConnectPtr conn,
break;
}
- ret = 0;
-
cleanup:
sexpr_free(root);
return ret;
error:
- for (i = 0; ret != -1 && i < ret; ++i)
+ for (i = 0; i < ret; ++i)
VIR_FREE(names[i]);
+ ret = -1;
goto cleanup;
}
--
1.8.1.4
11 years, 2 months
[libvirt] [PATCH] Add missing ATTRIBUTE_UNUSED
by Guido Günther
to fix the kFreeBSD build.
The network parameter is unused in networkCheckRouteCollision:
http://honk.sigxcpu.org:8001/job/libvirt-build-debian-jessie-kfreebsd64/
---
src/network/bridge_driver_nop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/bridge_driver_nop.c b/src/network/bridge_driver_nop.c
index f983402..23c712d 100644
--- a/src/network/bridge_driver_nop.c
+++ b/src/network/bridge_driver_nop.c
@@ -21,7 +21,7 @@
#include <config.h>
-int networkCheckRouteCollision(virNetworkObjPtr network)
+int networkCheckRouteCollision(virNetworkObjPtr network ATTRIBUTE_UNUSED)
{
return 0;
}
--
1.8.4.rc1
11 years, 2 months
[libvirt] [PATCH] Don't crash in qemuBuildDeviceAddressStr
by Guido Günther
qemuDomainAttachVirtioDiskDevice passes NULL as domainDef which is later
referenced in qemuDomainAttachVirtioDiskDevice:
Program terminated with signal 11, Segmentation fault.
#0 qemuBuildDeviceAddressStr (buf=buf@entry=0xb646de78, info=info@entry=0xb0a02360, qemuCaps=qemuCaps@entry=0xb8fdfdc8,
domainDef=<error reading variable: Unhandled dwarf expression opcode 0xfa>,
domainDef=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at qemu/qemu_command.c:2869
2869 for (i = 0; i < domainDef->ncontrollers; i++) {
(gdb) bt
#0 qemuBuildDeviceAddressStr (buf=buf@entry=0xb646de78, info=info@entry=0xb0a02360, qemuCaps=qemuCaps@entry=0xb8fdfdc8,
domainDef=<error reading variable: Unhandled dwarf expression opcode 0xfa>,
domainDef=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at qemu/qemu_command.c:2869
#1 0xb18ad6f8 in qemuBuildDriveDevStr (def=def@entry=0x0, disk=disk@entry=0xb0a02288, bootindex=bootindex@entry=0, qemuCaps=0xb8fdfdc8)
at qemu/qemu_command.c:4316
#2 0xb18d097f in qemuDomainAttachVirtioDiskDevice (conn=conn@entry=0xb90129a8, driver=driver@entry=0xb8fe29b8, vm=vm@entry=0xb8fe0c40,
disk=disk@entry=0xb0a02288) at qemu/qemu_hotplug.c:278
#3 0xb193f7ba in qemuDomainAttachDeviceDiskLive (dev=0xb0a35308, vm=0xb8fe0c40, driver=0xb8fe29b8, conn=0xb90129a8) at qemu/qemu_driver.c:6356
#4 qemuDomainAttachDeviceLive (dev=0xb0a35308, vm=0xb8fe0c40, dom=<optimized out>) at qemu/qemu_driver.c:6418
#5 qemuDomainAttachDeviceFlags (dom=dom@entry=0xb0a020b8,
xml=xml@entry=0xb90953f0 "<disk type='file' device='disk'>\n <source file='/var/lib/jenkins/jobs/libvirt-tck-build/workspace/scratchdir/200-disk-hotplug/extra.img'/>\n <target dev='vdb' bus='virtio'/>\n</disk>\n", flags=3103664568, flags@entry=1) at qemu/qemu_driver.c:7079
#6 0xb193f9cb in qemuDomainAttachDevice (dom=0xb0a020b8,
xml=0xb90953f0 "<disk type='file' device='disk'>\n <source file='/var/lib/jenkins/jobs/libvirt-tck-build/workspace/scratchdir/200-disk-hotplug/extra.img'/>\n <target dev='vdb' bus='virtio'/>\n</disk>\n") at qemu/qemu_driver.c:7120
#7 0xb7244827 in virDomainAttachDevice (domain=domain@entry=0xb0a020b8,
xml=0xb90953f0 "<disk type='file' device='disk'>\n <source file='/var/lib/jenkins/jobs/libvirt-tck-build/workspace/scratchdir/200-disk-hotplug/extra.img'/>\n <target dev='vdb' bus='virtio'/>\n</disk>\n") at libvirt.c:10912
#8 0xb7765ddb in remoteDispatchDomainAttachDevice (args=0xb9094ef0, rerr=0xb646e1f0, client=<optimized out>, server=<optimized out>,
msg=<optimized out>) at remote_dispatch.h:2296
#9 remoteDispatchDomainAttachDeviceHelper (server=0xb8fba0e8, client=0xb0a00730, msg=0xb0a350b8, rerr=0xb646e1f0, args=0xb9094ef0, ret=0xb9094dc8)
at remote_dispatch.h:2274
#10 0xb72b1013 in virNetServerProgramDispatchCall (msg=0xb0a350b8, client=0xb0a00730, server=0xb8fba0e8, prog=0xb8fc21c8)
at rpc/virnetserverprogram.c:435
#11 virNetServerProgramDispatch (prog=0xb8fc21c8, server=server@entry=0xb8fba0e8, client=0xb0a00730, msg=0xb0a350b8) at rpc/virnetserverprogram.c:305
#12 0xb72aa167 in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0xb8fba0e8)
at rpc/virnetserver.c:165
#13 virNetServerHandleJob (jobOpaque=0xb0a0a850, opaque=0xb8fba0e8) at rpc/virnetserver.c:186
#14 0xb7189108 in virThreadPoolWorker (opaque=opaque@entry=0xb8fa3250) at util/virthreadpool.c:144
#15 0xb71885e5 in virThreadHelper (data=0xb8fa32a8) at util/virthreadpthread.c:161
#16 0xb70d6954 in start_thread (arg=0xb646eb70) at pthread_create.c:304
#17 0xb704e95e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
This was found by libvirtt-tck:
http://honk.sigxcpu.org:8001/job/libvirt-tck-debian-wheezy-qemu-session/1...
---
The problem was introduced somewhere around
4bc331c8945152d8942a23383c3eb92da1bc4194 but I didn't get around to
track this earlier.
Cheers,
-- Guido
---
src/qemu/qemu_hotplug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c9748d9..85d2ca9 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -275,7 +275,7 @@ int qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->qemuCaps)))
goto error;
- if (!(devstr = qemuBuildDriveDevStr(NULL, disk, 0, priv->qemuCaps)))
+ if (!(devstr = qemuBuildDriveDevStr(vm->def, disk, 0, priv->qemuCaps)))
goto error;
}
@@ -616,7 +616,7 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
goto error;
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->qemuCaps)))
goto error;
- if (!(devstr = qemuBuildDriveDevStr(NULL, disk, 0, priv->qemuCaps)))
+ if (!(devstr = qemuBuildDriveDevStr(vm->def, disk, 0, priv->qemuCaps)))
goto error;
}
--
1.8.4.rc1
11 years, 2 months
[libvirt] [PATCH] virsh: nicer abort of blockcopy
by Eric Blake
I attempted 'virsh blockcopy $dom vda $path --wait --verbose', then
hit Ctrl-C; I was a bit surprised to see this error message:
Block Copy: [ 3 %]error: failed to query job for disk vda
when I had been expecting:
Block Copy: [ 3 %]
Copy aborted
* tools/virsh-domain.c (cmdBlockCopy): Print graceful exit message
rather than error when ctrl-c interrupts job.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
tools/virsh-domain.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 8cafce4..4081451 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -1810,10 +1810,13 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
result = virDomainGetBlockJobInfo(dom, path, &info, 0);
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
- if (result <= 0) {
+ if (result < 0) {
vshError(ctl, _("failed to query job for disk %s"), path);
goto cleanup;
}
+ if (result == 0)
+ break;
+
if (verbose)
print_job_progress(_("Block Copy"), info.end - info.cur, info.end);
if (info.cur == info.end)
@@ -1840,13 +1843,14 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
}
}
- if (pivot) {
+ if (!quit && pivot) {
abort_flags |= VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT;
if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
vshError(ctl, _("failed to pivot job for disk %s"), path);
goto cleanup;
}
- } else if (finish && virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
+ } else if (finish && !quit &&
+ virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
vshError(ctl, _("failed to finish job for disk %s"), path);
goto cleanup;
}
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH 0/3] Rest of qemu agent tests and fix of expensive tests
by Peter Krempa
This series contains the rest of the qemu agent tests that have been
tweaked to act according to the VIR_TEST_EXPENSIVE env variable and
also uses it for the virsh-all test
Peter Krempa (3):
qemuagenttest: Test arbitrary command passthrough
qemuagenttest: Test timeout of agent commands
test-lib.sh: Update helper for VIR_TEST_EXPENSIVE and use it in
virsh-all
tests/qemuagenttest.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/test-lib.sh | 10 ++---
tests/virsh-all | 2 +
3 files changed, 112 insertions(+), 5 deletions(-)
--
1.8.3.2
11 years, 2 months
[libvirt] Error while starting the node on ESXi hypervisor
by varun bhatnagar
Hi,
Today I was trying to start a node using libvirt on ESX (esxi-5.1)
hypervisor and I got the following error message:
*virsh # define /local/myNode/esxdomain.xml*
*Domain testNode defined from /local/myNode/esxdomain.xml*
*virsh # start testNode*
*error: Failed to start domain testNode*
*error: internal error: Could not start domain: GenericVmConfigFault -
Cannot open the disk
/vmfs/volues/5208f99d-760cf4a2-000c29520788/testNode.vmdk or one of the
snapshot disks it depends on.*
*
*
*
*
I checked the datastore of my ESX server and found out that instead of file
one directory is getting created with the name* cluster.vmdk *and inside it
there are few more files but cluster.vmdk file is not there.
*
*
/vmfs/volumes # cd datastore1
/vmfs/volues/5208f99d-760cf4a2-000c29520788 # ls
cluster.vmdk
/vmfs/volues/5208f99d-760cf4a2-000c29520788 # cd cluster.vmdk
/vmfs/volues/5208f99d-760cf4a2-000c29520788/cluster.vmdk # ls -ltr
*-rw-r--r-- 1 root root 261 Aug 12 17:30 cluster.vmdk*
*-rw-r--r-- 1 root root 674 Aug 12 17:30 cluster.vmx*
*-rw-r--r-- 1 root root 0 Aug 12 17:30 cluster.vmsd*
/vmfs/volues/5208f99d-760cf4a2-000c29520788/cluster.vmdk #
Can anyone tell me how to start a node and why I am getting that error
message.
Below is my xml file.
*<domain type='vmware'>*
* <name>testNode</name>*
* <uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>*
* <memory>1048576</memory>*
* <currentMemory>1048576</currentMemory>*
* <vcpu>1</vcpu>*
* <os>*
* <type arch='x86_64'>hvm</type>*
* </os>*
* <devices>*
* <disk type='file' device='disk'>*
* <source file='[datastore1] cluster.vmdk'/>*
* <target dev='sda' bus='scsi'/>*
* <address type='drive' controller='0' bus='0' unit='0'/>*
* </disk>*
* <controller type='scsi' index='0'/>*
* <interface type='bridge'>*
* <mac address='00:50:56:25:48:c7'/>*
* <source bridge='VM Network'/>*
* </interface>*
* </devices>*
*</domain>*
11 years, 2 months