[libvirt] [PATCH] Fix warning when macvtap support is disabled
by Jean-Baptiste Rouault
---
src/qemu/qemu_conf.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index b0343c6..7cd0603 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1689,6 +1689,7 @@ qemudPhysIfaceConnect(virConnectPtr conn,
(void)qemuCmdFlags;
(void)driver;
(void)vmuuid;
+ (void)vmop;
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No support for macvtap device"));
rc = -1;
--
1.7.0.4
14 years
[libvirt] [PATCH] qemu: Fix typo in qemuTeardownDiskPathDeny
by Osier Yang
typo in error message, it should be by copy-a-paste
from "qemuSetupDiskPathAllow".
* src/qemu/qemu_driver.c (qemuTeardownDiskPathDeny)
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fcb90a3..5d90e59 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3401,7 +3401,7 @@ static int qemuTeardownDiskPathDeny(virDomainDiskDefPtr disk ATTRIBUTE_UNUSED,
VIR_DEBUG("Ignoring EACCES for %s", path);
} else {
virReportSystemError(-rc,
- _("Unable to allow access for disk path %s"),
+ _("Unable to deny access for disk path %s"),
path);
return -1;
}
--
1.7.3.2
14 years
[libvirt] [PATCH] virsh: update help for "virsh help help"
by Osier Yang
As virsh help supports both command and command group now,
update "cmdHelp" to print consite help, (this patch is
increment of "7829052757953023b0826e0293ffe18ed4ab89e9").
And also remove redundant empty line in "vshUsage".
* tools/virsh.c
---
tools/virsh.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 010e345..6a9aba2 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -562,13 +562,15 @@ vshReconnect(vshControl *ctl) {
*/
static const vshCmdInfo info_help[] = {
{"help", N_("print help")},
- {"desc", N_("Prints global help or command specific help.")},
+ {"desc", N_("Prints global help, command specific help, or help for a\n"
+ " group of related commands")},
{NULL, NULL}
};
static const vshCmdOptDef opts_help[] = {
- {"command", VSH_OT_DATA, 0, N_("name of command")},
+ {"command", VSH_OT_DATA, 0, N_("Prints global help or command specific help.")},
+ {"group", VSH_OT_DATA, 0, N_("Prints global help or help for a group of related commands.")},
{NULL, 0, 0, NULL}
};
@@ -577,7 +579,12 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
{
const vshCmdDef *c;
const vshCmdGrp *g;
- const char *name = vshCommandOptString(cmd, "command", NULL);
+ const char *name;
+
+ name = vshCommandOptString(cmd, "command", NULL);
+
+ if (!name)
+ name = vshCommandOptString(cmd, "group", NULL);
if (!name) {
const vshCmdGrp *grp;
@@ -596,8 +603,8 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, "\n");
}
- return TRUE;
- }
+ return TRUE;
+ }
if ((c = vshCmddefSearch(name))) {
return vshCmddefHelp(ctl, name);
@@ -11694,7 +11701,7 @@ vshUsage(void)
" -q | --quiet quiet mode\n"
" -t | --timing print timing information\n"
" -l | --log <file> output logging to file\n"
- " -v | --version[=short] program version\n\n"
+ " -v | --version[=short] program version\n"
" -V | --version=long version and full options\n\n"
" commands (non interactive mode):\n\n"), progname, progname);
--
1.7.3.2
14 years
[libvirt] [PATCH] Fix undefined symbol error when macvtap support is disabled
by Matthias Bolte
Use macvtap specific functions depending on WITH_MACVTAP.
Use #if instead of #ifdef to check for WITH_MACVTAP, because
WITH_MACVTAP is always defined with value 0 or 1.
Also export virVMOperationType{To|From}String unconditional,
because they are used unconditional in the domain config code.
---
src/libvirt_macvtap.syms | 5 +++--
src/libvirt_private.syms | 5 +++++
src/qemu/qemu_driver.c | 4 ++++
src/util/macvtap.h | 19 +++++++++----------
4 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/libvirt_macvtap.syms b/src/libvirt_macvtap.syms
index 107b7da..b48565b 100644
--- a/src/libvirt_macvtap.syms
+++ b/src/libvirt_macvtap.syms
@@ -1,9 +1,10 @@
#
+# These symbols are dependent on WITH_MACVTAP.
+#
+
# macvtap.h
delMacvtap;
openMacvtapTap;
-virVMOperationTypeFromString;
-virVMOperationTypeToString;
vpAssociatePortProfileId;
vpDisassociatePortProfileId;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 310d8f4..3c1c823 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -504,6 +504,11 @@ virLogStartup;
virLogUnlock;
+# macvtap.h
+virVMOperationTypeFromString;
+virVMOperationTypeToString;
+
+
# memory.h
virAlloc;
virAllocN;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fcb90a3..aa3478f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11879,6 +11879,7 @@ cleanup:
return ret;
}
+#if WITH_MACVTAP
static void
qemudVPAssociatePortProfiles(virDomainDefPtr def) {
int i;
@@ -11913,6 +11914,7 @@ err_exit:
}
}
}
+#endif /* WITH_MACVTAP */
/* Finish is the third and final step, and it runs on the destination host. */
static virDomainPtr
@@ -11974,7 +11976,9 @@ qemudDomainMigrateFinish2 (virConnectPtr dconn,
goto cleanup;
}
+#if WITH_MACVTAP
qemudVPAssociatePortProfiles(vm->def);
+#endif /* WITH_MACVTAP */
if (flags & VIR_MIGRATE_PERSIST_DEST) {
if (vm->persistent)
diff --git a/src/util/macvtap.h b/src/util/macvtap.h
index 389d1fd..3ae2c24 100644
--- a/src/util/macvtap.h
+++ b/src/util/macvtap.h
@@ -57,11 +57,6 @@ struct _virVirtualPortProfileParams {
} u;
};
-
-# if defined(WITH_MACVTAP)
-
-# include "internal.h"
-
enum virVMOperationType {
VIR_VM_OP_CREATE,
VIR_VM_OP_SAVE,
@@ -75,6 +70,10 @@ enum virVMOperationType {
VIR_VM_OP_LAST
};
+# if WITH_MACVTAP
+
+# include "internal.h"
+
int openMacvtapTap(const char *ifname,
const unsigned char *macaddress,
const char *linkdev,
@@ -90,11 +89,9 @@ void delMacvtap(const char *ifname,
const char *linkdev,
virVirtualPortProfileParamsPtr virtPortProfile);
-# endif /* WITH_MACVTAP */
-
-# define MACVTAP_MODE_PRIVATE_STR "private"
-# define MACVTAP_MODE_VEPA_STR "vepa"
-# define MACVTAP_MODE_BRIDGE_STR "bridge"
+# define MACVTAP_MODE_PRIVATE_STR "private"
+# define MACVTAP_MODE_VEPA_STR "vepa"
+# define MACVTAP_MODE_BRIDGE_STR "bridge"
int vpAssociatePortProfileId(const char *macvtap_ifname,
const unsigned char *macvtap_macaddr,
@@ -109,6 +106,8 @@ int vpDisassociatePortProfileId(const char *macvtap_ifname,
const virVirtualPortProfileParamsPtr virtPort,
enum virVMOperationType vmOp);
+# endif /* WITH_MACVTAP */
+
VIR_ENUM_DECL(virVirtualPort)
VIR_ENUM_DECL(virVMOperation)
--
1.7.0.4
14 years
[libvirt] [PATCH] Fix flaw in thread creation APIs
by Daniel P. Berrange
The arguments passed to the thread function must be allocated on
the heap, rather than the stack, since it is possible for the
spawning thread to continue before the new thread runs at all.
In such a case, it is possible that the area of stack where the
thread args were stored is overwritten.
* src/util/threads-pthread.c, src/util/threads-win32.c: Allocate
thread arguments on the heap
---
src/util/threads-pthread.c | 15 +++++++++++++--
src/util/threads-win32.c | 17 ++++++++++++++---
2 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/src/util/threads-pthread.c b/src/util/threads-pthread.c
index 02070ae..bff4979 100644
--- a/src/util/threads-pthread.c
+++ b/src/util/threads-pthread.c
@@ -26,6 +26,8 @@
# include <sys/syscall.h>
#endif
+#include "memory.h"
+
/* Nothing special required for pthreads */
int virThreadInitialize(void)
@@ -143,6 +145,7 @@ static void *virThreadHelper(void *data)
{
struct virThreadArgs *args = data;
args->func(args->opaque);
+ VIR_FREE(args);
return NULL;
}
@@ -151,17 +154,25 @@ int virThreadCreate(virThreadPtr thread,
virThreadFunc func,
void *opaque)
{
- struct virThreadArgs args = { func, opaque };
+ struct virThreadArgs *args;
pthread_attr_t attr;
pthread_attr_init(&attr);
+ if (VIR_ALLOC(args) < 0)
+ return -1;
+
+ args->func = func;
+ args->opaque = opaque;
+
if (!joinable)
pthread_attr_setdetachstate(&attr, 1);
- int ret = pthread_create(&thread->thread, &attr, virThreadHelper, &args);
+ int ret = pthread_create(&thread->thread, &attr, virThreadHelper, args);
if (ret != 0) {
+ VIR_FREE(args);
errno = ret;
return -1;
}
+ /* New thread owns 'args' in success case, so don't free */
return 0;
}
diff --git a/src/util/threads-win32.c b/src/util/threads-win32.c
index 33be4cf..436b3bd 100644
--- a/src/util/threads-win32.c
+++ b/src/util/threads-win32.c
@@ -230,6 +230,8 @@ static void virThreadHelperDaemon(void *data)
TlsSetValue(selfkey, NULL);
CloseHandle(self.thread);
+
+ VIR_FREE(args);
}
static unsigned int __stdcall virThreadHelperJoinable(void *data)
@@ -249,6 +251,8 @@ static unsigned int __stdcall virThreadHelperJoinable(void *data)
TlsSetValue(selfkey, NULL);
CloseHandle(self.thread);
+
+ VIR_FREE(args);
return 0;
}
@@ -257,17 +261,24 @@ int virThreadCreate(virThreadPtr thread,
virThreadFunc func,
void *opaque)
{
- struct virThreadArgs args = { func, opaque };
+ struct virThreadArgs *args;
+
+ if (VIR_ALLOC(args) < 0)
+ return -1;
+
+ args->func = func;
+ args->opaque = opaque;
+
thread->joinable = joinable;
if (joinable) {
thread->thread = (HANDLE)_beginthreadex(NULL, 0,
virThreadHelperJoinable,
- &args, 0, NULL);
+ args, 0, NULL);
if (thread->thread == 0)
return -1;
} else {
thread->thread = (HANDLE)_beginthread(virThreadHelperDaemon,
- 0, &args);
+ 0, args);
if (thread->thread == (HANDLE)-1L)
return -1;
}
--
1.7.2.3
14 years
[libvirt] Link error since commit c2b3827
by Jean-Baptiste Rouault
I get the following link error since commit c2b3827 :
make[3]: Entering directory `/home/jb/Devel/libvirt/daemon'
CCLD libvirtd
../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_driver.o): In function `qemudVPAssociatePortProfiles':
/home/jb/Devel/libvirt/src/qemu/qemu_driver.c:11891: undefined reference to `vpAssociatePortProfileId'
/home/jb/Devel/libvirt/src/qemu/qemu_driver.c:11908: undefined reference to `vpDisassociatePortProfileId'
Macvtap support is disabled and these 2 functions come from macvtap.h.
Regards,
--
Jean-Baptiste ROUAULT
Ingénieur R&D - Diateam : Architectes de l'information
Phone : +33 (0)9 53 16 02 70 Fax : +33 (0)2 98 050 051
14 years
[libvirt] Best virsh group for storage "find-*" commands?
by Justin Clift
Hi us,
Just realised the new groupings of commands in virsh help has
the two storage "find" commands in domain management.
These ones:
+ find-storage-pool-sources-as find potential storage pool sources
+ find-storage-pool-sources discover potential storage pool sources
They'd be better placed in the Storage Pool group wouldn't they?
Regards and best wishes,
Justin Clift
14 years
[libvirt] CGROUPS network classID setting in domain
by D. Herrendoerfer
Hello,
I'm looking into the possibility of putting a network(tc) classID into
to the domain description and adding it into a (possibly) mounted
cgroup directory upon launch of a VM.
Has anyone before looked into this ?
I've seen this mentioned in an abstract by Daniel B.
I imagine a classid entry to look somewhat like:
<domain type='qemu'>
<name > foo</name>
<uuid>3e3fce45-4f53-4fa7-bb32-11f34168b82b </uuid>
...
<classid>0x1234</classid>
...
Thoughts ?
Best regards,
D. Herrendoerfer
14 years
[libvirt] [PATCH] virsh: remove a badly placed line break in virsh -h output
by Justin Clift
The output was previously:
-c | --connect <uri> hypervisor connection URI
-r | --readonly connect readonly
-d | --debug <num> debug level [0-5]
-h | --help this help
-q | --quiet quiet mode
-t | --timing print timing information
-l | --log <file> output logging to file
-v | --version[=short] program version
-V | --version=long version and full options
(note the blank line between the --version types)
This patch removes the extra blank line.
---
tools/virsh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 010e345..73d0941 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -11694,7 +11694,7 @@ vshUsage(void)
" -q | --quiet quiet mode\n"
" -t | --timing print timing information\n"
" -l | --log <file> output logging to file\n"
- " -v | --version[=short] program version\n\n"
+ " -v | --version[=short] program version\n"
" -V | --version=long version and full options\n\n"
" commands (non interactive mode):\n\n"), progname, progname);
--
1.7.3.2
14 years
[libvirt] [PATCH 0/2] Add unit tests for internal CPU APIs
by Jiri Denemark
*** BLURB HERE ***
Jiri Denemark (2):
cpu: Add support for overriding path to CPU map XML file
tests: Add unit tests for internal CPU APIs
src/cpu/cpu_map.c | 21 +-
src/cpu/cpu_map.h | 3 +
src/libvirt_private.syms | 1 +
tests/Makefile.am | 12 +-
tests/cputest.c | 610 ++++++++++++++++++++
tests/cputestdata/x86-baseline-1-result.xml | 5 +
tests/cputestdata/x86-baseline-1.xml | 20 +
tests/cputestdata/x86-baseline-2-result.xml | 4 +
tests/cputestdata/x86-baseline-2.xml | 22 +
.../x86-baseline-incompatible-vendors.xml | 14 +
.../cputestdata/x86-baseline-no-vendor-result.xml | 5 +
tests/cputestdata/x86-baseline-no-vendor.xml | 12 +
.../x86-baseline-some-vendors-result.xml | 3 +
tests/cputestdata/x86-baseline-some-vendors.xml | 13 +
tests/cputestdata/x86-bogus-feature.xml | 4 +
tests/cputestdata/x86-bogus-model.xml | 3 +
tests/cputestdata/x86-bogus-vendor.xml | 4 +
tests/cputestdata/x86-exact-disable-extra.xml | 4 +
tests/cputestdata/x86-exact-disable.xml | 4 +
tests/cputestdata/x86-exact-disable2.xml | 5 +
tests/cputestdata/x86-exact-forbid-extra.xml | 4 +
tests/cputestdata/x86-exact-forbid.xml | 4 +
tests/cputestdata/x86-exact-force.xml | 4 +
tests/cputestdata/x86-exact-require-extra.xml | 4 +
tests/cputestdata/x86-exact-require.xml | 4 +
tests/cputestdata/x86-exact.xml | 3 +
tests/cputestdata/x86-guest.xml | 18 +
.../cputestdata/x86-host+guest,model486-result.xml | 37 ++
.../x86-host+guest,models,Penryn-result.xml | 13 +
.../x86-host+guest,models,qemu64-result.xml | 14 +
tests/cputestdata/x86-host+guest,models-result.xml | 13 +
tests/cputestdata/x86-host+guest-result.xml | 11 +
tests/cputestdata/x86-host+guest.xml | 17 +
tests/cputestdata/x86-host+min.xml | 17 +
.../cputestdata/x86-host+nehalem-force-result.xml | 4 +
tests/cputestdata/x86-host+pentium3.xml | 27 +
.../x86-host+strict-force-extra-result.xml | 19 +
tests/cputestdata/x86-host-amd-fake.xml | 20 +
tests/cputestdata/x86-host-amd.xml | 18 +
.../x86-host-better+pentium3,core2duo-result.xml | 21 +
.../x86-host-better+pentium3,pentium3-result.xml | 30 +
.../x86-host-better+pentium3-result.xml | 18 +
tests/cputestdata/x86-host-better.xml | 20 +
tests/cputestdata/x86-host-incomp-arch.xml | 6 +
tests/cputestdata/x86-host-no-vendor.xml | 19 +
tests/cputestdata/x86-host-worse+guest-result.xml | 9 +
tests/cputestdata/x86-host-worse.xml | 6 +
tests/cputestdata/x86-host.xml | 20 +
tests/cputestdata/x86-min.xml | 3 +
tests/cputestdata/x86-nehalem-force.xml | 6 +
tests/cputestdata/x86-pentium3-amd.xml | 4 +
tests/cputestdata/x86-pentium3.xml | 3 +
tests/cputestdata/x86-strict-disable.xml | 18 +
tests/cputestdata/x86-strict-force-extra.xml | 18 +
tests/cputestdata/x86-strict-full.xml | 17 +
tests/cputestdata/x86-strict.xml | 3 +
56 files changed, 1238 insertions(+), 3 deletions(-)
create mode 100644 tests/cputest.c
create mode 100644 tests/cputestdata/x86-baseline-1-result.xml
create mode 100644 tests/cputestdata/x86-baseline-1.xml
create mode 100644 tests/cputestdata/x86-baseline-2-result.xml
create mode 100644 tests/cputestdata/x86-baseline-2.xml
create mode 100644 tests/cputestdata/x86-baseline-incompatible-vendors.xml
create mode 100644 tests/cputestdata/x86-baseline-no-vendor-result.xml
create mode 100644 tests/cputestdata/x86-baseline-no-vendor.xml
create mode 100644 tests/cputestdata/x86-baseline-some-vendors-result.xml
create mode 100644 tests/cputestdata/x86-baseline-some-vendors.xml
create mode 100644 tests/cputestdata/x86-bogus-feature.xml
create mode 100644 tests/cputestdata/x86-bogus-model.xml
create mode 100644 tests/cputestdata/x86-bogus-vendor.xml
create mode 100644 tests/cputestdata/x86-exact-disable-extra.xml
create mode 100644 tests/cputestdata/x86-exact-disable.xml
create mode 100644 tests/cputestdata/x86-exact-disable2.xml
create mode 100644 tests/cputestdata/x86-exact-forbid-extra.xml
create mode 100644 tests/cputestdata/x86-exact-forbid.xml
create mode 100644 tests/cputestdata/x86-exact-force.xml
create mode 100644 tests/cputestdata/x86-exact-require-extra.xml
create mode 100644 tests/cputestdata/x86-exact-require.xml
create mode 100644 tests/cputestdata/x86-exact.xml
create mode 100644 tests/cputestdata/x86-guest.xml
create mode 100644 tests/cputestdata/x86-host+guest,model486-result.xml
create mode 100644 tests/cputestdata/x86-host+guest,models,Penryn-result.xml
create mode 100644 tests/cputestdata/x86-host+guest,models,qemu64-result.xml
create mode 100644 tests/cputestdata/x86-host+guest,models-result.xml
create mode 100644 tests/cputestdata/x86-host+guest-result.xml
create mode 100644 tests/cputestdata/x86-host+guest.xml
create mode 100644 tests/cputestdata/x86-host+min.xml
create mode 100644 tests/cputestdata/x86-host+nehalem-force-result.xml
create mode 100644 tests/cputestdata/x86-host+pentium3.xml
create mode 100644 tests/cputestdata/x86-host+strict-force-extra-result.xml
create mode 100644 tests/cputestdata/x86-host-amd-fake.xml
create mode 100644 tests/cputestdata/x86-host-amd.xml
create mode 100644 tests/cputestdata/x86-host-better+pentium3,core2duo-result.xml
create mode 100644 tests/cputestdata/x86-host-better+pentium3,pentium3-result.xml
create mode 100644 tests/cputestdata/x86-host-better+pentium3-result.xml
create mode 100644 tests/cputestdata/x86-host-better.xml
create mode 100644 tests/cputestdata/x86-host-incomp-arch.xml
create mode 100644 tests/cputestdata/x86-host-no-vendor.xml
create mode 100644 tests/cputestdata/x86-host-worse+guest-result.xml
create mode 100644 tests/cputestdata/x86-host-worse.xml
create mode 100644 tests/cputestdata/x86-host.xml
create mode 100644 tests/cputestdata/x86-min.xml
create mode 100644 tests/cputestdata/x86-nehalem-force.xml
create mode 100644 tests/cputestdata/x86-pentium3-amd.xml
create mode 100644 tests/cputestdata/x86-pentium3.xml
create mode 100644 tests/cputestdata/x86-strict-disable.xml
create mode 100644 tests/cputestdata/x86-strict-force-extra.xml
create mode 100644 tests/cputestdata/x86-strict-full.xml
create mode 100644 tests/cputestdata/x86-strict.xml
--
1.7.3.2
14 years