[libvirt] [PATCH] Add a new syntax-check rule for gethostname.
by Chris Lalancette
We should always be using virGetHostname in place of
gethostname; thus add in a new syntax-check rule to make
sure no new uses creep in.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
.x-sc_prohibit_gethostname | 2 ++
Makefile.am | 1 +
cfg.mk | 5 +++++
src/libvirt.c | 2 +-
4 files changed, 9 insertions(+), 1 deletions(-)
create mode 100644 .x-sc_prohibit_gethostname
diff --git a/.x-sc_prohibit_gethostname b/.x-sc_prohibit_gethostname
new file mode 100644
index 0000000..e7acb03
--- /dev/null
+++ b/.x-sc_prohibit_gethostname
@@ -0,0 +1,2 @@
+^src/util/util\.c$
+^ChangeLog-old$
diff --git a/Makefile.am b/Makefile.am
index 14fc593..32cd96a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = \
.x-sc_m4_quote_check \
.x-sc_prohibit_asprintf \
.x-sc_prohibit_gethostby \
+ .x-sc_prohibit_gethostname \
.x-sc_prohibit_have_config_h \
.x-sc_prohibit_HAVE_MBRTOWC \
.x-sc_prohibit_nonreentrant \
diff --git a/cfg.mk b/cfg.mk
index c1d3864..45d6531 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -94,6 +94,11 @@ sc_prohibit_strncpy:
msg='use virStrncpy, not strncpy' \
$(_prohibit_regexp)
+sc_prohibit_gethostname:
+ @re='gethostname *\(' \
+ msg='use virGetHostname, not gethostname' \
+ $(_prohibit_regexp)
+
sc_prohibit_VIR_ERR_NO_MEMORY:
@re='\<V''IR_ERR_NO_MEMORY\>' \
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
diff --git a/src/libvirt.c b/src/libvirt.c
index 5787f22..4e244bb 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1441,7 +1441,7 @@ error:
* @conn: pointer to a hypervisor connection
*
* This returns the system hostname on which the hypervisor is
- * running (the result of the gethostname(2) system call). If
+ * running (the result of the gethostname system call). If
* we are connected to a remote system, then this returns the
* hostname of the remote system.
*
--
1.6.0.6
15 years, 1 month
[libvirt] [PATCH] Add a default log_level to qemudSetLogging to remove a build warning.
by Chris Lalancette
(original patch from Charles Duffy)
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
daemon/libvirtd.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 03bc1b4..4eb33bc 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -2509,8 +2509,9 @@ remoteReadSaslAllowedUsernameList (virConfPtr conf ATTRIBUTE_UNUSED,
* debugging is asked for then output informations or debug.
*/
static int
-qemudSetLogging(virConfPtr conf, const char *filename) {
- int log_level;
+qemudSetLogging(virConfPtr conf, const char *filename)
+{
+ int log_level = 0;
char *log_filters = NULL;
char *log_outputs = NULL;
int ret = -1;
@@ -2531,12 +2532,6 @@ qemudSetLogging(virConfPtr conf, const char *filename) {
* level has been set, we must process variables in the opposite
* order, each one overriding the previous.
*/
- /*
- * GET_CONF_INT returns 0 when there is no log_level setting in
- * the config file. The conditional below eliminates a false
- * warning in that case, but also has the side effect of missing
- * a warning if the user actually does say log_level=0.
- */
GET_CONF_INT (conf, filename, log_level);
if (log_level != 0)
virLogSetDefaultPriority(log_level);
--
1.6.0.6
15 years, 1 month
[libvirt] virsh edit not saving interface target specification
by Neil Aggarwal
Hello:
I am trying to set a target dev specification for one
of my guests so I stopped the guest and the did virst
edit, added the target specification, and saved the
file. If I go back into virsh edit, the target specification
is not being saved.
I am using libvirt 0.6.3-20.el5 installed by yum on CentOS 5.4.
Here is the XML file after I edited it:
<domain type='kvm'>
<name>jamm12a</name>
<uuid>6452dcff-c20f-908b-d1ee-7dcf1406a3e0</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/jamm12a.img'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
<mac address='54:52:00:4f:83:67'/>
<source bridge='br0'/>
<target dev='vnet1'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
</devices>
</domain>
When I save the file and do virsh edit again, the
<target dev='vnet1'/>
line is not saved.
Is this a bug in libvirt?
Thanks,
Neil
--
Neil Aggarwal, (281)846-8957, www.JAMMConsulting.com
Will your e-commerce site go offline if you have
a DB server failure, fiber cut, flood, fire, or other disaster?
If so, ask about our geographically redundant database system.
15 years, 1 month
[libvirt] Get Virtual Machine Information
by Gandhiraj Natarajan
Hi
1. We need to know how to get the IP addresses of virtual machines running in Novel Xen Server?
2. We need to know how to get the proper operating system like Windows XP or 2000 or 2003?
Thanks in advance
Regards,
Gandhiraj Natarajan
Connect more, do more and share more with Yahoo! India Mail. Learn more. http://in.overview.mail.yahoo.com/
15 years, 1 month
[libvirt] invalid domain pointer
by Stefan
Hello,
my log files are filled with (5 times per second):
error : invalid domain pointer in no domain with matching id -1
My system:
libvirt 0.6.1, Ubuntu 9.04, 2.6.28-15-server #52-Ubuntu x86_64
Any ideas ?
Thanks
Stefan
15 years, 1 month
[libvirt] [PATCH] Remove redundant virFileDeletePID() call
by Chris Lalancette
virFileDeletePID() is unnecessarily called in qemudRemoveDomainStatus().
The only caller of qemudRemoveDomainStatus() is qemudShutdownVMDaemon(),
and that already calls virFileDeletePID (with a better error message).
Remove the redundant call here.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 02bb5cb..4cd235d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -273,9 +273,6 @@ qemudRemoveDomainStatus(virConnectPtr conn,
goto cleanup;
}
- if(virFileDeletePid(driver->stateDir, vm->def->name))
- goto cleanup;
-
rc = 0;
cleanup:
VIR_FREE(file);
--
1.6.0.6
15 years, 1 month
[libvirt] Re: [virt-tools-list] [BUG] mounting of NFSv4 pools fails in virt-manager
by Cole Robinson
On 10/23/2009 07:22 AM, Jon Nordby wrote:
> The problem is due to libvirt using mount.nfs instead of mount.nfs4 for
> NFSv4 shares.
>
> virt-manager tries the following command (see attached file):
> [jon@jon-laptop ~]$ sudo /bin/mount 10.0.0.2:/libvirt_install
> /var/lib/libvirt/images/server-install
> mount.nfs: access denied by server while mounting 10.0.0.2:/libvirt_install
>
> When it should be something like this instead:
> [jon@jon-laptop ~]$ sudo /bin/mount -t nfs4 10.0.0.2:/libvirt_install
> /var/lib/libvirt/images/server-install
>
> Because mount apparently considers NFSv4 to be a different type than
> previous NFS versions:
> [jon@jon-laptop ~]$ mount.nfs
> mount.nfs mount.nfs4
>
> OS: Arch Linux Current on both server and client. nfs-utils 1.2.0-4 and
> kernel 2.6.31
>
> I don't believe there is a good way to programatically check which version a
> share is, but one can catch the error and try again with "-t nfs4".
> Or perhaps trying nfs4 first is better...
> > libvirtError: internal error '/bin/mount 10.0.0.2:/libvirt_install
/var/lib/libvirt/images/server-install' exited with non-zero status 32
and signal 0: mount.nfs: access denied by server while mounting
10.0.0.2:/libvirt_insta
FYI, libvirt issues should go to libvirt-list(a)redhat.com (cc'ing)
- Cole
15 years, 1 month
[libvirt] libvirt: use existing network bridge
by Sascha Frey
Hi,
I met a problem setting up virt-manager and libvirt:
I want to use an existing customized network bridge with libvirt
(I need special iptables rules and a custom DHCP setup).
So I created a network definition file like this:
<network>
<name>NAT</name>
<bridge name='br-nat' />
</network>
Unfortunately, I'm unable to activate this network, because libvirt
tries to create the bridge `br-nat' and fails, because it already
exists:
# virsh net-start NAT
error: Failed to start network NAT
error: cannot create bridge 'br-nat': File exists
I just want libvirt to attach the guest's tap devices to this existing
bridge. I don't want libvirt to manage the network.
Is there any chance to realize this set-up?
It should work with virt-manager using the graphical wizard.
Thanks!
Regards
Sascha
15 years, 1 month
[libvirt] libvirt update problem
by Gerry Reno
# yum list 'libvirt'
Loaded plugins: dellsysidplugin2, fastestmirror, installonlyn,
refresh-packagekit, versionlock
Loading mirror speeds from cached hostfile
Excluding mirror: mirror.newnanutilities.org
* fedora: mirror.hiwaay.net
* updates: mirror.hiwaay.net
Reading version lock configuration
Installed Packages
libvirt.i586
0.6.2-8.fc11 installed
libvirt.x86_64
0.6.2-8.fc11 installed
Available Packages
libvirt.i586
0.6.2-18.fc11 updates
libvirt.x86_64
0.6.2-18.fc11 updates
and when I update libvirt:
Transaction Check Error:
file /usr/share/libvirt/schemas/domain.rng from install of
libvirt-0.6.2-18.fc11.x86_64 conflicts with file from package
libvirt-0.6.2-8.fc11.i586
What is wrong here?
15 years, 1 month