[libvirt] make syntax-check -> make: *** [sc_check_author_list] Error 1 on libvirt-0.8.5
by Kenneth Nagin
I am receiving syntax error when compiling libvirt-0.8.5.
However, make without syntax-check completes successfully.
These are details of the failure.
:~/LIBVIRT/libvirt-0.8.5$ make syntax-check
GFDL_version
1.74 GFDL_version
TAB_in_indentation
0.04 TAB_in_indentation
Wundef_boolean
0.03 Wundef_boolean
avoid_ctype_macros
0.19 avoid_ctype_macros
avoid_if_before_free
9.42 avoid_if_before_free
avoid_write
0.04 avoid_write
cast_of_argument_to_free
0.17 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.16 cast_of_x_alloc_return_value
changelog
0.02 changelog
check_author_list
%aE
maint.mk: committer(s) not listed in AUTHORS
make: *** [sc_check_author_list] Error 1
Best Regards,
Kenneth Nagin
14 years
[libvirt] [PATCH] qemu: Don't try to set input FD to -1
by Matthias Bolte
---
src/qemu/qemu_driver.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 54e9dcb..1b86b5e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4091,7 +4091,10 @@ static int qemudStartVMDaemon(virConnectPtr conn,
VIR_WARN("Executing %s", vm->def->emulator);
virCommandSetPreExecHook(cmd, qemudSecurityHook, &hookData);
- virCommandSetInputFD(cmd, stdin_fd);
+
+ if (stdin_fd != -1)
+ virCommandSetInputFD(cmd, stdin_fd);
+
virCommandSetOutputFD(cmd, &logfile);
virCommandSetErrorFD(cmd, &logfile);
virCommandNonblockingFDs(cmd);
--
1.7.0.4
14 years
[libvirt] Segfault in virCommandRun when trying to start a QEMU guest
by Matthias Bolte
In qemudStartVMDaemon in/out/err for the virCommand are set based on
FDs this results in a segfault in virCommandRun here
VIR_DEBUG("Result stdout: '%s' stderr: '%s'",
NULLSTR(*cmd->outbuf),
NULLSTR(*cmd->errbuf));
as cmd->outbuf and cmd->errbuf are NULL.
The two if blocks before that setup cmd->outbuf and cmd->errbuf in
case the caller didn't request output capturing aren't executed
because the caller requested to capture the output to FDs.
/* If caller hasn't requested capture of stdout/err, then capture
* it ourselves so we can log it.
*/
if (!cmd->outfdptr) {
cmd->outfdptr = &cmd->outfd;
cmd->outbuf = &outbuf;
}
if (!cmd->errfdptr) {
cmd->errfdptr = &cmd->errfd;
cmd->errbuf = &errbuf;
}
In the case the caller requested to capture the output to FDs there is
no capturing to cmd->outbuf and cmd->errbuf and they stay NULL.
When I remove that offending VIR_DEBUG line everything works fine.
Also this case of FD only usage is not yet covered in the command API
test cases.
Matthias
14 years
[libvirt] [PATCH] Create file in virFileWriteStr() if it doesn't exist
by Jean-Baptiste Rouault
This patch adds a virFileWriteStrEx() function with a
third parameter to set the created file permissions.
virFileWriteStr() calls this new function with a
default value for the mode parameter.
---
src/util/util.c | 11 ++++++++---
src/util/util.h | 1 +
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index a2582aa..82ca9b3 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -1123,14 +1123,19 @@ int virFileReadAll(const char *path, int maxlen, char **buf)
return len;
}
-/* Truncate @path and write @str to it.
+int virFileWriteStr(const char *path, const char *str)
+{
+ return virFileWriteStrEx(path, str, S_IRUSR|S_IWUSR);
+}
+
+/* Truncate or create @path and write @str to it.
Return 0 for success, nonzero for failure.
Be careful to preserve any errno value upon failure. */
-int virFileWriteStr(const char *path, const char *str)
+int virFileWriteStrEx(const char *path, const char *str, mode_t mode)
{
int fd;
- if ((fd = open(path, O_WRONLY|O_TRUNC)) == -1)
+ if ((fd = open(path, O_WRONLY|O_TRUNC|O_CREAT, mode)) == -1)
return -1;
if (safewrite(fd, str, strlen(str)) < 0) {
diff --git a/src/util/util.h b/src/util/util.h
index a240d87..18ef693 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -96,6 +96,7 @@ int virFileReadLimFD(int fd, int maxlen, char **buf) ATTRIBUTE_RETURN_CHECK;
int virFileReadAll(const char *path, int maxlen, char **buf) ATTRIBUTE_RETURN_CHECK;
+int virFileWriteStrEx(const char *path, const char *str, mode_t mode) ATTRIBUTE_RETURN_CHECK;
int virFileWriteStr(const char *path, const char *str) ATTRIBUTE_RETURN_CHECK;
int virFileMatchesNameSuffix(const char *file,
--
1.7.0.4
14 years
[libvirt] [PATCH 0/2] smbios fixes
by Eric Blake
In testing <smbios mode='host'/>, I noticed a couple of problems.
First, qemu rejected the command line we gave it (invalid UUID);
ifixingthat showed that all other arguments were being given literal
"" which then made the guest smbios differ from the host. Second,
the qemu option -smbios type=1,family=string wasn't supported, which
lead to a spurious difference between host and guest.
Meanwhile, qemu has a bug where '-smbios type=1,uuid=uuid' must parse
as a valid uuid, but is otherwise ignored. The current qemu.git code
base _only_ sets smbios uuid from the '-uuid uuid' argument. I've
filed a bug against the qemu folks asking whether this is intended (in
which case we have to modify libvirt to change the -uuid argument it
outputs when smbios is specified), or an oversight (hopefully the
latter, since it's still nice to correlate
/var/log/libvirt/qemu/....log with the XML uuid even when that differs
from the smbios uuid presented to the guest.)
Eric Blake (2):
qemu: avoid adding "" in smbios arguments
smbios: support system family
docs/schemas/domain.rng | 1 +
src/conf/domain_conf.c | 9 +++++++-
src/qemu/qemu_conf.c | 26 +++++++++++++---------
src/util/sysinfo.c | 7 ++++++
src/util/sysinfo.h | 1 +
tests/qemuxml2argvdata/qemuxml2argv-smbios.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-smbios.xml | 2 +
7 files changed, 35 insertions(+), 13 deletions(-)
14 years
[libvirt] [PATCH] virsh: Remove redundant optional option for cmdHelp
by Osier Yang
Remove the optional option "group", as cmdHelp should accepts
only one option, and rename option "command" as "command-or-group",
("virsh help" supports both command and command group now, and user
nealy uses the options, so it doesn't matter much for it being longer,
:-)
* tools/virsh.c
---
tools/virsh.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 31de80f..c2d717f 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -569,8 +569,7 @@ static const vshCmdInfo info_help[] = {
};
static const vshCmdOptDef opts_help[] = {
- {"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.")},
+ {"command-or-group", VSH_OT_DATA, 0, N_("Prints global help, command specific help, or help for a group of related commands")},
{NULL, 0, 0, NULL}
};
@@ -581,10 +580,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
const vshCmdGrp *g;
const char *name;
- name = vshCommandOptString(cmd, "command", NULL);
-
- if (!name)
- name = vshCommandOptString(cmd, "group", NULL);
+ name = vshCommandOptString(cmd, "command-or-group", NULL);
if (!name) {
const vshCmdGrp *grp;
--
1.7.3.2
14 years
[libvirt] [PATCH] tests: Fix commandtest in VPATH build
by Jiri Denemark
---
tests/commandtest.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tests/commandtest.c b/tests/commandtest.c
index ace2f33..31adeea 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -509,9 +509,12 @@ cleanup:
* Only stdin/out/err open
*/
static int test15(const void *unused ATTRIBUTE_UNUSED) {
+ char *cwd = NULL;
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
- virCommandSetWorkingDirectory(cmd, abs_builddir "/commanddata");
+ if (virAsprintf(&cwd, "%s/commanddata", abs_srcdir) < 0)
+ return -1;
+ virCommandSetWorkingDirectory(cmd, cwd);
if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError();
@@ -519,6 +522,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED) {
return -1;
}
+ VIR_FREE(cwd);
virCommandFree(cmd);
return checkoutput("test15");
--
1.7.3.2
14 years
[libvirt] [PATCH] man pages: update the description for the virsh help command
by Justin Clift
Now includes information on keyword usage, and provides examples.
---
tools/virsh.pod | 37 ++++++++++++++++++++++++++++++++++---
1 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index c97786a..66654a7 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -115,10 +115,41 @@ The following commands are generic i.e. not specific to a domain.
=over 4
-=item B<help> optional I<command>
+=item B<help> optional I<--command> I<command> | I<group-keyword>
-This prints a small synopsis about all commands available for B<virsh>
-B<help> I<command> will print out a detailed help message on that command.
+This lists each of the virsh commands. When used without options, all
+commands are listed, one per line, grouped into related categories,
+displaying the keyword for each group.
+
+To display only commands for a specific group, give the keyword for that
+group as an option. For example:
+
+ virsh # help host
+
+ Host and Hypervisor (help keyword 'host'):
+ capabilities capabilities
+ connect (re)connect to hypervisor
+ freecell NUMA free memory
+ hostname print the hypervisor hostname
+ qemu-monitor-command Qemu Monitor Command
+ uri print the hypervisor canonical URI
+
+To display detailed information for a specific command, give its name as the
+option instead. For example:
+
+ virsh # help list
+ NAME
+ list - list domains
+
+ SYNOPSIS
+ list [--inactive] [--all]
+
+ DESCRIPTION
+ Returns list of domains.
+
+ OPTIONS
+ --inactive list inactive domains
+ --all list inactive & active domains
=item B<quit>, B<exit>
--
1.7.3.2
14 years
[libvirt] [PATCH v5 0/4] Support of auto-dump on watchdog event in libvirtd
by Hu Tao
This patch series adds a new watchdog action `dump' which lets libvirtd
can do auto-dump when receiving a watchdog event from qemu guest.
In order to make the function work, there must be a watchdog device
added to guest, and guest must have a watchdog daemon running, for
example, /etc/init.d/watchdog start or auto-started on boot.
Changes:
v5:
- qemu_driver is passed into threadpool as opaque parameter rather than
visit the global qemu_driver in worker function
- same situation as above of server in libvirtd.c
- also list auto_dump_path in src/qemu/libvirtd_qemu.aug and
src/qemu/test_libvirtd_qemu.aug
- check return value of qemuDomainObjEndJob for safety
v4:
- updated threadpool to follow libvirt naming style, use appropriate
internals APIs, and hide the struct definitions from the header
(by Daniel)
- fix an error that qemuDomainObjBeginJobWithDriver() get lost in
qemuDomainCoreDump()
- use thread pool in libvirtd (qemud worker)
v3:
- let default auto-dump dir be /var/lib/libvirt/qemu/dump
Hu Tao (4):
threadpool impl
Add a new function doCoreDump
Add a watchdog action `dump'
Using threadpool API to manage qemud worker
cfg.mk | 1 +
daemon/libvirtd.c | 172 +++++------------------------
daemon/libvirtd.h | 2 +
src/Makefile.am | 1 +
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 6 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 5 +
src/qemu/qemu_conf.c | 16 +++-
src/qemu/qemu_conf.h | 5 +
src/qemu/qemu_driver.c | 228 ++++++++++++++++++++++++++++----------
src/qemu/test_libvirtd_qemu.aug | 2 +
src/util/threadpool.c | 231 +++++++++++++++++++++++++++++++++++++++
src/util/threadpool.h | 48 ++++++++
15 files changed, 518 insertions(+), 202 deletions(-)
create mode 100644 src/util/threadpool.c
create mode 100644 src/util/threadpool.h
--
1.7.3
--
Thanks,
Hu Tao
14 years
[libvirt] [PATCH] virsh: move two commands from domain group to storage pool group
by Osier Yang
* tools/virsh.c (find-storage-pool-sources-as and find-storage-pool-sources
should't be in command group "Domain Management", move them to group
"Storage Pool".
---
tools/virsh.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 6a9aba2..8d84394 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -9957,10 +9957,6 @@ static const vshCmdDef domManagementCmds[] = {
{"dumpxml", cmdDumpXML, opts_dumpxml, info_dumpxml},
{"echo", cmdEcho, opts_echo, info_echo},
{"edit", cmdEdit, opts_edit, info_edit},
- {"find-storage-pool-sources-as", cmdPoolDiscoverSourcesAs,
- opts_find_storage_pool_sources_as, info_find_storage_pool_sources_as},
- {"find-storage-pool-sources", cmdPoolDiscoverSources,
- opts_find_storage_pool_sources, info_find_storage_pool_sources},
{"freecell", cmdFreecell, opts_freecell, info_freecell},
{"hostname", cmdHostname, NULL, info_hostname},
{"managedsave", cmdManagedSave, opts_managedsave, info_managedsave},
@@ -10003,6 +9999,10 @@ static const vshCmdDef domMonitoringCmds[] = {
};
static const vshCmdDef storagePoolCmds[] = {
+ {"find-storage-pool-sources-as", cmdPoolDiscoverSourcesAs,
+ opts_find_storage_pool_sources_as, info_find_storage_pool_sources_as},
+ {"find-storage-pool-sources", cmdPoolDiscoverSources,
+ opts_find_storage_pool_sources, info_find_storage_pool_sources},
{"pool-autostart", cmdPoolAutostart, opts_pool_autostart, info_pool_autostart},
{"pool-build", cmdPoolBuild, opts_pool_build, info_pool_build},
{"pool-create-as", cmdPoolCreateAs, opts_pool_X_as, info_pool_create_as},
--
1.7.3.2
14 years