Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread simon jin

于 2011-6-27 23:17, Laine Stump 写道:

On 06/27/2011 07:32 AM, Matthias Bolte wrote:

2011/6/27 simon:

于 2011-6-27 13:01, Daniel Veillard 写道:

   So we are entering the week freeze for the new version 0.9.3
I have made an rc1 tarball available at:
ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
along with rpms for those interested
We pushed a lot of patches in the last few days, we know there is at
least some cleanup issues, but I tried it locally and basic operations
seems to work fine,

   please give it a try too and report issues,

thanks !

Daniel

On fc14.x86_64
TEST: networkxml2argvtest  FAIL

Download  libvirt-0.9.3-rc1.tar.gz

./configure&&  make&&  make check

It report 1 of 52 tests failed

TEST: networkxml2argvtest
   !.!  7   FAIL
FAIL: networkxml2argvtest

This a known problem when you configure libvirt with localstatedir
other than /var, what happens when you just run configure without
arguments.


It looks like that's what he did, so maybe this is a different problem 
(or possibly his configure defaults to /usr/local/var?).


If the default localstatedir isn't /var, try doing "./autogen.sh 
--system" instead of ./configure. If that doesn't cure the problem, 
try running the test with debug logging turned on to see exactly what 
error is reported:


  LIBVIRT_LOG_OUTPUTS=3:stderr VIR_TEST_DEBUG=2 ./networkxml2argvtest

I didn't use any arguments in configure, but the defaults localstatdir 
is /usr/local/var.

I found below lines in config.status:
S["prefix"]="/usr/local"
S["localstatedir"]="${prefix}/var"

./autogen.sh --system will fix this issue.

[libvirt-0.9.3]$  LIBVIRT_LOG_OUTPUTS=3:stderr VIR_TEST_DEBUG=2 
tests/networkxml2argvtest

TEST: tests/networkxml2argvtest
 1) Network XML-2-Argv isolated-network   
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/isolated-network.xml: 
failed to open: No such file or directory

FAILED
 2) Network XML-2-Argv routed-network 
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/routed-network.xml: 
failed to open: No such file or directory

FAILED
 3) Network XML-2-Argv nat-network
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/nat-network.xml: 
failed to open: No such file or directory

FAILED
 4) Network XML-2-Argv netboot-network
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/netboot-network.xml: 
failed to open: No such file or directory

FAILED
 5) Network XML-2-Argv netboot-proxy-network  
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/netboot-proxy-network.xml: 
failed to open: No such file or directory

FAILED
 6) Network XML-2-Argv nat-network-dns-txt-record 
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/nat-network-dns-txt-record.xml: 
failed to open: No such file or directory

FAILED
 7) Network XML-2-Argv nat-network-dns-hosts  
... 
/home/simon/Downloads/libvirt-0.9.3/networkxml2argvdata/nat-network-dns-hosts.xml: 
failed to open: No such file or directory

FAILED

Those .xml files actully under test/.

-Simon Jin


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [Libvirt-test-API][PATCH 6/6] add target_machine variable and login name with root default and password variable into env.cfg

2011-06-27 Thread Guannan.ren
---
 env.cfg |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/env.cfg b/env.cfg
index e1237de..b5e404a 100644
--- a/env.cfg
+++ b/env.cfg
@@ -135,3 +135,9 @@ testnic = eth1
 # a PCI device to use for attach/detach/reset tests
 # for example testpci = 00:19.0
 testpci =
+
+# The IP address of migration target machine
+target_machine=
+target_user = root
+target_password =
+
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [Libvirt-test-API][PATCH 4/6] add migrate.py testcases based on Daniel Berrage's migration testing scenarios

2011-06-27 Thread Guannan.ren
---
 repos/domain/migrate.py |  335 +++
 1 files changed, 335 insertions(+), 0 deletions(-)
 create mode 100644 repos/domain/migrate.py

diff --git a/repos/domain/migrate.py b/repos/domain/migrate.py
new file mode 100644
index 000..3f80bd0
--- /dev/null
+++ b/repos/domain/migrate.py
@@ -0,0 +1,335 @@
+#!/usr/bin/env python
+"""this script is for migration testing
+   domain:migrate
+   target_machine
+   10.66.5.5
+   username
+   root
+   password
+   redhat
+   guestname
+   rhel6
+   prestate
+   running
+   poststate
+   running
+   presrcconfig
+   false
+   postsrcconfig
+   false
+   predstconfig
+   false
+   postdstconfig
+   false
+   flags
+   0|live
+
+prestate and poststate is the domain state: 
+presrconfig, postsrconfig, predstconfig, postdstconfig is 
+flags is the migration flags combination <0|peer2peer|tunnelled|live|paused \
+ |persist_dest|undefine_source|>
+
+"""
+__author__ = 'Guannan Ren: g...@redhat.com'
+__date__ = 'Sun June 26, 2011'
+__version__ = '0.1.0'
+__credits__ = 'Copyright (C) 2011 Red Hat, Inc.'
+__all__ = ['usage', 'migrate']
+
+import os
+import re
+import sys
+import pexpect
+import string
+import commands
+
+def append_path(path):
+"""Append root path of package"""
+if path in sys.path:
+pass
+else:
+sys.path.append(path)
+
+pwd = os.getcwd()
+result = re.search('(.*)libvirt-test-API', pwd)
+append_path(result.group(0))
+
+from lib import connectAPI
+from lib.domainAPI import *
+from utils.Python import utils
+from utils.Python import xmlbuilder
+from exception import LibvirtAPI
+
+SSH_KEYGEN = "ssh-keygen -t rsa"
+SSH_COPY_ID = "ssh-copy-id"
+GUEST_XML = "/etc/libvirt/qemu/%s.xml"
+
+def exec_command(logger, command, flag):
+"""execute shell command
+"""
+status, ret = commands.getstatusoutput(command)
+if not flag and status:
+logger.error("executing "+ "\"" +  command  + "\"" + " failed")
+logger.error(ret)
+return status, ret
+
+
+def env_clean(src, dst, srcdom, dstdom, target_machine, guestname, logger):
+
+logger.info("destroy and undefine %s on both side if it exsits", guestname)
+exec_command(logger, "virsh destroy %s" % guestname, 1)
+exec_command(logger, "virsh undefine %s" % guestname, 1)
+REMOTE_DESTROY = "ssh %s \"virsh destroy %s\"" % (target_machine, 
guestname)
+exec_command(logger, REMOTE_DESTROY, 1)
+REMOTE_UNDEFINE = "ssh %s \"virsh undefine %s\"" % (target_machine, 
guestname)
+exec_command(logger, REMOTE_UNDEFINE, 1)
+
+src.close()
+logger.info("close local hypervisor connection")
+dst.close()
+logger.info("close remote hypervisor connection")
+
+REMOVE_SSH = "ssh %s \"rm -rf /root/.ssh/*\"" % (target_machine)
+logger.info("remove ssh key on remote machine")
+status, ret = exec_command(logger, REMOVE_SSH, 0)
+if status:
+logger.error("failed to remove ssh key")
+
+REMOVE_LOCAL_SSH = "rm -rf /root/.ssh/*"
+logger.info("remove local ssh key")
+status, ret = exec_command(logger, REMOVE_LOCAL_SSH, 0)
+if status:
+logger.error("failed to remove local ssh key")
+
+
+def check_params(params):
+"""check out the arguments requried for migration"""
+logger = params['logger']
+keys = ['target_machine', 'username', 'password', 'guestname', 'flags']
+for key in keys:
+if key not in params:
+logger.error("Argument %s is required" % key)
+return 1
+return 0
+
+def ssh_keygen(logger):
+"""using pexpect to generate RSA"""
+logger.info("generate ssh RSA \"%s\"" % SSH_KEYGEN)
+child = pexpect.spawn(SSH_KEYGEN)
+while True:
+index = child.expect(['Enter file in which to save the key ',
+  'Enter passphrase ',
+  'Enter same passphrase again: ',
+   pexpect.EOF,
+   pexpect.TIMEOUT])
+if index == 0:
+child.sendline("\r")
+elif index == 1:
+child.sendline("\r")
+elif index == 2:
+child.sendline("\r")
+elif index == 3:
+logger.debug(string.strip(child.before))
+child.close()
+return 0
+elif index == 4:
+logger.error("ssh_keygen timeout")
+logger.debug(string.strip(child.before))
+child.close()
+return 1
+
+return 0
+
+def ssh_tunnel(hostname, username, password, logger):
+"""setup a tunnel to a give host"""
+logger.info("setup ssh tunnel with host %s" % hostname)
+user_host = "%s@%s" % (username, hostname)
+child = pexpect.spawn(SSH_COPY_ID, [ user_host])
+while True:
+index = child.expect(['yes\/no', 'password: ',
+  

[libvirt] [Libvirt-test-API][PATCH 2/6] add flags option to create.py to support creating domain with running or paused state

2011-06-27 Thread Guannan.ren
---
 repos/domain/create.py |   53 ---
 1 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/repos/domain/create.py b/repos/domain/create.py
index 343aba2..a06a2d3 100644
--- a/repos/domain/create.py
+++ b/repos/domain/create.py
@@ -12,6 +12,7 @@
nicmodel
ifacetype
source
+   flags
 """
 
 __author__ = 'Guannan Ren: g...@redhat.com'
@@ -42,6 +43,9 @@ from utils.Python import utils
 from utils.Python import xmlbuilder
 from exception import LibvirtAPI
 
+NONE = 0
+START_PAUSED = 1
+
 def usage():
 print '''usage: mandatory arguments:guesttype
guestname
@@ -54,8 +58,14 @@ def usage():
nicmodel
ifacetype
source
+   flags
   '''
 
+def return_close(conn, logger, ret):
+conn.close()
+logger.info("closed hypervisor connection")
+return ret
+
 def check_params(params):
 """Verify inputing parameter dictionary"""
 logger = params['logger']
@@ -78,6 +88,13 @@ def create(params):
 guestname = params['guestname']
 test_result = False
 
+flags = None
+if params.has_key('flags'):
+flags = params['flags']
+if flags != "none" and flags != "start_paused":
+logger.error("flags value either \"none\" or \"start_paused\"");
+return 1
+
 # Connect to local hypervisor connection URI
 util = utils.Utils()
 uri = util.get_uri('127.0.0.1')
@@ -98,16 +115,26 @@ def create(params):
 
 # Create domain from xml
 try:
-try:
-domobj.create(domxml)
-except LibvirtAPI, e:
-logger.error("API error message: %s, error code is %s" %
-  (e.response()['message'], e.response()['code']))
-logger.error("fail to create domain %s" % guestname)
-return 1
-finally:
-conn.close()
-logger.info("closed hypervisor connection")
+if not flags or flags == "none":
+domobj.create(domxml, NONE)
+elif flags == "start_paused":
+domobj.create(domxml, START_PAUSED)
+else:
+logger.error("flags error")
+except LibvirtAPI, e:
+logger.error("API error message: %s, error code is %s" %
+  (e.response()['message'], e.response()['code']))
+logger.error("fail to create domain %s" % guestname)
+return return_close(conn, logger, 1)
+
+if flags == "start_paused":
+state = domobj.get_state(guestname)
+if state == "paused":
+logger.info("guest start with state paused successfully")
+return return_close(conn, logger, 0)
+else:
+logger.error("guest state error")
+return return_close(conn, logger, 1)
 
 logger.info("get the mac address of vm %s" % guestname)
 mac = util.get_dom_mac_addr(guestname)
@@ -132,9 +159,9 @@ def create(params):
 if timeout == 0:
 logger.info("fail to power on vm %s" % guestname)
 test_result = False
-return 1
+return return_close(conn, logger, 1)
 
 if test_result:
-return 0
+return return_close(conn, logger, 0)
 else:
-return 1
+return return_close(conn, logger, 1)
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [Libvirt-test-API][PATCH 1/6] add createWithFlags() API and modify migrate() function to align with libvirt Python migration definition

2011-06-27 Thread Guannan.ren
---
 lib/domainAPI.py |   57 --
 1 files changed, 38 insertions(+), 19 deletions(-)

diff --git a/lib/domainAPI.py b/lib/domainAPI.py
index 0c725f8..5667c20 100644
--- a/lib/domainAPI.py
+++ b/lib/domainAPI.py
@@ -40,18 +40,6 @@ append_path(result.group(0))
 
 import exception
 
-# DomainMigrateFlags
-VIR_MIGRATE_LIVE = 1
-
-# DomainState
-VIR_DOMAIN_NOSTATE = 0
-VIR_DOMAIN_RUNNING = 1
-VIR_DOMAIN_BLOCKED = 2
-VIR_DOMAIN_PAUSED = 3
-VIR_DOMAIN_SHUTDOWN = 4
-VIR_DOMAIN_SHUTOFF = 5
-VIR_DOMAIN_CRASHED = 6
-
 class DomainAPI(object):
 def __init__(self, connection):
 self.conn = connection
@@ -182,6 +170,16 @@ class DomainAPI(object):
 code = e.get_error_code()
 raise exception.LibvirtAPI(message, code)
 
+def start_with_flags(self, domname, flags = 0):
+try:
+dom_obj = self.get_defined_obj(domname)
+retval = dom_obj.createWithFlags(flags)
+return retval
+except libvirt.libvirtError, e:
+message = e.get_error_message()
+code = e.get_error_code()
+raise exception.LibvirtAPI(message, code)
+
 def suspend(self, domname):
 try:
 dom_obj = self.get_domain_by_name(domname)
@@ -223,10 +221,10 @@ class DomainAPI(object):
 code = e.get_error_code()
 raise exception.LibvirtAPI(message, code)
 
-def migrate(self, domname, dconn, flags = VIR_MIGRATE_LIVE):
+def migrate(self, domname, dconn, flags, dname = None, uri = None, 
bandwidth = 0):
 try:
 dom_obj = self.get_domain_by_name(domname)
-retval = dom_obj.migrate(dconn, flags, None, None, 0)
+retval = dom_obj.migrate(dconn, flags, dname, uri, 0)
 return retval
 except libvirt.libvirtError, e:
 message = e.get_error_message()
@@ -484,7 +482,7 @@ class DomainAPI(object):
 dom_obj = self.get_domain_by_name(domname)
 state = dom_obj.info()
 if state[0] == VIR_DOMAIN_NOSTATE:
-dom_state = 'no state'
+dom_state = 'nostate'
 elif state[0] == VIR_DOMAIN_RUNNING:
 dom_state = 'running'
 elif state[0] == VIR_DOMAIN_BLOCKED:
@@ -581,7 +579,7 @@ class DomainAPI(object):
 code = e.get_error_code()
 raise exception.LibvirtAPI(message, code)
 
-def isActive(self, domname):
+def is_active(self, domname):
 try:
 dom_obj = self.get_domain_by_name(domname)
 return dom_obj.isActive()
@@ -590,7 +588,7 @@ class DomainAPI(object):
 code = e.get_error_code()
 raise exception.LibvirtAPI(message, code)
 
-def isPersistent(self, domname):
+def is_persistent(self, domname):
 try:
 dom_obj = self.get_domain_by_name(domname)
 return dom_obj.isPersistent()
@@ -662,10 +660,10 @@ class DomainAPI(object):
 code = e.get_error_code()
 raise exception.LibvirtAPI(message, code)
 
-def migrate_to_uri(self, domname, duri, dname, bandwidth, flag = 0):
+def migrate_to_uri(self, domname, duri, flags, dname = None, bandwidth = 
0):
 try:
 dom_obj = self.get_domain_by_name(domname)
-return dom_obj.migrateToURI(duri, dname, bandwidth, flag)
+return dom_obj.migrateToURI(duri, flags, dname, bandwidth)
 except libvirt.libvirtError, e:
 message = e.get_error_message()
 code = e.get_error_code()
@@ -761,3 +759,24 @@ class DomainAPI(object):
 code = e.get_error_code()
 raise exception.LibvirtAPI(message, code)
 
+
+# DomainState
+VIR_DOMAIN_NOSTATE = 0
+VIR_DOMAIN_RUNNING = 1
+VIR_DOMAIN_BLOCKED = 2
+VIR_DOMAIN_PAUSED = 3
+VIR_DOMAIN_SHUTDOWN = 4
+VIR_DOMAIN_SHUTOFF = 5
+VIR_DOMAIN_CRASHED = 6
+
+
+# virDomainMigrateFlags
+VIR_MIGRATE_LIVE = 1
+VIR_MIGRATE_PEER2PEER = 2
+VIR_MIGRATE_TUNNELLED = 4
+VIR_MIGRATE_PERSIST_DEST = 8
+VIR_MIGRATE_UNDEFINE_SOURCE = 16
+VIR_MIGRATE_PAUSED = 32
+VIR_MIGRATE_NON_SHARED_DISK = 64
+VIR_MIGRATE_NON_SHARED_INC = 128
+
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [Libvirt-test-API][PATCH 3/6] add flags option to start to have domain started with flags support

2011-06-27 Thread Guannan.ren
---
 repos/domain/start.py |   32 ++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/repos/domain/start.py b/repos/domain/start.py
index 34906e5..39ac47f 100644
--- a/repos/domain/start.py
+++ b/repos/domain/start.py
@@ -31,6 +31,9 @@ from lib import domainAPI
 from utils.Python import utils
 from exception import LibvirtAPI
 
+NONE = 0
+START_PAUSED = 1
+
 def return_close(conn, logger, ret):
 conn.close()
 logger.info("closed hypervisor connection")
@@ -62,7 +65,8 @@ def start(params):
 {'logger': logger, 'guestname': guestname}
 
 logger -- an object of utils/Python/log.py
-guestname -- same as the domain name
+mandatory arguments : guestname -- same as the domain name
+   optional arguments : flags -- domain create flags 
 
 Return 0 on SUCCESS or 1 on FAILURE
 """
@@ -72,6 +76,13 @@ def start(params):
 domname = params['guestname']
 logger = params['logger']
 
+flags = None
+if params.has_key('flags'):
+flags = params['flags']
+if flags != 'none' and flags != 'start_paused':
+logger.error("flags value either \"none\" or \"start_paused\"");
+return 1
+
 # Connect to local hypervisor connection URI
 util = utils.Utils()
 uri = util.get_uri('127.0.0.1')
@@ -84,12 +95,29 @@ def start(params):
 logger.info('start domain')
 
 try:
-dom_obj.start(domname)
+if flags == "none":
+dom_obj.start_with_flags(domname, NONE)
+elif flags == "start_paused":
+dom_obj.start_with_flags(domname, START_PAUSED)
+elif not flags:
+dom_obj.start(domname)
+else:
+logger.error("flags error")
+return (conn, logger, 1)
 except LibvirtAPI, e:
 logger.error(str(e))
 logger.error("start failed")
 return return_close(conn, logger, 1)
 
+if flags == "start_paused":
+state = dom_obj.get_state(domname)
+if state == "paused":
+logger.info("guest start with state paused successfully")
+return return_close(conn, logger, 0)
+else:
+logger.error("guest state error")
+return return_close(conn, logger, 1)
+
 while timeout:
 time.sleep(10)
 timeout -= 10
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [Libvirt-test-API][PATCH 5/6] add migration testing configuration file to cases

2011-06-27 Thread Guannan.ren
---
 cases/migrate.conf |   97 
 1 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 cases/migrate.conf

diff --git a/cases/migrate.conf b/cases/migrate.conf
new file mode 100644
index 000..2d8157a
--- /dev/null
+++ b/cases/migrate.conf
@@ -0,0 +1,97 @@
+# This is a sample for migration testing, it assumes that there is a 
preinstalled rhel6 guest image file
+# named rhel6 located in shared storage. Then on both host side, it needs to 
mount the shared folder onto
+# the default libvirt image folder: /var/lib/libvirt/images
+
+domain:create
+guestname
+$defaultos
+guesttype
+$defaulthv
+
+domain:migrate
+target_machine
+$target_machine
+username
+$target_user
+password
+$target_password
+guestname
+$defaultos
+prestate
+running
+poststate
+running
+presrcconfig
+false
+postsrcconfig
+false
+predstconfig
+false
+postdstconfig
+false
+flags
+0|live
+
+
+domain:create
+guestname
+$defaultos
+guesttype
+$defaulthv
+
+domain:migrate
+target_machine
+$target_machine
+username
+$target_user
+password
+$target_password
+guestname
+$defaultos
+prestate
+running
+poststate
+running
+presrcconfig
+false
+postsrcconfig
+false
+predstconfig
+false
+postdstconfig
+false
+flags
+peer2peer|live
+
+
+
+domain:create
+guestname
+$defaultos
+guesttype
+$defaulthv
+
+domain:migrate
+target_machine
+$target_machine
+username
+$target_user
+password
+$target_password
+guestname
+$$defaultos
+prestate
+running
+poststate
+running
+presrcconfig
+false
+postsrcconfig
+false
+predstconfig
+false
+postdstconfig
+false
+flags
+peer2peer|tunnelled|live
+
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] save domain status after modifing vcpupin

2011-06-27 Thread Wen Congyang
We should save domain status after modifing vcpupin. If not,
we will get wrong vcpupin information after rebooting libvirtd.

---
 src/qemu/qemu_driver.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8fcc266..768e0f2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3124,6 +3124,8 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
 }
 }
 
+if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
+goto cleanup;
 }
 
 if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Fix memory leak in virDomainVcpuPinDel()

2011-06-27 Thread Wen Congyang
virDomainVcpuPinDefFree() does not free def->cputune.vcpupin if nvcpupin
is 0, and does not set def->cputune.vcpupin to NULL.

If we set nvcpupin to 0 but do not free vcpupin, vcpupin will not be freed
when vm->def is freed.

Use VIR_FREE() instead of virDomainVcpuPinDefFree() to free the memory
and set def->cputune.vcpupint to NULL.

---
 src/conf/domain_conf.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 60e0318..f9bf51e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8263,7 +8263,7 @@ virDomainVcpuPinDel(virDomainDefPtr def, int vcpu)
 return 0;
 
 if (--def->cputune.nvcpupin == 0) {
-virDomainVcpuPinDefFree(def->cputune.vcpupin, 0);
+VIR_FREE(def->cputune.vcpupin);
 } else {
 if (VIR_REALLOC_N(def->cputune.vcpupin, def->cputune.nvcpupin) < 0) {
 virReportOOMError();
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] xml: create an RNG file for common types and move some definitions there

2011-06-27 Thread Eric Blake
On 06/26/2011 03:19 AM, Laine Stump wrote:
> domain.rng, network.rng, and interface.rng already use a few of the
> same types (or in some cases *should* but don't), and an upcoming code
> change will have them sharing even more. To prepare for that, this
> patch takes those common data type definitions and moves them into
> basictypes.rng.
> 
> This may break some rule about the need to RNG files to be autonomous
> or something, but I saw that storageencryption.rng is used in this
> way, so I figured it must not be completely against the law...
> ---
>  docs/schemas/basictypes.rng |  130 
> +++
>  docs/schemas/domain.rng |   86 +---
>  docs/schemas/interface.rng  |   71 ---
>  docs/schemas/network.rng|   79 +++---
>  4 files changed, 166 insertions(+), 200 deletions(-)
>  create mode 100644 docs/schemas/basictypes.rng

On the surface, this seems reasonable; however, it's probably to wait
until after 0.9.3 to actually commit it.

It looks like we could also make a few more files use this common file;
for example,  also appears in
{capability,nwfilter,secret,storagevol}.rng.

> 
> diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
> new file mode 100644
> index 000..b3267f5
> --- /dev/null
> +++ b/docs/schemas/basictypes.rng
> @@ -0,0 +1,130 @@
> +
> +
> +http://relaxng.org/ns/structure/1.0"; 
> datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
> +
> +  
> +  
> +
> +  [0-9]+
> +
> +  
> +
> +  
> +
> +  [0-9]+
> +
> +  

Should this one be excluding 0 via 1?

ACK to the changes, once we decide on timing.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 4/4] Cleanup remote protocol definitions

2011-06-27 Thread Eric Blake
On 06/27/2011 08:24 AM, Daniel P. Berrange wrote:
> The standard remote protocol for libvirtd no longer needs to
> include definitions of the generic message header/error structs
> or status codes. This is all defined in the generic RPC protocol
> 
> * src/remote/remote_protocol.x: Remove all RPC message definitions
> * src/remote/remote_protocol.h, src/remote/remote_protocol.c:
>   Re-generate
> * daemon/remote_generate_stubs.pl: Delete obsolete script

Commit message is out-of-date; this file was renamed
daemon/remote_generator.pl in commit 999f5b3, then moved to
src/rpc/gendispatch.pl in commit b17b4af.

> ---
>  src/remote/remote_protocol.x |  115 
> --
>  1 files changed, 0 insertions(+), 115 deletions(-)

Given the above commit message, should you also be trimming away at
src/rpc/gendispatch.pl, or any of the Makefile.am snippets that still
create the various *_bodies.h files?

ACK with that question resolved, and this squashed in.

diff --git i/src/remote_protocol-structs w/src/remote_protocol-structs
index c07ba81..25979b4 100644
--- i/src/remote_protocol-structs
+++ w/src/remote_protocol-structs
@@ -1615,11 +1615,3 @@ struct remote_domain_get_control_info_ret {
 u_int  details;
 uint64_t   stateTime;
 };
-struct remote_message_header {
-u_int  prog;
-u_int  vers;
-intproc;
-remote_message_typetype;
-u_int  serial;
-remote_message_status  status;
-};

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 3/4] Remove obsolete libvirtd mdns code

2011-06-27 Thread Eric Blake
On 06/27/2011 08:24 AM, Daniel P. Berrange wrote:
> libvirtd now uses the generic RPC code for MDNS, so its
> custom mdns APIs are no longer required
> 
> * daemon/mdns.c, daemon/mdns.h: Removed obsolete files
> ---
>  daemon/mdns.c |  508 
> -
>  daemon/mdns.h |   96 ---
>  2 files changed, 0 insertions(+), 604 deletions(-)
>  delete mode 100644 daemon/mdns.c
>  delete mode 100644 daemon/mdns.h

ACK.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/4] Convert libvirtd over to the new RPC handling APIs

2011-06-27 Thread Eric Blake
On 06/27/2011 08:24 AM, Daniel P. Berrange wrote:
> This guts the libvirtd daemon, removing all its networking and
> RPC handling code. Instead it calls out to the new virServerPtr
> APIs for all its RPC & networking work
> 
> As a fallout all libvirtd daemon error reporting now takes place
> via the normal internal error reporting APIs. There is no need
> to call separate error reporting APIs in RPC code, nor should
> code use VIR_WARN/VIR_ERROR for reporting fatal problems anymore.
> 
> * daemon/qemu_dispatch_*.h, daemon/remote_dispatch_*.h: Remove
>   old generated dispatcher code
> * daemon/qemu_dispatch.h, daemon/remote_dispatch.h: New dispatch
>   code
> * daemon/dispatch.c, daemon/dispatch.h: Remove obsoleted code
> * daemon/remote.c, daemon/remote.h: Rewrite for new dispatch
>   APIs
> * daemon/libvirtd.c, daemon/libvirtd.h: Remove all networking
>   code
> * daemon/stream.c, daemon/stream.h: Update for new APIs
> * daemon/Makefile.am: Link to libvirt-net-rpc-server.la
> +++ b/daemon/Makefile.am
> @@ -3,33 +3,21 @@
>  CLEANFILES =
>  
>  DAEMON_GENERATED =   \
> - $(srcdir)/remote_dispatch_prototypes.h  \
> - $(srcdir)/remote_dispatch_table.h   \
> - $(srcdir)/remote_dispatch_args.h\
> - $(srcdir)/remote_dispatch_ret.h \
> - $(srcdir)/remote_dispatch_bodies.h  \
> - $(srcdir)/qemu_dispatch_prototypes.h\
> - $(srcdir)/qemu_dispatch_table.h \
> - $(srcdir)/qemu_dispatch_args.h  \
> - $(srcdir)/qemu_dispatch_ret.h   \
> - $(srcdir)/qemu_dispatch_bodies.h
> + $(srcdir)/remote_dispatch.h \
> + $(srcdir)/qemu_dispatch.h

Should prove to be interesting, with fewer files.

> @@ -211,11 +162,7 @@ policyfile = libvirtd.policy-1
>  endif
>  endif
>  
> -if HAVE_AVAHI
> -libvirtd_SOURCES += $(AVAHI_SOURCES)
> -libvirtd_CFLAGS += $(AVAHI_CFLAGS)
> -libvirtd_LDADD += $(AVAHI_LIBS)
> -endif
> +EXTRA_DIST += probes.d libvirtd.stp

Spurious addition; this line is already present elsewhere in Makefile.am.

> +++ b/daemon/libvirtd.c
> @@ -23,31 +23,13 @@
>  
>  #include 
> -#include 
> -#include 
> -#include 

A bit too prune-happy; compilation failed.  And even then, I'm getting a
test failure:

 31) corrupted config audit_logging   ... OK
./daemon-conf: line 98: kill: (22788) - No such process
 32) valid config file (sleeping 2 seconds)   ... FAILED
FAIL: daemon-conf

>  #include "memory.h"
> -#include "stream.h"
> +#include "conf.h"
> +#include "virnetserver.h"
> +#include "threads.h"
> +#include "remote.h"
> +#include "remote_driver.h"
> +//#include "stream.h"

Delete this line, rather than commenting it.

> +
> +if (data->auth_unix_rw == REMOTE_AUTH_POLKIT)
> +data->unix_sock_rw_perms = strdup("0777"); /* Allow world */
> +else
> +data->unix_sock_rw_perms = strdup("0700"); /* Allow user only */
> +data->unix_sock_ro_perms = strdup("0777"); /* Always allow world */

Why are we passing this as formatted strings, instead of as raw octal
mode_t numbers?

> @@ -3218,69 +1325,91 @@ int main(int argc, char **argv) {
>  break;
>  
>  case 'p':
> -pid_file = optarg;
> +VIR_FREE(pid_file);
> +if (!(pid_file = strdup(optarg)))
> +exit(EXIT_FAILURE);
>  break;
>  
>  case 'f':
> -remote_config_file = optarg;
> +if (!(remote_config_file = strdup(optarg)))
> +exit(EXIT_FAILURE);

Mem leak if -f is used more than once (you need the same VIR_FREE to
nuke prior use of -f as you had for prior use of -p).

>  
> +/*
> + * You must hold lock for at least the client
> + * We don't free stuff here, merely disconnect the client's
> + * network socket & resources.
> + * We keep the libvirt connection open until any async
> + * jobs have finished, then clean it up elsehwere
> + */
> +static void remoteClientFreeFunc(void *data)

s/elsehwere/elsewhere/

>  static int
> -remoteDispatchDomainGetVcpupinInfo(struct qemud_server *server 
> ATTRIBUTE_UNUSED,
> -   struct qemud_client *client 
> ATTRIBUTE_UNUSED,
> -   virConnectPtr conn,
> -   remote_message_header *hdr 
> ATTRIBUTE_UNUSED,
> -   remote_error *rerr,
> +remoteDispatchDomainGetVcpupinInfo(virNetServerPtr server ATTRIBUTE_UNUSED,
> +   virNetServerClientPtr client 
> ATTRIBUTE_UNUSED,
> +   virNetMessageHeaderPtr hdr 
> ATTRIBUTE_UNUSED,
> +   virNetMessageErrorPtr rerr,
> remote_domain_get_vcpupin_info_args *args,
> remote_domain_get_vcpupin_info_re

Re: [libvirt] [PATCH 1/4] Convert the remote driver to new RPC client APIs

2011-06-27 Thread Eric Blake
On 06/27/2011 02:08 PM, Eric Blake wrote:

Aargh, I hit send too soon.

>> +case trans_ext: {
>> +char const *cmd_argv[] = { command, NULL };
>> +if (!(priv->client = virNetClientNewExternal(cmd_argv)))

This appears to be the only call to virNetClientNewExternal.  And it
only passes a single argument, command.  Should we simplify the
signature to be const char *command instead of const char **cmdargv?
But that can be a separate patch (or you can prove me wrong, if later
patches also start using this with more than just the command name).

>> @@ -874,26 +646,14 @@ doRemoteOpen (virConnectPtr conn,
>>  /* Now try and find out what URI the daemon used */
>>  if (conn->uri == NULL) {
>>  remote_get_uri_ret uriret;
>> -int urierr;
>>  
>> +VIR_DEBUG("Trying to query remote URI");
>>  memset (&uriret, 0, sizeof uriret);
>> -urierr = call (conn, priv,
>> -   REMOTE_CALL_IN_OPEN | REMOTE_CALL_QUIET_MISSING_RPC,
>> -   REMOTE_PROC_GET_URI,
>> -   (xdrproc_t) xdr_void, (char *) NULL,
>> -   (xdrproc_t) xdr_remote_get_uri_ret, (char *) 
>> &uriret);
>> -if (urierr == -2) {
>> -/* Should not really happen, since we only probe local 
>> libvirtd's,
>> -   & the library should always match the daemon. Only case is 
>> post
>> -   RPM upgrade where an old daemon instance is still running 
>> with
>> -   new client. Too bad. It is not worth the hassle to fix this 
>> */
>> -remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
>> -_("unable to auto-detect URI"));
>> -goto failed;
>> -}
>> -if (urierr == -1) {
>> +if (call (conn, priv, 0,
>> +  REMOTE_PROC_GET_URI,

Is the loss of REMOTE_CALL_QUIET_MISSING_RPC going to make this new code
noisy when talking to an (extremely) old remote client?  Or is the
assumption that the deleted comment still applies, and the only reason
we were using the QUIET_MISSING_RPC call would be to silence a one-time
failure upon a libvirtd upgrade, but where we can assume that it is no
longer a practical concern.

>>  
>>  
>>  static int
>> -check_cert_file(const char *type, const char *file)
>> +doRemoteClose (virConnectPtr conn, struct private_data *priv)
>>  {

>> +virNetClientProgramFree(priv->remoteProgram);
>> +virNetClientProgramFree(priv->qemuProgram);
>> +priv->remoteProgram = priv->qemuProgram = NULL;
>> +
>> +/* Free hostname copy */
>> +VIR_FREE(priv->hostname);
>> +
>> +/* See comment for remoteType. */
>> +VIR_FREE(priv->type);
>> +
>> +virDomainEventStateFree(priv->domainEventState);

You had several instances of cleanup followed by NULL-ing the argument,
to avoid double cleanup; does priv->domainEventState need this same
protection?  But it does make sense that doRemoteClose is used to sever
connections while keeping the object still alive, so that it does part,
but not all, of the work of the final cleanup function and must protect
against double cleanup.

>> -memset (&secprops, 0, sizeof secprops);
>>  /* If we've got a secure channel (TLS or UNIX sock), we don't care 
>> about SSF */
>> -secprops.min_ssf = priv->is_secure ? 0 : 56; /* Equiv to DES supported 
>> by all Kerberos */
>> -secprops.max_ssf = priv->is_secure ? 0 : 10; /* Very strong ! AES 
>> == 256 */
>> -secprops.maxbufsize = 10;
>>  /* If we're not secure, then forbid any anonymous or trivially 
>> crackable auth */
>> -secprops.security_flags = priv->is_secure ? 0 :
>> -SASL_SEC_NOANONYMOUS | SASL_SEC_NOPLAINTEXT;
>> -
>> -err = sasl_setprop(saslconn, SASL_SEC_PROPS, &secprops);
>> -if (err != SASL_OK) {
>> -remoteError(VIR_ERR_INTERNAL_ERROR,
>> -_("cannot set security props %d (%s)"),
>> -err, sasl_errstring(err, NULL, NULL));
>> +if (virNetSASLSessionSecProps(sasl,
>> +  priv->is_secure ? 0 : 56, /* Equiv to DES 
>> supported by all Kerberos */
>> +  priv->is_secure ? 0 : 10, /* Very 
>> strong ! AES == 256 */
>> +  priv->is_secure ? true : false) < 0)

Those look like magic numbers, but they were there before the
refactoring, so not fatal to this patch.

>> @@ -3410,7 +2632,7 @@ remoteAuthSASL (virConnectPtr conn, struct 
>> private_data *priv, int in_open,
>>  if (clientoutlen > REMOTE_AUTH_SASL_DATA_MAX) {
>>  remoteError(VIR_ERR_AUTH_FAILED,
>>  _("SASL negotiation data too long: %d bytes"),
>> -clientoutlen);
>> +(int)clientoutlen);

Rather than adding a cast to cope with the change of clientoutlen from
int to size_t, shouldn't you instead change %d to %zu?

>>  goto cleanup;
>>  }
>>  /* NB, distinction of NUL

Re: [libvirt] [PATCH] virsh: add custom readline generator

2011-06-27 Thread Eric Blake
On 06/27/2011 12:06 PM, Michal Privoznik wrote:
>> That is, if you have command-based custom generators, then each command
>> has to repeat parsing functionality, then call back to common list
>> generators; whereas if you have option-based custom generators, then you
>> have fewer callbacks because all the smarts are tied to well-typed
>> options, and after all, it is the type of each option that determines
>> which list to generate, more than the type of the command that includes
>> the option.
>>
> I was thinking about same feature and started to work on it during this
> weekend. But I ran into a problem. Basically, what I intended to
> implement, is:
> 
> 1.) expand struct vshCmdDef for a char *(*callback) (const char *text,
> int state). But for real benefit, we need connection object, so we could
> e.g. list only inactive networks for 'net-start' command. And this is
> the problem, because we would have to make this object global (since
> readline functions does not allow passing any opaque value).

As gross as it is, a global object isn't entirely bad - virsh is
single-threaded.  And even if we want to make virsh threaded at some
point, I still think we can get away with adding a thread-local access
scheme.

> 
> 2.) expand each command definition with its own completer. So e.g. for
> start commands we could only list inactive domains, networks, pools,
> whatever. For destroy only active objects. And so on.

So maybe we want both - an option-based completer that generates the
initial list, and a command-based completer that can then prune out
irrelevant options?

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] virsh: add custom readline generator

2011-06-27 Thread Michal Privoznik
On 27.06.2011 19:37, Eric Blake wrote:
> On 06/24/2011 12:42 AM, Lai Jiangshan wrote:
>> Custom readline generator will help for some usecase.
> 
> Indeed, this could be very nice as extended to more commands.
> 
>>
>> Also add a custom readline generator for the "help" command.
>>
>> Signed-off-by: Lai Jiangshan 
>> ---
> 
> Hmm, this is a new virsh feature, and we've missed the RC1 deadline,
> even though your v1 was posted before then.  On one hand, it seems like
> this would be self-contained enough that I would be okay with including
> a v2 in 0.9.3, unless anyone else objects in the next day or so.
> However, there are some cleanups to do first, and in the process of
> identifying those, I have a suggestion for a complete revamp of the
> patch idea which would certainly put us into post-release approval:
> 
>> diff --git a/tools/virsh.c b/tools/virsh.c
>> index fcd254d..51e43c1 100644
>> --- a/tools/virsh.c
>> +++ b/tools/virsh.c
>> @@ -13575,7 +13575,7 @@ vshCloseLogFile(vshControl *ctl)
>>   * (i.e. STATE == 0), then we start at the top of the list.
>>   */
>>  static char *
>> -vshReadlineCommandGenerator(const char *text, int state)
>> +vshReadlineCmdAndGrpGenerator(const char *text, int state, int grpname)
> 
> You are using grpname as a bool, so s/int/bool/
> 
>>  static char *
>> +vshReadlineCommandGenerator(const char *text, int state)
>> +{
>> +return vshReadlineCmdAndGrpGenerator(text, state, 0);
>> +}
>> +
>> +static char *
>> +vshReadlineHelpOptionGenerator(const char *text, int state)
>> +{
>> +return vshReadlineCmdAndGrpGenerator(text, state, 1);
> 
> and pass false/true rather than 0/1.
> 
>> +}
>> +
>> +struct vshCustomReadLine {
>> +const char *name;
>> +char *(*CustomReadLineOptionGenerator)(const char *text, int state);
>> +};
>> +
>> +struct vshCustomReadLine customeReadLine[] = {
>> +{ "help", vshReadlineHelpOptionGenerator },
>> +{ NULL, NULL }
> 
> Rather than maintaining yet another array of mappings, along with the
> corresponding cost of name lookups within that array, what if we instead
> change vshCmdDef to instead have a new function pointer field, which is
> NULL if the default command completion is good enough, but which is the
> particular command's custom completer when we want a smarter function.
> 
>> +static struct vshCustomReadLine *vshCustomReadLineSearch(const char *name)
>> +{
>> +struct vshCustomReadLine *ret = customeReadLine;
> 
> s/custome/custom/, if we even keep this function.  But I don't think we
> need it, because...
> 
>> @@ -13632,6 +13672,7 @@ vshReadlineOptionsGenerator(const char *text, int 
>> state)
>>  memcpy(cmdname, rl_line_buffer, p - rl_line_buffer);
>>  
>>  cmd = vshCmddefSearch(cmdname);
>> +rl = vshCustomReadLineSearch(cmdname);
> 
> ...here, you could just get the custom generator as a member of the
> enlarged vshCmdDef struct.
> 
> One other idea would be to add new enums to vshCmdOptType.  For example,
> VSH_OT_CMD would be identical to VSH_OT_STRING, except that during
> tab-completion, it completes on command and group names (for that
> matter, while VSH_OT_STRING and VSH_OT_DATA used to have separate
> purposes, I no longer see any difference between them, and we could
> probably consolidate those two types).  But I don't know if that makes
> tab completion any easier or harder.  In terms of your help example, the
> two ideas play out roughly like:
> 
> 1. 'help TAB' -> completion generator parses first word, 'help', and
> sees that it is a command.  The help command has a custom generator, so
> invoke that.  The custom generator for help then knows that the only
> possibility for a next word is a command or group name, and returns the
> full list of such names.
> 
> 2. 'help TAB' -> completion generator parses first word, and learns that
> 'help' command has a VSH_OT_CMD second argument.  It then calls the CMD
> generator, which knows how to generate the full list of such names.
> 
> But when you get to other commands, you can start to see the benefit of
> having strongly-typed VSH_OT arguments:
> 
> 1. 'vol-key --pool TAB' -> completion generator parses first word and
> sees that it is the 'vol-key' command.  It then calls the vol-key
> command generator, which must parse the second word '--pool' to see that
> completion wants a name of a pool, rather than a volume id.  But there
> are quite a few vol-* commands, all of which would have to repeat this
> --pool parsing.
> 
> 2. 'vol-key --pool TAB' -> completion generator parses '--pool' and sees
> that it requires an argument, and that it is of type VSH_OT_POOL.  It is
> then able to provide a list of all pool names, merged also with the list
> of all other possible options (in this case, --vol).
> 
> That is, if you have command-based custom generators, then each command
> has to repeat parsing functionality, then call back to common list
> generators; whereas if you have option-based custom generators, then you
> have fewer c

Re: [libvirt] [PATCH] network: add domain to unqalified names define with

2011-06-27 Thread Eric Blake
On 06/24/2011 11:33 PM, Laine Stump wrote:
> If a domain name is defined for a network, add the --expand-hosts
> option to the dnsmasq commandline. This results in the domain being
> added to any hostname that is defined in a dns  element and
> contains no '.' characters (i.e. it is an "unqualified"
> hostname). Since PTR records are automatically created for any name
> define in , the result of a PTR request will change from the
> unqualified name to the qualified name.
> 
> This also has the same effect on any hostnames that dnsmasq reads
> from the host's /etc/hosts file. Hosts.
> 
> I want to make sure that everyone notices that previous paragraph and
> has a chance to object if they believe this change in existing
> behavior will be detrimental. Note that guests will still be able to
> query the unqualified name, with the same results as before; it is
> only when a reverse lookup of an IP address is done that the result
> will be different, e.g. it will return "f15.example.com" instead of
> "f15".
> 
> (In the case of guest hostnames that were learned by dnsmasq via DHCP
> requests, they were already getting the domain name added on, even
> without --expand-hosts).
> ---
>  src/network/bridge_driver.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)

I think that it is probably wiser to include this in 0.9.3 than to wait,
so that we get more experience with it prior to your pending feature of
improved network interface XML.  But I don't feel comfortable being the
only ack, so hopefully someone else speaks up as well.

> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index f15a7a6..a9a0374 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -614,6 +614,10 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
>  if (ipdef->nranges || ipdef->nhosts)
>  virCommandAddArg(cmd, "--dhcp-no-override");
>  
> +/* add domain to any non-qualified hostnames in /etc/hosts or 
> addn-hosts file */
> +if (network->def->domain)
> +   virCommandAddArg(cmd, "--expand-hosts");
> +

At any rate, ACK to this code change, and I think it is reasonable
enough.  By explicitly requesting the domain in the XML, it seems like
any guest query for an unqualified name that is satisfied by the host's
lookup tables are indeed a name belonging to the fully-qualified network
tied to the guest, so returning a fully-qualified name to the guest is
reasonable (even if we previously returned an unqualified name).

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] regression in finding boot device

2011-06-27 Thread Laine Stump

On 06/27/2011 05:50 AM, Jiri Denemark wrote:

On Sat, Jun 25, 2011 at 00:21:29 -0400, Laine Stump wrote:

(bootindex was showing up as "1" in the log; not knowing anything about
how it worked, I decided to try just changing it to "0". That  didn't
work. Switching back to the old method *did* work, though.)

This system is running qemu-kvm-0.14-7.fc14.x86_64.
If you'd like a look at the domain XML, the qemu logs, or access to the
machine, just let me know.

Yeah, sending the domain XML and qemu command line to which it was transformed
would be great.



Sure. I've attached the XML at the end. Here's the non-working 
commandline (split into multiple lines for readability):


LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=laine
LOGNAME=laine QEMU_AUDIO_DRV=none
/usr/bin/qemu-kvm -S -M pc-0.14 -enable-kvm -m 1024 -smp 
1,sockets=1,cores=1,threads=1
-name F15 -uuid 5091aadb-136d-56a7-76c8-b829ad934c1a -nodefconfig 
-nodefaults
-chardev 
socket,id=charmonitor,path=/var/lib/libvirt/qemu/F15.monitor,server,nowait

-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-device 
virtio-serial-pci,id=virtio-serial0,bus=pci.0,multifunction=on,addr=0x7.0x0
-drive 
file=/var/lib/libvirt/images/F15.img,if=none,id=drive-virtio-disk0,format=raw
-device 
virtio-blk-pci,bus=pci.0,multifunction=on,addr=0x5.0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1

-drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
-netdev tap,fd=24,id=hostnet0
-device 
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:48:27:1d,bus=pci.0,multifunction=on,addr=0x3.0x0
-chardev pty,id=charserial0 -device 
isa-serial,chardev=charserial0,id=serial0

-usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 -vga cirrus
-device AC97,id=sound0,bus=pci.0,multifunction=on,addr=0x4.0x0
-device 
virtio-balloon-pci,id=balloon0,bus=pci.0,multifunction=on,addr=0x6.0x0


Just for reference, here's the working commandline:

LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none
/usr/bin/qemu-kvm -S -M pc-0.14 -enable-kvm -m 1024 -smp 
1,sockets=1,cores=1,threads=1
-name F15 -uuid 5091aadb-136d-56a7-76c8-b829ad934c1a -nodefconfig 
-nodefaults
-chardev 
socket,id=charmonitor,path=/var/lib/libvirt/qemu/F15.monitor,server,nowait

-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-boot c
-device 
virtio-serial-pci,id=virtio-serial0,bus=pci.0,multifunction=on,addr=0x7.0x0
-drive 
file=/var/lib/libvirt/images/F15.img,if=none,id=drive-virtio-disk0,boot=on,format=raw
-device 
virtio-blk-pci,bus=pci.0,multifunction=on,addr=0x5.0x0,drive=drive-virtio-disk0,id=virtio-disk0

-drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
-netdev tap,fd=27,id=hostnet0 -device 
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:48:27:1d,bus=pci.0,multifunction=on,addr=0x3.0x0
-chardev pty,id=charserial0 -device 
isa-serial,chardev=charserial0,id=serial0

-usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 -vga cirrus
-device AC97,id=sound0,bus=pci.0,multifunction=on,addr=0x4.0x0
-device 
virtio-balloon-pci,id=balloon0,bus=pci.0,multifunction=on,addr=0x6.0x0




  However, since you say you see bootindex=1 (in qemu command
line I suppose), I think everything should work fine on libvirt side... What
version of seabios do you have?


The console screen says SeaBIOS is 0.6.0 and rpm -q says 
"seabios-bin-0.6.0-1.fc14.noarch".

  F15
  5091aadb-136d-56a7-76c8-b829ad934c1a
  1048576
  1048576
  1
  
hvm

  
  



  
  
  destroy
  restart
  restart
  
/usr/bin/qemu-kvm

  
  
  
  


  
  
  
  


  


  


  
  
  
  


  


  





  


  
  


  

  


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 0/7] Add support for setting QoS

2011-06-27 Thread Christian Benvenuti (benve)
> -Original Message-
> From: Michal Privoznik [mailto:mpriv...@redhat.com]
> Sent: Monday, June 27, 2011 8:34 AM
> To: Christian Benvenuti (benve)
> Cc: Laine Stump; libvir-list@redhat.com
> Subject: Re: [libvirt] [PATCH 0/7] Add support for setting QoS
> 
> On 24.06.2011 20:00, Christian Benvenuti (benve) wrote:
> >>> 3) Similarly for macvtap s, will the network-wide
> bandwidth
> >>> limiting be applied to the physical ethernet device? This would
> >>> have the side effect of including host traffic on that interface
in
> >>> the bandwidth totals, but I don't see a way around it.
> >> With this patch as-is, shaping rules are applied only when creating
> > TAP
> >> devices. This mean only network types VIR_DOMAIN_NET_TYPE_NETWORK
> and
> >> VIR_DOMAIN_NET_TYPE_BRIDGE.
> >>>
> >>> 4) Finally on that topic, what about s that have a pool
of
> >>> physical ethernets to be used macvtap-style? Is there any way we
> can
> >>> do bandwidth limiting on an aggregated collection of network
> > interfaces?
> >>> Or
> >>> will attempts to configure this necessarily result in a "config
not
> >>> supported" log message?
> >> Huh, I didn't know it is possible to have a pool of devices within
> one
> >> . So in this case, this patch silently does nothing.
> >
> > The IFB (Intermediate Functional Block) allows you to
> > configure aggregate QoS on multiple interfaces.
> >
> > /Chris
> >
> >
> Yes, but we would then need to create those IFB devices on the fly
> (e.g.
> on domain startup) and I don't think there is other way than unloading
> and then loading the ifb module (with different parameter) which
> however
> would break other domains connections. Or am I missing something?

Adding support for dynamic creation/deletion of IFB devices (for example
via netlink) should not be that hard. If that's the only reason for not
using it, I would consider the option of extending the IFB module.

/Chris

> But I agree, using ifb would be much more beautiful, because we could
> actually shape incoming traffic instead of dropping.
> 
> Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] virsh: add custom readline generator

2011-06-27 Thread Eric Blake
On 06/24/2011 12:42 AM, Lai Jiangshan wrote:
> Custom readline generator will help for some usecase.

Indeed, this could be very nice as extended to more commands.

> 
> Also add a custom readline generator for the "help" command.
> 
> Signed-off-by: Lai Jiangshan 
> ---

Hmm, this is a new virsh feature, and we've missed the RC1 deadline,
even though your v1 was posted before then.  On one hand, it seems like
this would be self-contained enough that I would be okay with including
a v2 in 0.9.3, unless anyone else objects in the next day or so.
However, there are some cleanups to do first, and in the process of
identifying those, I have a suggestion for a complete revamp of the
patch idea which would certainly put us into post-release approval:

> diff --git a/tools/virsh.c b/tools/virsh.c
> index fcd254d..51e43c1 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -13575,7 +13575,7 @@ vshCloseLogFile(vshControl *ctl)
>   * (i.e. STATE == 0), then we start at the top of the list.
>   */
>  static char *
> -vshReadlineCommandGenerator(const char *text, int state)
> +vshReadlineCmdAndGrpGenerator(const char *text, int state, int grpname)

You are using grpname as a bool, so s/int/bool/

>  static char *
> +vshReadlineCommandGenerator(const char *text, int state)
> +{
> + return vshReadlineCmdAndGrpGenerator(text, state, 0);
> +}
> +
> +static char *
> +vshReadlineHelpOptionGenerator(const char *text, int state)
> +{
> + return vshReadlineCmdAndGrpGenerator(text, state, 1);

and pass false/true rather than 0/1.

> +}
> +
> +struct vshCustomReadLine {
> + const char *name;
> + char *(*CustomReadLineOptionGenerator)(const char *text, int state);
> +};
> +
> +struct vshCustomReadLine customeReadLine[] = {
> + { "help", vshReadlineHelpOptionGenerator },
> + { NULL, NULL }

Rather than maintaining yet another array of mappings, along with the
corresponding cost of name lookups within that array, what if we instead
change vshCmdDef to instead have a new function pointer field, which is
NULL if the default command completion is good enough, but which is the
particular command's custom completer when we want a smarter function.

> +static struct vshCustomReadLine *vshCustomReadLineSearch(const char *name)
> +{
> +struct vshCustomReadLine *ret = customeReadLine;

s/custome/custom/, if we even keep this function.  But I don't think we
need it, because...

> @@ -13632,6 +13672,7 @@ vshReadlineOptionsGenerator(const char *text, int 
> state)
>  memcpy(cmdname, rl_line_buffer, p - rl_line_buffer);
>  
>  cmd = vshCmddefSearch(cmdname);
> +rl = vshCustomReadLineSearch(cmdname);

...here, you could just get the custom generator as a member of the
enlarged vshCmdDef struct.

One other idea would be to add new enums to vshCmdOptType.  For example,
VSH_OT_CMD would be identical to VSH_OT_STRING, except that during
tab-completion, it completes on command and group names (for that
matter, while VSH_OT_STRING and VSH_OT_DATA used to have separate
purposes, I no longer see any difference between them, and we could
probably consolidate those two types).  But I don't know if that makes
tab completion any easier or harder.  In terms of your help example, the
two ideas play out roughly like:

1. 'help TAB' -> completion generator parses first word, 'help', and
sees that it is a command.  The help command has a custom generator, so
invoke that.  The custom generator for help then knows that the only
possibility for a next word is a command or group name, and returns the
full list of such names.

2. 'help TAB' -> completion generator parses first word, and learns that
'help' command has a VSH_OT_CMD second argument.  It then calls the CMD
generator, which knows how to generate the full list of such names.

But when you get to other commands, you can start to see the benefit of
having strongly-typed VSH_OT arguments:

1. 'vol-key --pool TAB' -> completion generator parses first word and
sees that it is the 'vol-key' command.  It then calls the vol-key
command generator, which must parse the second word '--pool' to see that
completion wants a name of a pool, rather than a volume id.  But there
are quite a few vol-* commands, all of which would have to repeat this
--pool parsing.

2. 'vol-key --pool TAB' -> completion generator parses '--pool' and sees
that it requires an argument, and that it is of type VSH_OT_POOL.  It is
then able to provide a list of all pool names, merged also with the list
of all other possible options (in this case, --vol).

That is, if you have command-based custom generators, then each command
has to repeat parsing functionality, then call back to common list
generators; whereas if you have option-based custom generators, then you
have fewer callbacks because all the smarts are tied to well-typed
options, and after all, it is the type of each option that determines
which list to generate, more than the type of the command that includes
the option.

-- 
Eric B

[libvirt] shared LVM volume group, should I use it?

2011-06-27 Thread Erik Sjölund
Hi,
Assume I want to have the root file system of the virtualization host
server in an LVM volume on the local hard drive.

Is it ok to have that LVM volume in the same LVM volume group that I
will later use as a Storage Pool for libvirt?

I already found a question about this:
http://serverfault.com/questions/200728/lvm-volume-group-shared-between-kvm-libvirt-host-and-guests-is-this-a-bad-idea

and I also found this statement at opensuse.org:
http://doc.opensuse.org/products/opensuse/openSUSE/opensuse-kvm/sec.libvirt.stornet.storage.html

"Security Considerations

In order to avoid data loss or data corruption, do not attempt to use
resources such as LVM volume groups, iSCSI targets, etc. that are used
to build storage pools on the VM Host Server, as well. "

The first source of information indicates it should be okay to share
the LVM volume group but the second source of information doesn't
indicate that.
What do you think?
cheers,
Erik Sjölund

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] daemon: Dynamically create worker threads when some get stuck

2011-06-27 Thread Michal Privoznik
On 16.06.2011 19:29, Daniel P. Berrange wrote:
> On Thu, Jun 16, 2011 at 04:29:55PM +0200, Michal Privoznik wrote:
>> Up to now, we've created new worker threads only during new connection.
>> This patch monitors worker threads for liveness and dynamically create
>> new one if all are stuck, waiting for hypervisor to reply. This
>> situation can happen. All one need to do is send STOP signal to qemu.
>> The amount of time when we evaluate thread as stuck is defined in
>> WORKER_TIMEOUT macro.
>>
>> With this approach we don't need to create new worker thread on incoming
>> connection. However, as number of active worker threads grows, it might
>> happen we need to size up the pool of worker threads and hence exceed
>> the max_worker configuration value.
> 
> This is really not desirable. The max_workers limit is in the
> configuration as a static limit, to prevent client applications
> from making libvirtd spawn an unlimited number of threads. We
> must *always* respect the max_workers limit.
> 
> I don't think automatically spawning workers is the right way
> to deal with the QEMU issue anyway. As mentioned before, we need
> to improve the QEMU monitor driver so that we can safely allow
> monitor commands to time out
> 
> Regards,
> Daniel

Well, and what about compromise. Don't exceed the max_workers limit, but
possibly create workers on API calls instead only on new connection?
Even with timeouts on qemu monitor we can be unresponsive for
min(QEMU_JOB_WAIT_TIME,  monitor_timeout) even without obvious reason.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] nwfiler: Return error message about unresolvable variables

2011-06-27 Thread Stefan Berger

On 06/27/2011 11:52 AM, Eric Blake wrote:

On 06/27/2011 08:14 AM, Stefan Berger wrote:

s/nwfiler/nwfilter/ in the subject
virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
strstr(buf, ", ") ?
  _("Cannot instantiate filter due to unresolvable variables: %s") :
  _("Cannot instantiate filter due to unresolvable variable: %s"),
buf);

ACK with those changes.

Pushed with changes applied.

  Stefan

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 1/2] Timeout QEMU monitor replies after 30 seconds

2011-06-27 Thread Michal Privoznik
On 24.06.2011 07:19, Daniel Veillard wrote:
> On Wed, Jun 22, 2011 at 11:26:27AM -0600, Eric Blake wrote:
>> On 06/22/2011 11:05 AM, Jiri Denemark wrote:
>>> On Wed, Jun 22, 2011 at 16:47:18 +0100, Daniel P. Berrange wrote:
 If the QEMU process has been stopped (kill -STOP/gdb), or the
 QEMU process has live-locked itself, then we will never get a
 reply from the monitor. We should not wait forever in this
 case, but instead timeout after a reasonable amount of time.

 NB if the host has high CPU load, or a single monitor command
 intentionally takes a long time, then this will cause bogus
 failures. In the case of high CPU load, arguably the guest
 should have been migrated elsewhere, since you can't effectively
 manage guests on a host if QEMU is taking > 30 seconds to reply
 to simply commands. Since we use background migration, there
 should not be any commands which take significant time to
 execute any more
>>>
>>> The thing I'm most concerned about is that is far too easy to get into such
>>> situations especially since disk cache subsystem in Linux kernel is not the
>>> best thing in the world. While I agree that running guests on a loaded host 
>>> is
>>> not very clever and guests should rather be migrated elsewhere, such 
>>> situation
>>> doesn't have to be intentional. In other words, in case of a malfunction of
>>> some kind (some processes go crazy, network disruptions, ...) QEMU may 
>>> require
>>> more than a timeout seconds to respond and we will penalize an innocent QEMU
>>> process because we won't be able to control it anymore even though the 
>>> issues
>>> get fixed.
>>
>> Is there any way to measure time spent by the child process, rather than
>> just relying on wall-time elapsed?  That is, when libvirt hits 30
>> seconds of wall time in waiting for a monitor, can it then check whether
>> the child process has accumulated any execution time (likely hung) vs.
>> no execution time (likely a starved system situation), and only give up
>> in the former case?
> 
>   Well a STOP'ed child process won't accumulate any execution time,
> and you won't be able to discriminate just based on this, but I think
> we should be able to poke linux to see if the process is in D state for
> example and if we do mark the guest as non reponding then being able
> to provide an useful error information upon the associated API failure
> like
>"Failed to contact domain: process stopped"
>"Failed to contact domain: blocked on I/O"
>"Failed to contact domain: process looping"
> 
> would be a really good thing. That probing and reporting can be done
> as a separate step though
> 
> Daniel
> 

To me this looks like solving the Halting problem. That means - for some
cases we might be able to tell qemu will not answer anymore, but for
others we will not.

I agree if qemu (and thus libvirt API call) does not return in ~30
seconds, users get anxious, but it would be nice if we could send
destroy to a unresponsive domains at least.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Confusing valgrind error in virDomainLookupByUUIDString or virReportErrorHelper

2011-06-27 Thread Eric Blake
On 06/27/2011 10:32 AM, Richard W.M. Jones wrote:
> libvirt-0.9.2-2.fc16.x86_64

fc16 implies rawhide

> 
> Here's the error from valgrind:
> 
> ==24953== Conditional jump or move depends on uninitialised value(s)
> ==24953==at 0x3DF68844BB: __GI___strcasecmp_l (strcmp.S:243)
> ==24953==by 0x3DF68221E1: __gconv_open (gconv_open.c:70)
> ==24953==by 0x3DF682F3E9: _nl_find_msg (dcigettext.c:974)
> ==24953==by 0x3DF682FB84: __dcigettext (dcigettext.c:640)
> ==24953==by 0x36BBE5A063: virReportErrorHelper (virterror.c:1215)

__dcigettext is a glibc function.  Sounds to me like valgrind is being
noisy about a recent glibc code change; this is likely a case of a
missing valgrind suppression file, and less likely an actual glibc bug.

> 
> Apparently __FUNCTION__ is deprecated[1].

Most likely a red herring.  We already '#define __FUNCTION__ __func__'
for any other C99 compliant compiler, so now it's just a global cleanup
to decide whether to consistently use gcc style or C99 style.

> That's as far as I've got for today.  Just letting people know ...

I'll see if I can reproduce it.  But since you were testing rawhide, my
guess is that it is a rawhide glibc/valgrind mismatch and not an actual
libvirt shortcoming.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] FreeBSD Port, update to 0.9.2 compile error

2011-06-27 Thread Eric Blake
On 06/27/2011 10:29 AM, Jason Helfman wrote:
>>> >   another way would be to launch python directly giving the path to
>>> the
>>> > python script, this is likely to solve the issue there.
>>
>>  That IMHO avoids the problem completely and I doubt anybody would
>> complain we should even be able to detect at configure and take specific
>> paths if people want to use a non-system python binary by extending
>>
>> paphio:~/libvirt -> ./configure --help | grep python
>>  --with-python   Build python bindings [default=yes]
>>
>> to take a path
>>
>> Daniel
>>
> 
> I was wondering if this issue was addressed in the upcoming release?

I'm not sure that I've seen patches go in yet, but they are still fair
game to include if RC1 doesn't meet your needs as this is a real bug
fix.  I'm also hoping to clean up configure to work on systems where
python headers are not installed (my earlier attempt stalled at
https://www.redhat.com/archives/libvir-list/2011-May/msg01223.html).

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/2] Make monitor timeout configurable

2011-06-27 Thread Eric Blake
On 06/22/2011 09:47 AM, Daniel P. Berrange wrote:
> This makes the monitor timeout limit configurable via
> the qemu.conf configuration file.
> 
> * src/conf/capabilities.h: Allow private data to be passed to
>   the virDomainObjPtr private allocation function
> * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
>   src/test/test_driver.c, src/uml/uml_driver.c,
>   src/vmware/vmware_driver.c: Update for API change in
>   capabilities
> * src/qemu/qemu.conf, src/qemu/test_libvirtd_qemu.aug,

Do we have any html documentation for conf files, or is the mention in
qemu.conf of the new option sufficient?

> +++ b/src/qemu/qemu.conf
> @@ -287,3 +287,15 @@
>  # this
>  #
>  # lock_manager = "fcntl"
> +
> +# To change the amount of time we wait for a reply
> +# from the QEMU monitor. QEMU monitor replies should
> +# be pretty quick (< 5 seconds), but if the host is
> +# seriously badly loaded this may take more time.

Double adverb 'seriously badly' doesn't sound very professional, but I
don't know that I have a better suggestion.

>  
> +p = virConfGetValue (conf, "monitor_timeout");
> +CHECK_TYPE ("monitor_timeout", VIR_CONF_LONG);
> +if (p) driver->monTimeout = p->l;

arbitrary user value...

> @@ -494,7 +495,7 @@ int qemuDomainObjBeginJob(virDomainObjPtr obj)
>  
>  if (virTimeMs(&now) < 0)
>  return -1;
> -then = now + QEMU_JOB_WAIT_TIME;
> +then = now + (priv->monTimeout * 1000ull);

which can then lead to integer overflow.  We should have some sanity
checking on the user's input.  Perhaps just cap things that if the
multiply would overflow, then just change driver->monTimeout to -1
(anyone with that large of a timeout won't be alive to wait around to
see that we stopped short of infinity :); as well as have code that
special cases -1 as a request to block rather than time out.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/2] Timeout QEMU monitor replies after 30 seconds

2011-06-27 Thread Eric Blake
On 06/22/2011 09:47 AM, Daniel P. Berrange wrote:
> If the QEMU process has been stopped (kill -STOP/gdb), or the
> QEMU process has live-locked itself, then we will never get a
> reply from the monitor. We should not wait forever in this
> case, but instead timeout after a reasonable amount of time.
> 
> NB if the host has high CPU load, or a single monitor command
> intentionally takes a long time, then this will cause bogus
> failures. In the case of high CPU load, arguably the guest
> should have been migrated elsewhere, since you can't effectively
> manage guests on a host if QEMU is taking > 30 seconds to reply
> to simply commands. Since we use background migration, there
> should not be any commands which take significant time to
> execute any more
> 
> * src/qemu/qemu_monitor.c: Timeout waiting for reply after 30 seconds
> ---
>  src/qemu/qemu_monitor.c |   21 ++---
>  1 files changed, 18 insertions(+), 3 deletions(-)

This didn't make it into RC1, so I'm now torn on whether it is important
enough to be in RC2 or whether it is enough of a feature to defer to
post-0.9.3.

ACK to the code, once we decide whether (when?) to apply it.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Confusing valgrind error in virDomainLookupByUUIDString or virReportErrorHelper

2011-06-27 Thread Richard W.M. Jones
libvirt-0.9.2-2.fc16.x86_64

Here's the error from valgrind:

==24953== Conditional jump or move depends on uninitialised value(s)
==24953==at 0x3DF68844BB: __GI___strcasecmp_l (strcmp.S:243)
==24953==by 0x3DF68221E1: __gconv_open (gconv_open.c:70)
==24953==by 0x3DF682F3E9: _nl_find_msg (dcigettext.c:974)
==24953==by 0x3DF682FB84: __dcigettext (dcigettext.c:640)
==24953==by 0x36BBE5A063: virReportErrorHelper (virterror.c:1215)
==24953==by 0x36BBEA3804: virDomainLookupByUUIDString (libvirt.c:2005)
==24953==by 0x4C9174C: guestfs__add_domain (virt.c:122)
==24953==by 0x4C4862B: guestfs_add_domain_argv (actions.c:2951)
==24953==by 0x42635A: add_libvirt_drives (virt.c:54)
==24953==by 0x4260D8: add_drives (options.c:69)
==24953==by 0x40B1F6: main (fish.c:422)

It appears to originate from this code:

  src/libvirt.c:virDomainLookupByUUIDString:

 if (virUUIDParse(uuidstr, uuid) < 0) {
2005 **  virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
 goto error;
 }

The macro at line 2005 expands to:

virReportErrorHelper(VIR_FROM_NONE, VIR_ERR_INVALID_ARG, __FILE__, \
 __FUNCTION__, __LINE__, __FUNCTION__);

Apparently __FUNCTION__ is deprecated[1].

When virReportErrorHelper is called, the problem appears to be at this
line (virterror.c:1215):

virerr = virErrorMsg(errcode, (errorMessage[0] ? errorMessage : NULL));

Here, errcode == VIR_ERR_INVALID_ARG and errorMessage is presumably
the function name.

That's as far as I've got for today.  Just letting people know ...

Rich.

[1] http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] FreeBSD Port, update to 0.9.2 compile error

2011-06-27 Thread Jason Helfman

Hi,
On Thu, Jun 09, 2011 at 08:55:01PM +0800, Daniel Veillard thus spake:

On Wed, Jun 08, 2011 at 07:44:43AM -0700, Jason Helfman wrote:

> On Tue, Jun 07, 2011 at 11:08:02PM -0700, Jason Helfman wrote:
>> I found the issue in building was an absolute path for apibuild.py for
>> python, that is incorrect on FreeBSD.
>
>  okay, where is it on FreeBSD ?

/usr/local/bin

>> Here is a patch:
>>
>> - --- ./docs/apibuild.py.orig  2011-06-07 21:31:43.0 -0700
>> +++ ./docs/apibuild.py 2011-06-07 21:31:55.0 -0700
>> @@ -1,4 +1,4 @@
>> - -#!/usr/bin/python -u
>> +#!/usr/bin/env python
>
>   I have seens people complaining loudly because env was used like this
> for example:
>
> http://forums.westhost.com/showthread.php?9984-usr-bin-env-python-doesn-t-work

I would argue that using /usr/bin/env is the correct way to handle this
and users that this breaks for haven't properly configured their
environment path for their binaries. Non-standard paths should be put in a
path so /usr/bin/env will work. /usr/bin and /usr/local/bin are very
standard, in my humble opinion.



 yes, I was doing the same, and people complained, left and right :-\


>   another way would be to launch python directly giving the path to the
> python script, this is likely to solve the issue there.


 That IMHO avoids the problem completely and I doubt anybody would
complain we should even be able to detect at configure and take specific
paths if people want to use a non-system python binary by extending

paphio:~/libvirt -> ./configure --help | grep python
 --with-python   Build python bindings [default=yes]

to take a path

Daniel



I was wondering if this issue was addressed in the upcoming release?

Thanks!
Jason

--
Jason Helfman
System Administrator
experts-exchange.com
http://www.experts-exchange.com/M_4830110.html
E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 3/3] Add documentation for the seclabel XML element

2011-06-27 Thread Eric Blake
On 06/27/2011 06:20 AM, Daniel P. Berrange wrote:
> The domain XML documentation is missing information about the
>  element used by security drivers
> 
> * formatdomain.html.in: Document 
> ---
>  docs/formatdomain.html.in |   76 
> +
>  1 files changed, 76 insertions(+), 0 deletions(-)

Oh, this covers part of my complaint in both 1/3 and 2/3.

If we decide to defer those patches until post-0.9.3, then there is
still a good chunk of this patch which should be applied now.

> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 3a64983..c1ea480 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -2614,6 +2614,82 @@ qemu-kvm -net nic,model=? /dev/null
>
>  
>  
> +Security label
> +
> +
> +  The seclabel element allows control over the
> +  operation of the security drivers. There are two basic
> +  modes of operation, dynamic where libvirt automatically
> +  generates a unique security label, or static where the
> +  application/administrator chooses the labels. With dynamic
> +  label generation, libvirt will always automatically
> +  relabel any resources associated with the virtual machine.
> +  With static label assignment, by default, the administrator
> +  or application must ensure labels are set correctly on any
> +  resources, however, automatic relabelling can be enabled

s/relabelling/relabeling/ if we are going to favor US spellings in
public-facing documentation

> +  if desired
> +
> +
> +
> +  Valid input XML configurations for the security label
> +  are:
> +
> +
> +
> +  
> +
> +  
> +system_u:system_r:my_svirt_t:s0
> +  

For example, up to here is useful to be applied now...

> +
> +  
> +
> +  

...while this depends on the rest of the series.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Zdenek Styblik
On 06/27/11 17:11, Laine Stump wrote:
> On 06/27/2011 07:30 AM, Matthias Bolte wrote:
>> 2011/6/27 Zdenek Styblik:
[...]
>>> ~~~ SNIP ~~~
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>>   CC libvirt_util_la-netlink.lo
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>>   CC libvirt_util_la-pci.lo
>>>   CC libvirt_util_la-processinfo.lo
>>>   CC libvirt_util_la-hostusb.lo
>>>   CC libvirt_util_la-network.lo
>>>   CC libvirt_util_la-interface.lo
>>>   CC libvirt_util_la-qparams.lo
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>> ~~~ SNIP ~~~
>> This is a known problem in libnl. This can be fixed in Slackware's
>> libnl package by removing the inline keyword from the declaration of
>> nl_object_priv in /usr/include/netlink/object.
> 
> What is the version of libnl used in Slackware? It seems that libnl is
> getting included on more platforms now, so we probably need to get more
> serious about making sure our code works with different versions of libnl.

libnl-1.1-x86_64-1

Z.

-- 
Zdenek Styblik
Net/Linux admin
OS TurnovFree.net
email: sty...@turnovfree.net
jabber: sty...@jabber.turnovfree.net

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 2/3] Allow for resource relabelling with static labels

2011-06-27 Thread Eric Blake
On 06/27/2011 06:20 AM, Daniel P. Berrange wrote:
> Add a new attribute to the  XML to allow resource
> relabelling to be enabled with static label usage.
> 
>   
> system_u:system_r:svirt_t:s0:c392,c662
>   
> 
> * docs/schemas/domain.rng: Add relabel attribute

Missing docs/formatdomain.html.in counterpart.

> +++ b/src/conf/domain_conf.c
> @@ -5072,6 +5072,30 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def,
>   "%s", _("invalid security type"));
>  goto error;
>  }
> +p = virXPathStringLimit("string(./seclabel/@relabel)",
> +VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
> +if (p != NULL) {
> +if (STREQ(p, "yes")) {
> +def->seclabel.relabel = true;
> +} else if (STREQ(p, "no")) {
> +def->seclabel.relabel = false;
> +} else {
> +virDomainReportError(VIR_ERR_XML_ERROR,
> + _("invalid security relabel value %s"), p);
> +goto error;
> +}
> +if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
> +!def->seclabel.relabel) {
> +virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> + "%s", _("dynamic label type must use 
> resource relabelling"));

s/relabelling/relabeling/ since user-visible messages should prefer US
spelling (double-l is UK spelling).  A proper en_UK locale .po file
would then get the UK spelling (do we have one of those?).

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/3] Allow a base label to be specified in dynamic labelling mode

2011-06-27 Thread Eric Blake
On 06/27/2011 06:20 AM, Daniel P. Berrange wrote:
> Normally the dynamic labelling mode will always use a base
> label of 'svirt_t' for VMs. Introduce a  field
> in the  XML to allow this base label to be changed
> 
> eg
> 
>
>  system_u:object_r:virt_t:s0
>
> 
> * docs/schemas/domain.rng: Add 
> * src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
>   of base label
> * src/qemu/qemu_process.c: Don't reset 'model' attribute if
>   a base label is specified
> * src/security/security_apparmor.c: Refuse to support base label
> * src/security/security_selinux.c: Use 'baselabel' when generating
>   label, if available

The code looks okay, but this missed the RC1 freeze.  Is this something
we need in 0.9.3 for a bug-fix, or should it wait until after the
release as a feature addition?

> ---
>  docs/schemas/domain.rng  |3 ++

Missing the counterpart to docs/formatdomain.html.in.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] build: rename Vcpupin to VcpuPin

2011-06-27 Thread Eric Blake
On 06/27/2011 09:44 AM, Daniel P. Berrange wrote:
> On Fri, Jun 24, 2011 at 05:16:33PM -0600, Eric Blake wrote:
>> We already have a public virDomainPinVcpu, which implies that
>> Pin and Vcpu are treated as separate words.  Commit e261987c
>> introduced virDomainGetVcpupinInfo as the first public API
>> that used Vcpupin, although we had prior internal uses of that
>> spelling.  For consistency, change the spelling to be two
>> words everywhere, regardless of whether pin comes first or last.
>>
>>
>> In response to 
>> http://www.redhat.com/archives/libvir-list/2011-June/msg01292.html
> 
> ACK

Pushed.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] nwfiler: Return error message about unresolvable variables

2011-06-27 Thread Eric Blake
On 06/27/2011 08:14 AM, Stefan Berger wrote:

s/nwfiler/nwfilter/ in the subject

> This is in response to bugzilla 664629
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=664629
> 
> The patch below returns an appropriate error message if the chain of
> nwfilters is found to contain unresolvable variables and therefore
> cannot be instantiated.
> 
> +
> +static void
> +_printString(void *payload ATTRIBUTE_UNUSED, const void *name, void *data)

I'm not a fan of leading underscore.  That shouldn't be necessary -
marking the function static is good enough without having to also munge
the name.  s/_printString/printString/g

> +/**
> + * virNWFilterPrintVars
> + *
> + * @var: hash table containing variables
> + * @separaptro: separator to use between variable names, i.e., ", "

s/separaptro/separator/

> +err_unresolvable_vars:
> +
> +buf = virNWFilterPrintVars(missing_vars->hashTable, ", ", false, false);
> +if (buf) {
> +virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
> +   _("Cannot instantiate filter due to unresolvable "
> + "variable%s: %s"),
> +   strstr(buf, ", ") ? "s" : "",

This is unfair to translators.  Appending 's' is not always the proper
way to create a plural.  Rather, you must use:

> +   buf);

virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
   strstr(buf, ", ") ?
 _("Cannot instantiate filter due to unresolvable variables: %s") :
 _("Cannot instantiate filter due to unresolvable variable: %s"),
   buf);

ACK with those changes.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Only include parthelper if built with storage_disk

2011-06-27 Thread Ruben Kerkhof
Hi Eric,

On Mon, Jun 27, 2011 at 16:51, Eric Blake  wrote:
> On 06/26/2011 03:39 AM, Ruben Kerkhof wrote:
>> Parthelper is only compiled if both --with-libvirtd
>> and --with-storage-disk are set.
>>
>> Signed-off-by: Ruben Kerkhof 
>> ---
>>  libvirt.spec.in |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/libvirt.spec.in b/libvirt.spec.in
>> index 11b8591..0111519 100644
>> --- a/libvirt.spec.in
>> +++ b/libvirt.spec.in
>> @@ -1016,7 +1016,10 @@ fi
>>  %attr(0755, root, root) %{_libexecdir}/libvirt_lxc
>>  %endif
>>
>> +%if %{with_storage_disk}
>>  %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
>> +%endif
>
> ACK and pushed.  I also updated AUTHORS; let me know if I need to adjust
> any spellings.

Wow, there's really no need, it's just two lines, but thanks!

Spelling is correct.

Kind regards,

Ruben

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] sysinfo: fix lack of error check in virSysinfoFormat().

2011-06-27 Thread Eric Blake
On 06/27/2011 04:12 AM, Daniel P. Berrange wrote:
> On Mon, Jun 27, 2011 at 04:40:56PM +0900, Minoru Usui wrote:
>> Fix lack of error check in virSysinfoFormat().
>>
>> Signed-off-by: Minoru Usui 
>> ---
>>  src/util/sysinfo.c |5 +
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
>> index 31ebdc2..bff1cb8 100644
>> --- a/src/util/sysinfo.c
>> +++ b/src/util/sysinfo.c
>> @@ -796,6 +796,11 @@ virSysinfoFormat(virSysinfoDefPtr def, const char 
>> *prefix)
>>  
>>  virBufferAsprintf(&buf, "%s\n", prefix);
>>  
>> +if (virBufferError(&buf)) {
>> +virReportOOMError();
>> +return NULL;
>> +}
>> +
>>  return virBufferContentAndReset(&buf);
>>  }
> 
> ACK

Pushed.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] build: rename Vcpupin to VcpuPin

2011-06-27 Thread Daniel P. Berrange
On Fri, Jun 24, 2011 at 05:16:33PM -0600, Eric Blake wrote:
> We already have a public virDomainPinVcpu, which implies that
> Pin and Vcpu are treated as separate words.  Commit e261987c
> introduced virDomainGetVcpupinInfo as the first public API
> that used Vcpupin, although we had prior internal uses of that
> spelling.  For consistency, change the spelling to be two
> words everywhere, regardless of whether pin comes first or last.
> 
> * daemon/remote.c: Treat vcpu and pin as separate words.
> * include/libvirt/libvirt.h.in: Likewise.
> * src/conf/domain_conf.c: Likewise.
> * src/conf/domain_conf.h: Likewise.
> * src/driver.h: Likewise.
> * src/libvirt.c: Likewise.
> * src/libvirt_private.syms: Likewise.
> * src/libvirt_public.syms: Likewise.
> * src/libxl/libxl_driver.c: Likewise.
> * src/qemu/qemu_driver.c: Likewise.
> * src/remote/remote_driver.c: Likewise.
> * src/xen/xend_internal.c: Likewise.
> * tools/virsh.c: Likewise.
> * src/remote/remote_protocol.x: Likewise.
> * src/remote_protocol-structs: Likewise.
> Suggested by Matthias Bolte.
> ---
> 
> In response to 
> http://www.redhat.com/archives/libvir-list/2011-June/msg01292.html

ACK

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 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] sysinfo: cleanup function/struct names.

2011-06-27 Thread Eric Blake
On 06/27/2011 04:12 AM, Daniel P. Berrange wrote:
> On Mon, Jun 27, 2011 at 04:39:34PM +0900, Minoru Usui wrote:
>> Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]
>>
>> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
>> index fab4f06..3ff834e 100644

This paragraph really threw off 'git am'.  I had to nuke it to get the
patch to apply (probably a spurious copy-and-paste).

>>
>> Signed-off-by: Minoru Usui 
>> ---
>>  src/util/sysinfo.c |   44 
>>  src/util/sysinfo.h |   16 
>>  2 files changed, 32 insertions(+), 28 deletions(-)
> 
> ACK

Pushed.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 0/7] Add support for setting QoS

2011-06-27 Thread Michal Privoznik
On 24.06.2011 20:00, Christian Benvenuti (benve) wrote:
>>> 3) Similarly for macvtap s, will the network-wide bandwidth
>>> limiting be applied to the physical ethernet device? This would
>>> have the side effect of including host traffic on that interface in
>>> the bandwidth totals, but I don't see a way around it.
>> With this patch as-is, shaping rules are applied only when creating
> TAP
>> devices. This mean only network types VIR_DOMAIN_NET_TYPE_NETWORK and
>> VIR_DOMAIN_NET_TYPE_BRIDGE.
>>>
>>> 4) Finally on that topic, what about s that have a pool of
>>> physical ethernets to be used macvtap-style? Is there any way we can
>>> do bandwidth limiting on an aggregated collection of network
> interfaces?
>>> Or
>>> will attempts to configure this necessarily result in a "config not
>>> supported" log message?
>> Huh, I didn't know it is possible to have a pool of devices within one
>> . So in this case, this patch silently does nothing.
> 
> The IFB (Intermediate Functional Block) allows you to
> configure aggregate QoS on multiple interfaces.
> 
> /Chris
> 
> 
Yes, but we would then need to create those IFB devices on the fly (e.g.
on domain startup) and I don't think there is other way than unloading
and then loading the ifb module (with different parameter) which however
would break other domains connections. Or am I missing something?

But I agree, using ifb would be much more beautiful, because we could
actually shape incoming traffic instead of dropping.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Eric Blake
On 06/27/2011 09:11 AM, Laine Stump wrote:
> On 06/27/2011 07:30 AM, Matthias Bolte wrote:
>> 2011/6/27 Zdenek Styblik:
>>> Reporting Slackware64-13.37:

>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>> /usr/include/netlink/object.h:58:23: warning: inline function
>>> 'nl_object_priv' declared but never defined
>>> ~~~ SNIP ~~~
>> This is a known problem in libnl. This can be fixed in Slackware's
>> libnl package by removing the inline keyword from the declaration of
>> nl_object_priv in /usr/include/netlink/object.
> 
> What is the version of libnl used in Slackware? It seems that libnl is
> getting included on more platforms now, so we probably need to get more
> serious about making sure our code works with different versions of libnl.

If it is anything like Ubuntu, then this (hacky) patch will work around
the problem in spite of the broken libnl headers.  It's just that I'm
reluctant to apply it because it is such a hack, but given the number of
distros with broken libnl installations, maybe we should do it after all.

From ec12ae6be618f77542e30017eb80cffadd95e4f2 Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Thu, 23 Jun 2011 16:30:15 -0600
Subject: [PATCH] work around libnl bug

---
 src/util/netlink.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/util/netlink.h b/src/util/netlink.h
index 6e915ff..de0e98b 100644
--- a/src/util/netlink.h
+++ b/src/util/netlink.h
@@ -24,7 +24,9 @@

 # if defined(__linux__) && defined(HAVE_LIBNL)

+#  define inline
 #  include 
+#  undef inline

 # else

-- 
1.7.4.4



-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Matthias Bolte
2011/6/27 Laine Stump :
> On 06/27/2011 07:32 AM, Matthias Bolte wrote:
>>
>> 2011/6/27 simon:
>>>
>>> 于 2011-6-27 13:01, Daniel Veillard 写道:
>>>
>>>   So we are entering the week freeze for the new version 0.9.3
>>> I have made an rc1 tarball available at:
>>>    ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
>>> along with rpms for those interested
>>> We pushed a lot of patches in the last few days, we know there is at
>>> least some cleanup issues, but I tried it locally and basic operations
>>> seems to work fine,
>>>
>>>   please give it a try too and report issues,
>>>
>>>    thanks !
>>>
>>> Daniel
>>>
>>> On fc14.x86_64
>>> TEST: networkxml2argvtest  FAIL
>>>
>>> Download  libvirt-0.9.3-rc1.tar.gz
>>>
>>> ./configure&&  make&&  make check
>>>
>>> It report 1 of 52 tests failed
>>>
>>> TEST: networkxml2argvtest
>>>       !.!                                  7   FAIL
>>> FAIL: networkxml2argvtest
>>
>> This a known problem when you configure libvirt with localstatedir
>> other than /var, what happens when you just run configure without
>> arguments.
>
> It looks like that's what he did, so maybe this is a different problem (or
> possibly his configure defaults to /usr/local/var?).
>
> If the default localstatedir isn't /var, try doing "./autogen.sh --system"
> instead of ./configure. If that doesn't cure the problem, try running the
> test with debug logging turned on to see exactly what error is reported:
>
>  LIBVIRT_LOG_OUTPUTS=3:stderr VIR_TEST_DEBUG=2 ./networkxml2argvtest
>

5 of 6 failing tests are fixed by this patch I just pushed:

  https://www.redhat.com/archives/libvir-list/2011-June/msg01358.html

The last one is related to the fact that
networkBuildDhcpDaemonCommandLine writes dnsmasq config files to disk
relative to DNSMASQ_STATE_DIR and DNSMASQ_STATE_DIR is configure
--localstatedir dependent.

You also noticed this in your review:

  https://www.redhat.com/archives/libvir-list/2011-June/msg01284.html

As Dan suggested on IRC this should be refactored and will then also
fix the last test failure.

 yeah this is bad code structure IMHO
 the call to networkSaveDnsmasqHostsfile() should be removed
from networkBuildDhcpDaemonCommandLine / networkBuildDnsmasqArgv
 whatever calls networkBuildDhcpDaemonCommandLine  should be
made responsible for actually creating the hosts file
 the networkBuildDnsmasqArgv method should solely create the
CLI args, and assume someone else has taken care of actualyl creating
the file on disk

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2] tests: Partly fix networkxml2argvtest being configure result dependent

2011-06-27 Thread Matthias Bolte
2011/6/27 Eric Blake :
> On 06/27/2011 09:08 AM, Matthias Bolte wrote:
>> Convert networkDnsmasqLeaseFileName to a replaceable function pointer
>> that allow the testsuite to use a version of that function that is not
>> depending on configure --localstatedir.
>>
>> This fixes 5 of 6 test failures, when configure --localstatedir isn't
>> set to /var.
>> ---
>>
>> The last failure is related to networkBuildDhcpDaemonCommandLine
>> trying to indirectly write dnsmasq config files to disk. This needs
>> a larger rewrite to separate the config file writing out of
>> networkBuildDhcpDaemonCommandLine.
>
> Incremental progress is better than none, so:
>
> ACK.
>

Thanks, pushed.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Remove bogus error codes for NUMA memory tuning

2011-06-27 Thread Osier Yang

于 2011年06月27日 18:18, Daniel P. Berrange 写道:

On Mon, Jun 27, 2011 at 02:49:35PM +0800, Osier Yang wrote:

This is no code between virSaveLastError and virGetLastError will
set an error, remove the bogus codes.
---
  src/qemu/qemu_process.c |   33 -
  1 files changed, 0 insertions(+), 33 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index bb83be0..6c2492a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1251,8 +1251,6 @@ static int
  qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)
  {
  nodemask_t mask;
-virErrorPtr orig_err = NULL;
-virErrorPtr err = NULL;
  int mode = -1;
  int node = -1;
  int ret = -1;
@@ -1291,23 +1289,12 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)
  }
  }

-orig_err = virSaveLastError();
  mode = vm->def->numatune.memory.mode;

  if (mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
  numa_set_bind_policy(1);
  numa_set_membind(&mask);
  numa_set_bind_policy(0);
-
-err = virGetLastError();
-if ((err&&  (err->code != orig_err->code)) ||
-(err&&  !orig_err)) {
-qemuReportError(VIR_ERR_INTERNAL_ERROR,
-_("Failed to bind memory to specified nodeset: 
%s"),
-err ? err->message : _("unknown error"));
-virResetLastError();
-goto cleanup;
-}
  } else if (mode == VIR_DOMAIN_NUMATUNE_MEM_PREFERRED) {
  int nnodes = 0;
  for (i = 0; i<  NUMA_NUM_NODES; i++) {
@@ -1326,28 +1313,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)

  numa_set_bind_policy(0);
  numa_set_preferred(node);
-
-err = virGetLastError();
-if ((err&&  (err->code != orig_err->code)) ||
-(err&&  !orig_err)) {
-qemuReportError(VIR_ERR_INTERNAL_ERROR,
-_("Failed to set memory policy as preferred to 
specified "
-  "node: %s"), err ? err->message : _("unknown 
error"));
-virResetLastError();
-goto cleanup;
-}
  } else if (mode == VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE) {
  numa_set_interleave_mask(&mask);
-
-err = virGetLastError();
-if ((err&&  (err->code != orig_err->code)) ||
-(err&&  !orig_err)) {
-qemuReportError(VIR_ERR_INTERNAL_ERROR,
-_("Failed to interleave memory to specified nodeset: 
%s"),
-err ? err->message : _("unknown error"));
-virResetLastError();
-goto cleanup;
-}
  } else {
  /* XXX: Shouldn't go here, as we already do checking when
   * parsing domain XML.


ACK

Daniel


Thanks, applied

Regards
Osier

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2] tests: Partly fix networkxml2argvtest being configure result dependent

2011-06-27 Thread Eric Blake
On 06/27/2011 09:08 AM, Matthias Bolte wrote:
> Convert networkDnsmasqLeaseFileName to a replaceable function pointer
> that allow the testsuite to use a version of that function that is not
> depending on configure --localstatedir.
> 
> This fixes 5 of 6 test failures, when configure --localstatedir isn't
> set to /var.
> ---
> 
> The last failure is related to networkBuildDhcpDaemonCommandLine
> trying to indirectly write dnsmasq config files to disk. This needs
> a larger rewrite to separate the config file writing out of
> networkBuildDhcpDaemonCommandLine.

Incremental progress is better than none, so:

ACK.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Laine Stump

On 06/27/2011 07:32 AM, Matthias Bolte wrote:

2011/6/27 simon:

于 2011-6-27 13:01, Daniel Veillard 写道:

   So we are entering the week freeze for the new version 0.9.3
I have made an rc1 tarball available at:
ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
along with rpms for those interested
We pushed a lot of patches in the last few days, we know there is at
least some cleanup issues, but I tried it locally and basic operations
seems to work fine,

   please give it a try too and report issues,

thanks !

Daniel

On fc14.x86_64
TEST: networkxml2argvtest  FAIL

Download  libvirt-0.9.3-rc1.tar.gz

./configure&&  make&&  make check

It report 1 of 52 tests failed

TEST: networkxml2argvtest
   !.!  7   FAIL
FAIL: networkxml2argvtest

This a known problem when you configure libvirt with localstatedir
other than /var, what happens when you just run configure without
arguments.


It looks like that's what he did, so maybe this is a different problem 
(or possibly his configure defaults to /usr/local/var?).


If the default localstatedir isn't /var, try doing "./autogen.sh 
--system" instead of ./configure. If that doesn't cure the problem, try 
running the test with debug logging turned on to see exactly what error 
is reported:


  LIBVIRT_LOG_OUTPUTS=3:stderr VIR_TEST_DEBUG=2 ./networkxml2argvtest

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Laine Stump

On 06/27/2011 07:30 AM, Matthias Bolte wrote:

2011/6/27 Zdenek Styblik:

Reporting Slackware64-13.37:
- ---

compilation OK.

~~~ SNIP ~~~
./configure \
--prefix=/usr/ \
--sysconfdir=/etc/ \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man/ \
--localstatedir=/var/ \
--enable-shared \
--enable-dependency-tracking \
--without-lxc \
--with-network \
--with-qemu \
--with-remote \
--with-sasl \
--with-storage-disk \
--with-storage-lvm \
--with-storage-scsi \
--with-libvirtd \
~~~ SNIP ~~~

~~~ SNIP ~~~
/usr/include/netlink/object.h:58:23: warning: inline function
'nl_object_priv' declared but never defined
/usr/include/netlink/object.h:58:23: warning: inline function
'nl_object_priv' declared but never defined
  CC libvirt_util_la-netlink.lo
/usr/include/netlink/object.h:58:23: warning: inline function
'nl_object_priv' declared but never defined
/usr/include/netlink/object.h:58:23: warning: inline function
'nl_object_priv' declared but never defined
  CC libvirt_util_la-pci.lo
  CC libvirt_util_la-processinfo.lo
  CC libvirt_util_la-hostusb.lo
  CC libvirt_util_la-network.lo
  CC libvirt_util_la-interface.lo
  CC libvirt_util_la-qparams.lo
/usr/include/netlink/object.h:58:23: warning: inline function
'nl_object_priv' declared but never defined
/usr/include/netlink/object.h:58:23: warning: inline function
'nl_object_priv' declared but never defined
~~~ SNIP ~~~

This is a known problem in libnl. This can be fixed in Slackware's
libnl package by removing the inline keyword from the declaration of
nl_object_priv in /usr/include/netlink/object.


What is the version of libnl used in Slackware? It seems that libnl is 
getting included on more platforms now, so we probably need to get more 
serious about making sure our code works with different versions of libnl.


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v2] tests: Partly fix networkxml2argvtest being configure result dependent

2011-06-27 Thread Matthias Bolte
Convert networkDnsmasqLeaseFileName to a replaceable function pointer
that allow the testsuite to use a version of that function that is not
depending on configure --localstatedir.

This fixes 5 of 6 test failures, when configure --localstatedir isn't
set to /var.
---

The last failure is related to networkBuildDhcpDaemonCommandLine
trying to indirectly write dnsmasq config files to disk. This needs
a larger rewrite to separate the config file writing out of
networkBuildDhcpDaemonCommandLine.

 src/network/bridge_driver.c |5 -
 src/network/bridge_driver.h |5 +
 tests/networkxml2argvtest.c |   13 +
 3 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 1b11132..d009627 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -108,7 +108,7 @@ static void networkReloadIptablesRules(struct 
network_driver *driver);
 static struct network_driver *driverState = NULL;
 
 static char *
-networkDnsmasqLeaseFileName(const char *netname)
+networkDnsmasqLeaseFileNameDefault(const char *netname)
 {
 char *leasefile;
 
@@ -117,6 +117,9 @@ networkDnsmasqLeaseFileName(const char *netname)
 return leasefile;
 }
 
+networkDnsmasqLeaseFileNameFunc networkDnsmasqLeaseFileName =
+networkDnsmasqLeaseFileNameDefault;
+
 static char *
 networkRadvdPidfileBasename(const char *netname)
 {
diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h
index 8d82b67..a106e3d 100644
--- a/src/network/bridge_driver.h
+++ b/src/network/bridge_driver.h
@@ -34,4 +34,9 @@
 int networkRegister(void);
 int networkBuildDhcpDaemonCommandLine(virNetworkObjPtr network, virCommandPtr 
*cmdout, char *pidfile);
 
+typedef char *(*networkDnsmasqLeaseFileNameFunc)(const char *netname);
+
+/* this allows the testsuite to replace the lease filename resolver function */
+extern networkDnsmasqLeaseFileNameFunc networkDnsmasqLeaseFileName;
+
 #endif /* __VIR_NETWORK__DRIVER_H */
diff --git a/tests/networkxml2argvtest.c b/tests/networkxml2argvtest.c
index 16d57a9..62de191 100644
--- a/tests/networkxml2argvtest.c
+++ b/tests/networkxml2argvtest.c
@@ -85,11 +85,24 @@ cleanup:
 return result;
 }
 
+static char *
+testDnsmasqLeaseFileName(const char *netname)
+{
+char *leasefile;
+
+virAsprintf(&leasefile, "/var/lib/libvirt/dnsmasq/%s.leases",
+netname);
+
+return leasefile;
+}
+
 static int
 mymain(void)
 {
 int ret = 0;
 
+networkDnsmasqLeaseFileName = testDnsmasqLeaseFileName;
+
 #define DO_TEST(name) \
 if (virtTestRun("Network XML-2-Argv " name, \
 1, testCompareXMLToArgvHelper, (name)) < 0) \
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] network: fix indentation in networkBuildDnsmasqArgv

2011-06-27 Thread Laine Stump

On 06/27/2011 09:29 AM, Eric Blake wrote:

On 06/24/2011 11:33 PM, Laine Stump wrote:

This block was inadvertently added with the wrong indentation.
---
  src/network/bridge_driver.c |   15 +++
  1 files changed, 7 insertions(+), 8 deletions(-)

ACK.


Pushed, since this changes only whitespace, and could be seen as a 
"readability bug" :-) (It actually caused me confusion for a minute when 
I first ran across it)


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] sysinfo: delete unnecessary white space of sysinfo.

2011-06-27 Thread Eric Blake
On 06/27/2011 04:13 AM, Daniel P. Berrange wrote:
> On Mon, Jun 27, 2011 at 05:25:17PM +0900, Minoru Usui wrote:
>> sysinfo: delete unnecessary white space of sysinfo.
>>
>>   * Add virSkipSpacesBackwards() to src/util/util.[ch]
>>   * Trim each element and delete null entry of sysinfo by 
>> virSkipSpacesBackwards().
>>
>> Signed-off-by: Minoru Usui 
>> ---
>>  src/util/sysinfo.c |   34 +-
>>  src/util/util.c|   27 +++
>>  src/util/util.h|1 +
>>  3 files changed, 53 insertions(+), 9 deletions(-)
>> +void
>> +virSkipSpacesBackwards(const char *str, char **endp)
>> +{
>> +char *cur;
>> +
>> +if (!endp || !*endp)
>> +return;
>> +
>> +cur = *endp - 1;
>> +while (cur >= str) {
>> +if ((*cur == ' ') || (*cur == '\t') || (*cur == '\n') ||
>> +(*cur == '\r') || (*cur == '\\'))

Maybe we should use c_isspace() instead of open-coding this.  And how is
backslash a space?

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Only include parthelper if built with storage_disk

2011-06-27 Thread Eric Blake
On 06/26/2011 03:39 AM, Ruben Kerkhof wrote:
> Parthelper is only compiled if both --with-libvirtd
> and --with-storage-disk are set.
> 
> Signed-off-by: Ruben Kerkhof 
> ---
>  libvirt.spec.in |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index 11b8591..0111519 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -1016,7 +1016,10 @@ fi
>  %attr(0755, root, root) %{_libexecdir}/libvirt_lxc
>  %endif
>  
> +%if %{with_storage_disk}
>  %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
> +%endif

ACK and pushed.  I also updated AUTHORS; let me know if I need to adjust
any spellings.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 4/4] Cleanup remote protocol definitions

2011-06-27 Thread Daniel P. Berrange
The standard remote protocol for libvirtd no longer needs to
include definitions of the generic message header/error structs
or status codes. This is all defined in the generic RPC protocol

* src/remote/remote_protocol.x: Remove all RPC message definitions
* src/remote/remote_protocol.h, src/remote/remote_protocol.c:
  Re-generate
* daemon/remote_generate_stubs.pl: Delete obsolete script
---
 src/remote/remote_protocol.x |  115 --
 1 files changed, 0 insertions(+), 115 deletions(-)

diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index ee08b82..342f392 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -60,15 +60,6 @@
 
 /*- Data types. -*/
 
-/* Maximum total message size (serialised). */
-const REMOTE_MESSAGE_MAX = 262144;
-
-/* Size of struct remote_message_header (serialized)*/
-const REMOTE_MESSAGE_HEADER_MAX = 24;
-
-/* Size of message payload */
-const REMOTE_MESSAGE_PAYLOAD_MAX = 262120;
-
 /* Length of long, but not unbounded, strings.
  * This is an arbitrary limit designed to stop the decoder from trying
  * to allocate unbounded amounts of memory when fed with a bad message.
@@ -2409,109 +2400,3 @@ enum remote_procedure {
  *  specifies at which offset the stream parameter is inserted
  * in the function parameter list. */
 };
-
-/*
- * RPC wire format
- *
- * Each message consists of:
- *
- *Name| Type  | Description
- * ---+---+--
- *Length  | int   | Total number of bytes in message 
_including_ length.
- *Header  | remote_message_header | Control information about procedure 
call
- *Payload | - | Variable payload data per procedure
- *
- * In header, the 'serial' field varies according to:
- *
- *  - type == REMOTE_CALL
- *  * serial is set by client, incrementing by 1 each time
- *
- *  - type == REMOTE_REPLY
- *  * serial matches that from the corresponding REMOTE_CALL
- *
- *  - type == REMOTE_MESSAGE
- *  * serial is always zero
- *
- *  - type == REMOTE_STREAM
- *  * serial matches that from the corresponding REMOTE_CALL
- *
- * and the 'status' field varies according to:
- *
- *  - type == REMOTE_CALL
- * * REMOTE_OK always
- *
- *  - type == REMOTE_REPLY
- * * REMOTE_OK if RPC finished successfully
- * * REMOTE_ERROR if something failed
- *
- *  - type == REMOTE_MESSAGE
- * * REMOTE_OK always
- *
- *  - type == REMOTE_STREAM
- * * REMOTE_CONTINUE if more data is following
- * * REMOTE_OK if stream is complete
- * * REMOTE_ERROR if stream had an error
- *
- * Payload varies according to type and status:
- *
- *  - type == REMOTE_CALL
- *  XXX_args  for procedure
- *
- *  - type == REMOTE_REPLY
- * * status == REMOTE_OK
- *  XXX_ret for procedure
- * * status == REMOTE_ERROR
- *  remote_errorError information
- *
- *  - type == REMOTE_MESSAGE
- * * status == REMOTE_OK
- *  XXX_argsfor procedure
- * * status == REMOTE_ERROR
- *  remote_errorError information
- *
- *  - type == REMOTE_STREAM
- * * status == REMOTE_CONTINUE
- *  byte[]   raw stream data
- * * status == REMOTE_ERROR
- *  remote_error error information
- * * status == REMOTE_OK
- *  
- */
-enum remote_message_type {
-/* client -> server. args from a method call */
-REMOTE_CALL = 0,
-/* server -> client. reply/error from a method call */
-REMOTE_REPLY = 1,
-/* either direction. async notification */
-REMOTE_MESSAGE = 2,
-/* either direction. stream data packet */
-REMOTE_STREAM = 3
-};
-
-enum remote_message_status {
-/* Status is always REMOTE_OK for calls.
- * For replies, indicates no error.
- */
-REMOTE_OK = 0,
-
-/* For replies, indicates that an error happened, and a struct
- * remote_error follows.
- */
-REMOTE_ERROR = 1,
-
-/* For streams, indicates that more data is still expected
- */
-REMOTE_CONTINUE = 2
-};
-
-/* 4 byte length word per header */
-const REMOTE_MESSAGE_HEADER_XDR_LEN = 4;
-
-struct remote_message_header {
-unsigned prog;  /* REMOTE_PROGRAM */
-unsigned vers;  /* REMOTE_PROTOCOL_VERSION */
-int proc;  /* REMOTE_PROC_x */
-remote_message_type type;
-unsigned serial;/* Serial number of message. */
-remote_message_status status;
-};
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 3/4] Remove obsolete libvirtd mdns code

2011-06-27 Thread Daniel P. Berrange
libvirtd now uses the generic RPC code for MDNS, so its
custom mdns APIs are no longer required

* daemon/mdns.c, daemon/mdns.h: Removed obsolete files
---
 daemon/mdns.c |  508 -
 daemon/mdns.h |   96 ---
 2 files changed, 0 insertions(+), 604 deletions(-)
 delete mode 100644 daemon/mdns.c
 delete mode 100644 daemon/mdns.h

diff --git a/daemon/mdns.c b/daemon/mdns.c
deleted file mode 100644
index ca4a433..000
--- a/daemon/mdns.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * mdns.c: advertise libvirt hypervisor connections
- *
- * Copyright (C) 2007 Daniel P. Berrange
- *
- * Derived from Avahi example service provider code.
- *
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- *
- * Author: Daniel P. Berrange 
- */
-
-#include 
-
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "libvirtd.h"
-#include "mdns.h"
-#include "event_poll.h"
-#include "memory.h"
-
-#define AVAHI_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)
-
-struct libvirtd_mdns_entry {
-char *type;
-int port;
-struct libvirtd_mdns_entry *next;
-};
-
-struct libvirtd_mdns_group {
-struct libvirtd_mdns *mdns;
-AvahiEntryGroup *handle;
-char *name;
-struct libvirtd_mdns_entry *entry;
-struct libvirtd_mdns_group *next;
-};
-
-struct libvirtd_mdns {
-AvahiClient *client;
-AvahiPoll *poller;
-struct libvirtd_mdns_group *group;
-};
-
-/* Avahi API requires this struct names in the app :-( */
-struct AvahiWatch {
-int watch;
-int fd;
-int revents;
-AvahiWatchCallback callback;
-void *userdata;
-};
-
-/* Avahi API requires this struct names in the app :-( */
-struct AvahiTimeout {
-int timer;
-AvahiTimeoutCallback callback;
-void  *userdata;
-};
-
-
-static void libvirtd_mdns_create_services(struct libvirtd_mdns_group *group);
-
-/* Called whenever the entry group state changes */
-static void libvirtd_mdns_group_callback(AvahiEntryGroup *g ATTRIBUTE_UNUSED, 
AvahiEntryGroupState state, void *userdata) {
-struct libvirtd_mdns_group *group = (struct libvirtd_mdns_group *)userdata;
-
-switch (state) {
-case AVAHI_ENTRY_GROUP_ESTABLISHED:
-/* The entry group has been established successfully */
-AVAHI_DEBUG("Group '%s' established", group->name);
-break;
-
-case AVAHI_ENTRY_GROUP_COLLISION:
-{
-char *n;
-
-/* A service name collision happened. Let's pick a new name */
-n = avahi_alternative_service_name(group->name);
-VIR_FREE(group->name);
-group->name = n;
-
-AVAHI_DEBUG("Group name collision, renaming service to '%s'", 
group->name);
-
-/* And recreate the services */
-libvirtd_mdns_create_services(group);
-}
-break;
-
-case AVAHI_ENTRY_GROUP_FAILURE :
-AVAHI_DEBUG("Group failure: %s", 
avahi_strerror(avahi_client_errno(group->mdns->client)));
-
-/* Some kind of failure happened while we were registering our 
services */
-//avahi_simple_poll_quit(simple_poll);
-break;
-
-case AVAHI_ENTRY_GROUP_UNCOMMITED:
-case AVAHI_ENTRY_GROUP_REGISTERING:
-;
-}
-}
-
-static void libvirtd_mdns_create_services(struct libvirtd_mdns_group *group) {
-struct libvirtd_mdns *mdns = group->mdns;
-struct libvirtd_mdns_entry *entry;
-int ret;
-AVAHI_DEBUG("Adding services to '%s'", group->name);
-
-/* If we've no services to advertise, just reset the group to make
- * sure it is emptied of any previously advertised services */
-if (!group->entry) {
-if (group->handle)
-avahi_entry_group_reset(group->handle);
-return;
-}
-
-/* If this is the first time we're called, let's create a new entry group 
*/
-if (!group->handle) {
-AVAHI_DEBUG("Creating initial group %s", group->name);
-if (!(group->handle = avahi_entry_group_new(mdns->client, 
libvirtd_mdns_group_callback, group))) {
-AVAHI_DEBUG("avahi_entry_group_new() failed: %s", 
avahi_strerror(avahi_client_errno(mdns->client)));
-return;
-}
-}
-
-entry = group->entry;
-while (entry) {
-if

[libvirt] [PATCH 0/4] Switch over to use the new RPC code

2011-06-27 Thread Daniel P. Berrange
This patch set actually switches the libvirtd daemon and remote
driver client code to use the new RPC code.

While it has had a fair amount of testing, it has also been
rebased many many many times. There are bound to be things in
it which break, hopefully not the actual RPC wire data format,
but in the client/daemon dispatch code and thread safety, etc


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] tests: Handle networkxml2argvtest being configure --localstatedir dependant

2011-06-27 Thread Matthias Bolte
2011/6/27 Eric Blake :
> On 06/25/2011 10:10 AM, Matthias Bolte wrote:
>> 2011/6/25 Eric Blake :
>>> On 06/25/2011 06:41 AM, Matthias Bolte wrote:
 networkxml2argvtest indirectly calls networkDnsmasqLeaseFileName
 that depends on configure --localstatedir. Therefore, the .argv
 files used in the test have to be created with this localstatedir.

 Move the .argv to .argv.in files with a @localstatedir@ placeholder.
>>>
>>> Will this work in VPATH builds?  Previously, we have done hacks where
>>> the test directory can provide an override string; if the override is
>>> NULL (the default, for use in libvirtd), then use @localstatedir@, but
>>> if the override is provided (from the test case), then use that instead.
>>
>> Where are we doing that in libvirtd, I can't find something like that.
>>
>> Also how would you do that in general? Environment variable?
>> LD_PRELOAD to replace networkDnsmasqLeaseFileName for testing
>> (assuming that LD_PRELOAD works in this case)?
>
> Function override.  See for example how openvz_conf.h declares
> openvzLocateConfFile, which is normally set to
> openvzLocateConfFileDefault and uses configure arguments to determine
> the string to create, but within tests/openvzutilstest, is overridden to
> a test-only variant that hard-codes the location to instead be relative
> to the test directory.
>
> That is, the networkDnsmasqLeaseFileName function can easily be reworked
> into a function pointer, with the current definition being installed by
> default, but with an alternate function pointer installed during the
> test that avoids any reference to configure arguments.

Oh, true. I did the openvzLocateConfFileDefault approach :)

I'll fix it that way.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] nwfiler: Return error message about unresolvable variables

2011-06-27 Thread Stefan Berger
This is in response to bugzilla 664629

https://bugzilla.redhat.com/show_bug.cgi?id=664629

The patch below returns an appropriate error message if the chain of
nwfilters is found to contain unresolvable variables and therefore
cannot be instantiated.


Example: The following XMl added to a domain:


  
  
  
  


that references the following filter


  
  


now displays upon 'virsh start mydomain'

error: Failed to start domain mydomain
error: internal error Cannot instantiate filter due to unresolvable variable: 
DHCPSERVER

'DHPCSERVER' is contained in allow-dhcp-server.

Signed-off-by: Stefan Berger 

---
 src/nwfilter/nwfilter_gentech_driver.c |   84 +++--
 1 file changed, 80 insertions(+), 4 deletions(-)

Index: libvirt-acl/src/nwfilter/nwfilter_gentech_driver.c
===
--- libvirt-acl.orig/src/nwfilter/nwfilter_gentech_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_gentech_driver.c
@@ -200,6 +200,68 @@ virNWFilterCreateVarHashmap(char *macadd
 
 
 /**
+ * Convert a virNWFilterHashTable into a string of comma-separated
+ * variable names.
+ */
+struct printString
+{
+ virBuffer buf;
+ const char *separator;
+ bool reportMAC;
+ bool reportIP;
+};
+
+
+static void
+_printString(void *payload ATTRIBUTE_UNUSED, const void *name, void *data)
+{
+struct printString *ps = data;
+
+if ((STREQ((char *)name, NWFILTER_STD_VAR_IP ) && !ps->reportIP ) ||
+(STREQ((char *)name, NWFILTER_STD_VAR_MAC) && !ps->reportMAC))
+return;
+
+if (virBufferUse(&ps->buf) && ps->separator)
+virBufferAdd(&ps->buf, ps->separator, -1);
+
+virBufferAdd(&ps->buf, name, -1);
+}
+
+/**
+ * virNWFilterPrintVars
+ *
+ * @var: hash table containing variables
+ * @separaptro: separator to use between variable names, i.e., ", "
+ * @reportMAC: whether to report the 'MAC' variable
+ * @reportIP : whether to report the IP variable
+ *
+ * Returns a string of comma separated variable names
+ */
+static char *
+virNWFilterPrintVars(virHashTablePtr vars,
+ const char *separator,
+ bool reportMAC,
+ bool reportIP)
+{
+ struct printString ps = {
+ .buf   = VIR_BUFFER_INITIALIZER,
+ .separator = separator,
+ .reportMAC = reportMAC,
+ .reportIP  = reportIP,
+ };
+
+ virHashForEach(vars, _printString, &ps);
+
+ if (virBufferError(&ps.buf)) {
+ virBufferFreeAndReset(&ps.buf);
+ virReportOOMError();
+ return NULL;
+ }
+ return virBufferContentAndReset(&ps.buf);
+}
+
+
+/**
  * virNWFilterRuleInstantiate:
  * @conn: pointer to virConnect object
  * @techdriver: the driver to use for instantiation
@@ -575,6 +637,7 @@ virNWFilterInstantiate(virConnectPtr con
 virNWFilterRuleInstPtr *insts = NULL;
 void **ptrs = NULL;
 int instantiate = 1;
+char *buf;
 
 virNWFilterHashTablePtr missing_vars = virNWFilterHashTableCreate(0);
 if (!missing_vars) {
@@ -607,11 +670,9 @@ virNWFilterInstantiate(virConnectPtr con
 }
 goto err_exit;
 }
-rc = 1;
-goto err_exit;
+goto err_unresolvable_vars;
 } else if (virHashSize(missing_vars->hashTable) > 1) {
-rc = 1;
-goto err_exit;
+goto err_unresolvable_vars;
 } else if (!forceWithPendingReq &&
virNWFilterLookupLearnReq(ifindex) != NULL) {
 goto err_exit;
@@ -674,6 +735,21 @@ err_exit:
 virNWFilterHashTableFree(missing_vars);
 
 return rc;
+
+err_unresolvable_vars:
+
+buf = virNWFilterPrintVars(missing_vars->hashTable, ", ", false, false);
+if (buf) {
+virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
+   _("Cannot instantiate filter due to unresolvable "
+ "variable%s: %s"),
+   strstr(buf, ", ") ? "s" : "",
+   buf);
+VIR_FREE(buf);
+}
+
+rc = 1;
+goto err_exit;
 }
 
 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] tests: Handle networkxml2argvtest being configure --localstatedir dependant

2011-06-27 Thread Eric Blake
On 06/25/2011 10:10 AM, Matthias Bolte wrote:
> 2011/6/25 Eric Blake :
>> On 06/25/2011 06:41 AM, Matthias Bolte wrote:
>>> networkxml2argvtest indirectly calls networkDnsmasqLeaseFileName
>>> that depends on configure --localstatedir. Therefore, the .argv
>>> files used in the test have to be created with this localstatedir.
>>>
>>> Move the .argv to .argv.in files with a @localstatedir@ placeholder.
>>
>> Will this work in VPATH builds?  Previously, we have done hacks where
>> the test directory can provide an override string; if the override is
>> NULL (the default, for use in libvirtd), then use @localstatedir@, but
>> if the override is provided (from the test case), then use that instead.
> 
> Where are we doing that in libvirtd, I can't find something like that.
> 
> Also how would you do that in general? Environment variable?
> LD_PRELOAD to replace networkDnsmasqLeaseFileName for testing
> (assuming that LD_PRELOAD works in this case)?

Function override.  See for example how openvz_conf.h declares
openvzLocateConfFile, which is normally set to
openvzLocateConfFileDefault and uses configure arguments to determine
the string to create, but within tests/openvzutilstest, is overridden to
a test-only variant that hard-codes the location to instead be relative
to the test directory.

That is, the networkDnsmasqLeaseFileName function can easily be reworked
into a function pointer, with the current definition being installed by
default, but with an alternate function pointer installed during the
test that avoids any reference to configure arguments.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] network: fix indentation in networkBuildDnsmasqArgv

2011-06-27 Thread Eric Blake
On 06/24/2011 11:33 PM, Laine Stump wrote:
> This block was inadvertently added with the wrong indentation.
> ---
>  src/network/bridge_driver.c |   15 +++
>  1 files changed, 7 insertions(+), 8 deletions(-)

ACK.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 2/3] Allow for resource relabelling with static labels

2011-06-27 Thread Daniel P. Berrange
Add a new attribute to the  XML to allow resource
relabelling to be enabled with static label usage.

  
system_u:system_r:svirt_t:s0:c392,c662
  

* docs/schemas/domain.rng: Add relabel attribute
* src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
  the 'relabel' attribute
* src/qemu/qemu_process.c: Unconditionally clear out the
  'imagelabel' attribute
* src/security/security_apparmor.c: Skip based on 'relabel'
  attribute instead of label type
* src/security/security_selinux.c: Skip based on 'relabel'
  attribute instead of label type and fill in 
  attribute if relabel is enabled.
---
 docs/schemas/domain.rng  |6 ++
 src/conf/domain_conf.c   |   41 --
 src/conf/domain_conf.h   |3 +-
 src/qemu/qemu_process.c  |2 +-
 src/security/security_apparmor.c |   10 +-
 src/security/security_selinux.c  |  160 --
 6 files changed, 149 insertions(+), 73 deletions(-)

diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index ab5a56b..fb1497b 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -61,6 +61,12 @@
   static
 
   
+  
+
+  yes
+  no
+
+  
   
 
   
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cc318da..dc24d71 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5072,6 +5072,30 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def,
  "%s", _("invalid security type"));
 goto error;
 }
+p = virXPathStringLimit("string(./seclabel/@relabel)",
+VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
+if (p != NULL) {
+if (STREQ(p, "yes")) {
+def->seclabel.relabel = true;
+} else if (STREQ(p, "no")) {
+def->seclabel.relabel = false;
+} else {
+virDomainReportError(VIR_ERR_XML_ERROR,
+ _("invalid security relabel value %s"), p);
+goto error;
+}
+if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
+!def->seclabel.relabel) {
+virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("dynamic label type must use resource 
relabelling"));
+goto error;
+}
+} else {
+if (def->seclabel.type == VIR_DOMAIN_SECLABEL_STATIC)
+def->seclabel.relabel = false;
+else
+def->seclabel.relabel = true;
+}
 
 /* Only parse label, if using static labels, or
  * if the 'live' VM XML is requested
@@ -5089,8 +5113,8 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def,
 def->seclabel.label = p;
 }
 
-/* Only parse imagelabel, if requested live XML for dynamic label */
-if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
+/* Only parse imagelabel, if requested live XML with relabelling */
+if (def->seclabel.relabel &&
 !(flags & VIR_DOMAIN_XML_INACTIVE)) {
 p = virXPathStringLimit("string(./seclabel/imagelabel[1])",
 VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
@@ -9864,16 +9888,17 @@ char *virDomainDefFormat(virDomainDefPtr def,
 if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
 !def->seclabel.baselabel &&
 (flags & VIR_DOMAIN_XML_INACTIVE)) {
-virBufferAsprintf(&buf, "  \n",
-  sectype, def->seclabel.model);
+virBufferAsprintf(&buf, "  \n",
+  sectype, def->seclabel.model,
+  def->seclabel.relabel ? "yes" : "no");
 } else {
-virBufferAsprintf(&buf, "  \n",
-  sectype, def->seclabel.model);
+virBufferAsprintf(&buf, "  \n",
+  sectype, def->seclabel.model,
+  def->seclabel.relabel ? "yes" : "no");
 if (def->seclabel.label)
 virBufferEscapeString(&buf, "%s\n",
   def->seclabel.label);
-if (def->seclabel.imagelabel &&
-(def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC))
+if (def->seclabel.relabel && def->seclabel.imagelabel)
 virBufferEscapeString(&buf, "
%s\n",
   def->seclabel.imagelabel);
 if (def->seclabel.baselabel &&
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 17c2584..926f4a9 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -959,7 +959,8 @@ struct _virSecurityLabelDef {
 char *label;/* security label string */
 char *imagelabel;   /* security image label string */
 char *baselabel;/* base name of label string */
-int type;
+int type;   /* virDomainSeclabelType */
+bool relabel;
 };
 
 enum virDomainT

[libvirt] [PATCH 3/3] Add documentation for the seclabel XML element

2011-06-27 Thread Daniel P. Berrange
The domain XML documentation is missing information about the
 element used by security drivers

* formatdomain.html.in: Document 
---
 docs/formatdomain.html.in |   76 +
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 3a64983..c1ea480 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2614,6 +2614,82 @@ qemu-kvm -net nic,model=? /dev/null
   
 
 
+Security label
+
+
+  The seclabel element allows control over the
+  operation of the security drivers. There are two basic
+  modes of operation, dynamic where libvirt automatically
+  generates a unique security label, or static where the
+  application/administrator chooses the labels. With dynamic
+  label generation, libvirt will always automatically
+  relabel any resources associated with the virtual machine.
+  With static label assignment, by default, the administrator
+  or application must ensure labels are set correctly on any
+  resources, however, automatic relabelling can be enabled
+  if desired
+
+
+
+  Valid input XML configurations for the security label
+  are:
+
+
+
+  
+
+  
+system_u:system_r:my_svirt_t:s0
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+  When viewing the XML for a running guest with automatic
+  resource relabelling active, an additional XML element,
+  imagelabel, will be included. This is an
+  output-only element, so will be ignored in user supplied
+  XML documents
+
+
+  type
+  Either static or dynamic to determine
+whether libvirt automatically generates a unique security label
+or not.
+  
+  model
+  A valid security model name, matching the currently
+activated security model
+  
+  relabel
+  Either yes or no. This must always
+be yes if dynamic label assignment is used. With
+static label assignment it will default to no.
+  
+  label
+  If static labelling is used, this must specify the full
+security label to assign to the virtual domain. The format
+of the content depends on the security driver in use
+  
+  baselabel
+  If dynamic labelling is used, this can optionally be
+used to specify the base security label. The format
+of the content depends on the security driver in use
+  
+  imagelabel
+  This is an output only element, which shows the
+security label used on resources associated with the virtual domain.
+The format of the content depends on the security driver in use
+  
+
+
 Example configs
 
 
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 0/3] Improve flexibility of SELinux labelling

2011-06-27 Thread Daniel P. Berrange
This patch series adds two new features

 - The ability to override 'system_u:system_r:svirt_t:s0' from
   /etc/selinux/targeted/contexts/virtual_domain_context using
   the guest XML
 - The ability to use dynamic relabelling of resources, in combo
   with static VM label assignment.

The latter is useful for management applications which want to
be in full control of assigning VM labels (so that they can be
unique across an entire cluster of hosts for example), while
still benefiting from automatic relabelling of resources in the
XML.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 1/3] Allow a base label to be specified in dynamic labelling mode

2011-06-27 Thread Daniel P. Berrange
Normally the dynamic labelling mode will always use a base
label of 'svirt_t' for VMs. Introduce a  field
in the  XML to allow this base label to be changed

eg

   
 system_u:object_r:virt_t:s0
   

* docs/schemas/domain.rng: Add 
* src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
  of base label
* src/qemu/qemu_process.c: Don't reset 'model' attribute if
  a base label is specified
* src/security/security_apparmor.c: Refuse to support base label
* src/security/security_selinux.c: Use 'baselabel' when generating
  label, if available
---
 docs/schemas/domain.rng  |3 ++
 src/conf/domain_conf.c   |   56 ++---
 src/conf/domain_conf.h   |1 +
 src/qemu/qemu_process.c  |3 +-
 src/security/security_apparmor.c |6 
 src/security/security_selinux.c  |   29 ---
 6 files changed, 75 insertions(+), 23 deletions(-)

diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 891662d..ab5a56b 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -67,6 +67,9 @@
   
 
   
+  
+
+  
 
   
   
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3d290fb..cc318da 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -966,6 +966,7 @@ void virSecurityLabelDefFree(virDomainDefPtr def)
 VIR_FREE(def->seclabel.model);
 VIR_FREE(def->seclabel.label);
 VIR_FREE(def->seclabel.imagelabel);
+VIR_FREE(def->seclabel.baselabel);
 }
 
 static void
@@ -5072,20 +5073,11 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def,
 goto error;
 }
 
-/* Only parse details, if using static labels, or
+/* Only parse label, if using static labels, or
  * if the 'live' VM XML is requested
  */
 if (def->seclabel.type == VIR_DOMAIN_SECLABEL_STATIC ||
 !(flags & VIR_DOMAIN_XML_INACTIVE)) {
-p = virXPathStringLimit("string(./seclabel/@model)",
-VIR_SECURITY_MODEL_BUFLEN-1, ctxt);
-if (p == NULL) {
-virDomainReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing security model"));
-goto error;
-}
-def->seclabel.model = p;
-
 p = virXPathStringLimit("string(./seclabel/label[1])",
 VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
 if (p == NULL) {
@@ -5110,6 +5102,30 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def,
 def->seclabel.imagelabel = p;
 }
 
+/* Only parse baselabel, for dynamic label */
+if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC) {
+p = virXPathStringLimit("string(./seclabel/baselabel[1])",
+VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
+if (p != NULL)
+def->seclabel.baselabel = p;
+}
+
+/* Only parse model, if static labelling, or a base
+ * label is set, or doing active XML
+ */
+if (def->seclabel.type == VIR_DOMAIN_SECLABEL_STATIC ||
+def->seclabel.baselabel ||
+!(flags & VIR_DOMAIN_XML_INACTIVE)) {
+p = virXPathStringLimit("string(./seclabel/@model)",
+VIR_SECURITY_MODEL_BUFLEN-1, ctxt);
+if (p == NULL) {
+virDomainReportError(VIR_ERR_XML_ERROR,
+ "%s", _("missing security model"));
+goto error;
+}
+def->seclabel.model = p;
+}
+
 return 0;
 
 error:
@@ -9844,20 +9860,26 @@ char *virDomainDefFormat(virDomainDefPtr def,
 const char *sectype = 
virDomainSeclabelTypeToString(def->seclabel.type);
 if (!sectype)
 goto cleanup;
-if (!def->seclabel.label ||
-(def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
- (flags & VIR_DOMAIN_XML_INACTIVE))) {
+
+if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
+!def->seclabel.baselabel &&
+(flags & VIR_DOMAIN_XML_INACTIVE)) {
 virBufferAsprintf(&buf, "  \n",
   sectype, def->seclabel.model);
 } else {
 virBufferAsprintf(&buf, "  \n",
-  sectype, def->seclabel.model);
-virBufferEscapeString(&buf, "%s\n",
-  def->seclabel.label);
+  sectype, def->seclabel.model);
+if (def->seclabel.label)
+virBufferEscapeString(&buf, "%s\n",
+  def->seclabel.label);
 if (def->seclabel.imagelabel &&
-def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC)
+(def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC))
 virBufferEscapeString(&buf, "
%s\n",
   def->seclabel.imagelabel);
+if (def->seclabel.baselabel &&
+(def->seclabel.type ==

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Matthias Bolte
2011/6/27 simon :
> 于 2011-6-27 13:01, Daniel Veillard 写道:
>
>   So we are entering the week freeze for the new version 0.9.3
> I have made an rc1 tarball available at:
>ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
> along with rpms for those interested
> We pushed a lot of patches in the last few days, we know there is at
> least some cleanup issues, but I tried it locally and basic operations
> seems to work fine,
>
>   please give it a try too and report issues,
>
>thanks !
>
> Daniel
>
> On fc14.x86_64
> TEST: networkxml2argvtest  FAIL
>
> Download  libvirt-0.9.3-rc1.tar.gz
>
> ./configure && make && make check
>
> It report 1 of 52 tests failed
>
> TEST: networkxml2argvtest
>   !.!  7   FAIL
> FAIL: networkxml2argvtest

This a known problem when you configure libvirt with localstatedir
other than /var, what happens when you just run configure without
arguments.

We're working on a fix for this.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Matthias Bolte
2011/6/27 Zdenek Styblik :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 06/27/11 07:01, Daniel Veillard wrote:
>>   So we are entering the week freeze for the new version 0.9.3
>> I have made an rc1 tarball available at:
>>    ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
>> along with rpms for those interested
>> We pushed a lot of patches in the last few days, we know there is at
>> least some cleanup issues, but I tried it locally and basic operations
>> seems to work fine,
>>
>>   please give it a try too and report issues,
>>
>>    thanks !
>>
>> Daniel
>>
>
> Reporting Slackware64-13.37:
> - ---
>
> compilation OK.
>
> ~~~ SNIP ~~~
> ./configure \
>        --prefix=/usr/ \
>        --sysconfdir=/etc/ \
>        --libdir=/usr/lib${LIBDIRSUFFIX} \
>        --mandir=/usr/man/ \
>        --localstatedir=/var/ \
>        --enable-shared \
>        --enable-dependency-tracking \
>        --without-lxc \
>        --with-network \
>        --with-qemu \
>        --with-remote \
>        --with-sasl \
>        --with-storage-disk \
>        --with-storage-lvm \
>        --with-storage-scsi \
>        --with-libvirtd \
> ~~~ SNIP ~~~
>
> ~~~ SNIP ~~~
> /usr/include/netlink/object.h:58:23: warning: inline function
> 'nl_object_priv' declared but never defined
> /usr/include/netlink/object.h:58:23: warning: inline function
> 'nl_object_priv' declared but never defined
>  CC     libvirt_util_la-netlink.lo
> /usr/include/netlink/object.h:58:23: warning: inline function
> 'nl_object_priv' declared but never defined
> /usr/include/netlink/object.h:58:23: warning: inline function
> 'nl_object_priv' declared but never defined
>  CC     libvirt_util_la-pci.lo
>  CC     libvirt_util_la-processinfo.lo
>  CC     libvirt_util_la-hostusb.lo
>  CC     libvirt_util_la-network.lo
>  CC     libvirt_util_la-interface.lo
>  CC     libvirt_util_la-qparams.lo
> /usr/include/netlink/object.h:58:23: warning: inline function
> 'nl_object_priv' declared but never defined
> /usr/include/netlink/object.h:58:23: warning: inline function
> 'nl_object_priv' declared but never defined
> ~~~ SNIP ~~~

This is a known problem in libnl. This can be fixed in Slackware's
libnl package by removing the inline keyword from the declaration of
nl_object_priv in /usr/include/netlink/object.h.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread Gerhard Stenzel
On Mon, 2011-06-27 at 13:01 +0800, Daniel Veillard wrote:
> So we are entering the week freeze for the new version 0.9.3
> I have made an rc1 tarball available at:
>ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
> along with rpms for those interested
> We pushed a lot of patches in the last few days, we know there is at
> least some cleanup issues, but I tried it locally and basic operations
> seems to work fine,
> 
>   please give it a try too and report issues,
> 
>thanks !
> 
> Daniel
> 

sanlock-devel seems to be in rawhide, not f15:

$make rpm
...
make[1]: Leaving directory `/home/stenzel/projects/libvirt-0.9.3'
error: Failed build dependencies:
sanlock-devel is needed by libvirt-0.9.3-0rc1.fc15.x86_64
make: *** [rpm] Error 1

$ cat /etc/redhat-release 
Fedora release 15 (Lovelock)

libvirt.spec assumes f15 and higher:

# Enable sanlock library for lock management with QEMU
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
%define with_sanlock  0%{!?_without_sanlock:%{server_drivers}}
%endif


-- 
Best regards, 

Gerhard Stenzel, 
---
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: Remove bogus error codes for NUMA memory tuning

2011-06-27 Thread Daniel P. Berrange
On Mon, Jun 27, 2011 at 02:49:35PM +0800, Osier Yang wrote:
> This is no code between virSaveLastError and virGetLastError will
> set an error, remove the bogus codes.
> ---
>  src/qemu/qemu_process.c |   33 -
>  1 files changed, 0 insertions(+), 33 deletions(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index bb83be0..6c2492a 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -1251,8 +1251,6 @@ static int
>  qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)
>  {
>  nodemask_t mask;
> -virErrorPtr orig_err = NULL;
> -virErrorPtr err = NULL;
>  int mode = -1;
>  int node = -1;
>  int ret = -1;
> @@ -1291,23 +1289,12 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)
>  }
>  }
>  
> -orig_err = virSaveLastError();
>  mode = vm->def->numatune.memory.mode;
>  
>  if (mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
>  numa_set_bind_policy(1);
>  numa_set_membind(&mask);
>  numa_set_bind_policy(0);
> -
> -err = virGetLastError();
> -if ((err && (err->code != orig_err->code)) ||
> -(err && !orig_err)) {
> -qemuReportError(VIR_ERR_INTERNAL_ERROR,
> -_("Failed to bind memory to specified nodeset: 
> %s"),
> -err ? err->message : _("unknown error"));
> -virResetLastError();
> -goto cleanup;
> -}
>  } else if (mode == VIR_DOMAIN_NUMATUNE_MEM_PREFERRED) {
>  int nnodes = 0;
>  for (i = 0; i < NUMA_NUM_NODES; i++) {
> @@ -1326,28 +1313,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)
>  
>  numa_set_bind_policy(0);
>  numa_set_preferred(node);
> -
> -err = virGetLastError();
> -if ((err && (err->code != orig_err->code)) ||
> -(err && !orig_err)) {
> -qemuReportError(VIR_ERR_INTERNAL_ERROR,
> -_("Failed to set memory policy as preferred to 
> specified "
> -  "node: %s"), err ? err->message : _("unknown 
> error"));
> -virResetLastError();
> -goto cleanup;
> -}
>  } else if (mode == VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE) {
>  numa_set_interleave_mask(&mask);
> -
> -err = virGetLastError();
> -if ((err && (err->code != orig_err->code)) ||
> -(err && !orig_err)) {
> -qemuReportError(VIR_ERR_INTERNAL_ERROR,
> -_("Failed to interleave memory to specified 
> nodeset: %s"),
> -err ? err->message : _("unknown error"));
> -virResetLastError();
> -goto cleanup;
> -}
>  } else {
>  /* XXX: Shouldn't go here, as we already do checking when
>   * parsing domain XML.

ACK

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 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] sysinfo: delete unnecessary white space of sysinfo.

2011-06-27 Thread Daniel P. Berrange
On Mon, Jun 27, 2011 at 05:25:17PM +0900, Minoru Usui wrote:
> sysinfo: delete unnecessary white space of sysinfo.
> 
>   * Add virSkipSpacesBackwards() to src/util/util.[ch]
>   * Trim each element and delete null entry of sysinfo by 
> virSkipSpacesBackwards().
> 
> Signed-off-by: Minoru Usui 
> ---
>  src/util/sysinfo.c |   34 +-
>  src/util/util.c|   27 +++
>  src/util/util.h|1 +
>  3 files changed, 53 insertions(+), 9 deletions(-)
> 
> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
> index bff1cb8..2ebd34c 100644
> --- a/src/util/sysinfo.c
> +++ b/src/util/sysinfo.c
> @@ -238,6 +238,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Socket Designation: ")) != NULL) {
>  cur += 20;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_socket_destination = strndup(cur, eol 
> - cur)) == NULL))
>  goto no_memory;
> @@ -245,6 +246,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Type: ")) != NULL) {
>  cur += 6;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_type = strndup(cur, eol - cur)) == 
> NULL))
>  goto no_memory;
> @@ -252,6 +254,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Family: ")) != NULL) {
>  cur += 8;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_family = strndup(cur, eol - cur)) == 
> NULL))
>  goto no_memory;
> @@ -259,6 +262,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Manufacturer: ")) != NULL) {
>  cur += 14;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_manufacturer = strndup(cur, eol - 
> cur)) == NULL))
>  goto no_memory;
> @@ -266,6 +270,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Signature: ")) != NULL) {
>  cur += 11;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_signature = strndup(cur, eol - cur)) 
> == NULL))
>  goto no_memory;
> @@ -273,6 +278,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Version: ")) != NULL) {
>  cur += 9;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_version = strndup(cur, eol - cur)) == 
> NULL))
>  goto no_memory;
> @@ -280,6 +286,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "External Clock: ")) != NULL) {
>  cur += 16;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_external_clock = strndup(cur, eol - 
> cur)) == NULL))
>  goto no_memory;
> @@ -287,6 +294,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Max Speed: ")) != NULL) {
>  cur += 11;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_max_speed = strndup(cur, eol - cur)) 
> == NULL))
>  goto no_memory;
> @@ -294,6 +302,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Status: ")) != NULL) {
>  cur += 8;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_status = strndup(cur, eol - cur)) == 
> NULL))
>  goto no_memory;
> @@ -301,6 +310,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  if ((cur = strstr(base, "Serial Number: ")) != NULL) {
>  cur += 15;
>  eol = strchr(cur, '\n');
> +virSkipSpacesBackwards(cur, &eol);
>  if ((eol) &&
>  ((processor->processor_serial_number = strndup(cur, eol - 
> cur)) == NULL))
>  goto no_memory;
> @@ -308,12 +318,13 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr 
> ret)
>  if ((cur = strstr(base, "Part Number: ")) != NULL) {
>  cur += 13;
>  eol 

Re: [libvirt] sysinfo: cleanup function/struct names.

2011-06-27 Thread Daniel P. Berrange
On Mon, Jun 27, 2011 at 04:39:34PM +0900, Minoru Usui wrote:
> Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]
> 
> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
> index fab4f06..3ff834e 100644
> 
> Signed-off-by: Minoru Usui 
> ---
>  src/util/sysinfo.c |   44 
>  src/util/sysinfo.h |   16 
>  2 files changed, 32 insertions(+), 28 deletions(-)
> 
> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
> index fab4f06..31ebdc2 100644
> --- a/src/util/sysinfo.c
> +++ b/src/util/sysinfo.c
> @@ -128,7 +128,7 @@ virSysinfoRead(void) {
>  #else /* !WIN32 */
>  
>  static char *
> -parseBIOSInfo(char *base, virSysinfoDefPtr ret)
> +virSysinfoParseBIOS(char *base, virSysinfoDefPtr ret)
>  {
>  char *cur, *eol;
>  
> @@ -164,7 +164,7 @@ no_memory:
>  }
>  
>  static char *
> -parseSystemInfo(char *base, virSysinfoDefPtr ret)
> +virSysinfoParseSystem(char *base, virSysinfoDefPtr ret)
>  {
>  char *cur, *eol;
>  
> @@ -222,10 +222,10 @@ no_memory:
>  }
>  
>  static char *
> -parseProcessorInfo(char *base, virSysinfoDefPtr ret)
> +virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
>  {
>  char *cur, *eol, *tmp_base;
> -virProcessorinfoDefPtr processor;
> +virSysinfoProcessorDefPtr processor;
>  
>  while((tmp_base = strstr(base, "Processor Information")) != NULL) {
>  base = tmp_base;
> @@ -323,10 +323,10 @@ no_memory:
>  }
>  
>  static char *
> -parseMemoryDeviceInfo(char *base, virSysinfoDefPtr ret)
> +virSysinfoParseMemory(char *base, virSysinfoDefPtr ret)
>  {
>  char *cur, *eol, *tmp_base;
> -virMemoryDeviceinfoDefPtr memory;
> +virSysinfoMemoryDefPtr memory;
>  
>  while ((tmp_base = strstr(base, "Memory Device")) != NULL) {
>  base = tmp_base;
> @@ -452,20 +452,20 @@ virSysinfoRead(void) {
>  
>  base = outbuf;
>  
> -if ((base = parseBIOSInfo(base, ret)) == NULL)
> +if ((base = virSysinfoParseBIOS(base, ret)) == NULL)
>  goto no_memory;
>  
> -if ((base = parseSystemInfo(base, ret)) == NULL)
> +if ((base = virSysinfoParseSystem(base, ret)) == NULL)
>  goto no_memory;
>  
>  ret->nprocessor = 0;
>  ret->processor = NULL;
> -if ((base = parseProcessorInfo(base, ret)) == NULL)
> +if ((base = virSysinfoParseProcessor(base, ret)) == NULL)
>  goto no_memory;
>  
>  ret->nmemory = 0;
>  ret->memory = NULL;
> -if ((base = parseMemoryDeviceInfo(base, ret)) == NULL)
> +if ((base = virSysinfoParseMemory(base, ret)) == NULL)
>  goto no_memory;
>  
>  cleanup:
> @@ -484,7 +484,8 @@ no_memory:
>  #endif /* !WIN32 */
>  
>  static void
> -BIOSInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
> +virSysinfoBIOSFormat(virSysinfoDefPtr def, const char *prefix,
> + virBufferPtr buf)
>  {
>  int len = strlen(prefix);
>  
> @@ -522,7 +523,8 @@ BIOSInfoFormat(virSysinfoDefPtr def, const char *prefix, 
> virBufferPtr buf)
>  }
>  
>  static void
> -SystemInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
> +virSysinfoSystemFormat(virSysinfoDefPtr def, const char *prefix,
> +   virBufferPtr buf)
>  {
>  int len = strlen(prefix);
>  
> @@ -580,11 +582,12 @@ SystemInfoFormat(virSysinfoDefPtr def, const char 
> *prefix, virBufferPtr buf)
>  }
>  
>  static void
> -ProcessorInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr 
> buf)
> +virSysinfoProcessorFormat(virSysinfoDefPtr def, const char *prefix,
> +  virBufferPtr buf)
>  {
>  int i;
>  int len = strlen(prefix);
> -virProcessorinfoDefPtr processor;
> +virSysinfoProcessorDefPtr processor;
>  
>  for (i = 0; i < def->nprocessor; i++) {
>  processor = &def->processor[i];
> @@ -675,11 +678,12 @@ ProcessorInfoFormat(virSysinfoDefPtr def, const char 
> *prefix, virBufferPtr buf)
>  }
>  
>  static void
> -MemoryDeviceInfoFormat(virSysinfoDefPtr def, const char *prefix, 
> virBufferPtr buf)
> +virSysinfoMemoryFormat(virSysinfoDefPtr def, const char *prefix,
> + virBufferPtr buf)
>  {
>  int i;
>  int len = strlen(prefix);
> -virMemoryDeviceinfoDefPtr memory;
> +virSysinfoMemoryDefPtr memory;
>  
>  for (i = 0; i < def->nmemory; i++) {
>  memory = &def->memory[i];
> @@ -785,10 +789,10 @@ virSysinfoFormat(virSysinfoDefPtr def, const char 
> *prefix)
>  
>  virBufferAsprintf(&buf, "%s\n", prefix, type);
>  
> -BIOSInfoFormat(def, prefix, &buf);
> -SystemInfoFormat(def, prefix, &buf);
> -ProcessorInfoFormat(def, prefix, &buf);
> -MemoryDeviceInfoFormat(def, prefix, &buf);
> +virSysinfoBIOSFormat(def, prefix, &buf);
> +virSysinfoSystemFormat(def, prefix, &buf);
> +virSysinfoProcessorFormat(def, prefix, &buf);
> +virSysinfoMemoryFormat(def, prefix, &buf);
>  
>  virBufferAsprintf(&buf, "%s\n", prefix);
>  

Re: [libvirt] sysinfo: fix lack of error check in virSysinfoFormat().

2011-06-27 Thread Daniel P. Berrange
On Mon, Jun 27, 2011 at 04:40:56PM +0900, Minoru Usui wrote:
> Fix lack of error check in virSysinfoFormat().
> 
> Signed-off-by: Minoru Usui 
> ---
>  src/util/sysinfo.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
> index 31ebdc2..bff1cb8 100644
> --- a/src/util/sysinfo.c
> +++ b/src/util/sysinfo.c
> @@ -796,6 +796,11 @@ virSysinfoFormat(virSysinfoDefPtr def, const char 
> *prefix)
>  
>  virBufferAsprintf(&buf, "%s\n", prefix);
>  
> +if (virBufferError(&buf)) {
> +virReportOOMError();
> +return NULL;
> +}
> +
>  return virBufferContentAndReset(&buf);
>  }

ACK


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 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 1/3 V3] lib: add virtkey

2011-06-27 Thread Lai Jiangshan
On 06/24/2011 09:18 PM, Daniel P. Berrange wrote:
> On Fri, Jun 24, 2011 at 02:33:29PM +0800, Lai Jiangshan wrote:
>> Add virtkey lib for usage-improvment and keycode translating.
>> Add 4 internal API for the aim
>>
>> const char *virKeycodeSetName(virKeycodeSet codeset);
>> virKeycodeSet virParseKeycodeSet(const char *name);
> 
> These should just be done using the standard VIR_ENUM_DECL/IMPL macros.
> 
>> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
>> index 3f634e6..2f2efe7 100644
>> --- a/include/libvirt/libvirt.h.in
>> +++ b/include/libvirt/libvirt.h.in
>> @@ -1815,6 +1815,12 @@ typedef enum {
>>  VIR_KEYCODE_SET_ATSET1 = 2,
>>  VIR_KEYCODE_SET_ATSET2 = 3,
>>  VIR_KEYCODE_SET_ATSET3 = 4,
>> +VIR_KEYCODE_SET_OSX= 5,
>> +VIR_KEYCODE_SET_XT_KBD = 6,
>> +VIR_KEYCODE_SET_USB= 7,
>> +VIR_KEYCODE_SET_WIN32  = 8,
>> +VIR_KEYCODE_SET_XWIN_XT= 9,
>> +VIR_KEYCODE_SET_XFREE86_KBD_XT = 10,
>>  } virKeycodeSet;
> 
> IMHO, we don't really need to include the XT_KBD, XWIN_XT or
> XFREE86_KBD_XT codesets, since these are all special purpose
> sets which are just derived from the based XT set. Lets just
> stick to the core interesting sets. So add OSX, USB and WIN32
> only.

I found qemu monitor just accept XT_KBD, not XT, maybe I'm wrong.

> 
>> diff --git a/src/util/virtkey.c b/src/util/virtkey.c
>> new file mode 100644
>> index 000..48fbfcc
>> --- /dev/null
>> +++ b/src/util/virtkey.c
>> @@ -0,0 +1,633 @@
>> +
>> +/*
>> + * Copyright (c) 2011 Lai Jiangshan
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU General Public License version 2 as published 
>> by
>> + * the Free Software Foundation.
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include "virtkey.h"
>> +
>> +#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0]))
>> +#define getfield(object, field_type, field_offset) \
>> +(*(typeof(field_type) *)((char *)(object) + field_offset))
>> +
>> +struct keycode {
>> +const char *linux_name;
>> +const char *os_x_name;
>> +const char *win32_name;
>> +unsigned short linux_keycode;
>> +unsigned short xt;
>> +unsigned short atset1;
>> +unsigned short atset2;
>> +unsigned short atset3;
>> +unsigned short os_x;
>> +unsigned short xt_kbd;
>> +unsigned short usb;
>> +unsigned short win32;
>> +unsigned short xwin_xt;
>> +unsigned short xfree86_kbd_xt;
>> +};
>> +
>> +/*
>> + * generated from http://git.gnome.org/browse/gtk-vnc/plain/src/keymaps.csv
>> + * script:
>> + *
>> + * #!/bin/python
>> + * import sys
>> + * import re
>> + *
>> + * for line in sys.stdin.xreadlines():
>> + * a = re.match("([^,]*)," * 13 + "([^,]*)$", line[0:-1]).groups()
>> + * b = ""
>> + * for i in (0,2,10,1,7,4,5,6,3,8,9,11,12,13):
>> + * if i in (0, 2, 10):
>> + * b = b + (a[i] and ('"' + a[i] + '"') or 'NULL') + ','
>> + * else:
>> + * b = b + (a[i] or '0') + ','
>> + * print "{ " + b + "},"
>> + */
> 
> One of the goals of having the keymap data in the CSV file was that
> it makes it trivially updatable across apps using it, without making
> code changes. In fact my goal is to actually put 'keymaps.csv' and
> 'keymaps.pl' into a separate shared package at some point. So rather
> than hardcoding this giant array in libvirt, just include the GTK-VNC
> keymaps.csv and keymaps.pl file as-is, and run them to generate the
> mapping tables for combinations we need.
> 
> NB, keymaps.pl will need to be updated to be able to output a
> table for doing "string->keycode" mapping since it doesn't
> do that yet. For the plain  keycode->keycode mappings though
> just use its currently functionality.

I didn't find separate git repository for  keymaps.csv.
Should I copy keymaps.csv to libvirt?

keymaps.pl need to be run O(N*N) times and it will generate O(N*N) tables
for different translating, I think that 1 table is the best, even the
table are bigger.


> 
>> +const char *virKeycodeSetName(virKeycodeSet codeset)
>> +{
>> +int i = (int)codeset;
>> +
>> +if (i < 0 || i >= ARRAY_SIZE(codesetInfo))
>> +return "UNKNOWN";
>> +
>> +return codesetInfo[i].name;
>> +}
>> +
>> +virKeycodeSet virParseKeycodeSet(const char *name)
>> +{
>> +int i;
>> +
>> +for (i = 0; i < ARRAY_SIZE(codesetInfo); i++) {
>> +if (!strcmp(codesetInfo[i].name, name))
>> +return (virKeycodeSet)i;
>> +}
>> +
>> +return (virKeycodeSet)-1;
>> +}
> 
> These just get replaced by VIR_ENUM_IMPL

Will do, thanks,

> 
>> +static int virParseKeyNameOffset(unsigned int name_offset,
>> + unsigned int code_offset,
>> + const char *keyname)
>> +{
>> +int i;
>> +
>> +for (i = 0; i < ARRAY_SIZE(keycodes); i++) {
>> +const

Re: [libvirt] regression in finding boot device

2011-06-27 Thread Jiri Denemark
On Sat, Jun 25, 2011 at 00:21:29 -0400, Laine Stump wrote:
> (bootindex was showing up as "1" in the log; not knowing anything about 
> how it worked, I decided to try just changing it to "0". That  didn't 
> work. Switching back to the old method *did* work, though.)
> 
> This system is running qemu-kvm-0.14-7.fc14.x86_64.
> If you'd like a look at the domain XML, the qemu logs, or access to the 
> machine, just let me know.

Yeah, sending the domain XML and qemu command line to which it was transformed
would be great. However, since you say you see bootindex=1 (in qemu command
line I suppose), I think everything should work fine on libvirt side... What
version of seabios do you have?

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] qemu: Fix update device for CURRENT + FORCE flags

2011-06-27 Thread Jiri Denemark
When CURRENT and FORCE flags were used together, UpdateDeviceFlags did
nothing because it failed to transform CURRENT into either LIVE or
CONFIG.
---
 src/qemu/qemu_driver.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index da612e7..8596b30 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4789,12 +4789,15 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const 
char *xml,
 virDomainDeviceDefPtr dev = NULL;
 bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0;
 int ret = -1;
+unsigned int affect;
 
 virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
   VIR_DOMAIN_AFFECT_CONFIG |
   (action == QEMU_DEVICE_UPDATE ?
VIR_DOMAIN_DEVICE_MODIFY_FORCE : 0), -1);
 
+affect = flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG);
+
 qemuDriverLock(driver);
 vm = virDomainFindByUUID(&driver->domains, dom->uuid);
 if (!vm) {
@@ -4809,10 +4812,10 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const 
char *xml,
 goto cleanup;
 
 if (virDomainObjIsActive(vm)) {
-if (flags == VIR_DOMAIN_AFFECT_CURRENT)
+if (affect == VIR_DOMAIN_AFFECT_CURRENT)
 flags |= VIR_DOMAIN_AFFECT_LIVE;
 } else {
-if (flags == VIR_DOMAIN_AFFECT_CURRENT)
+if (affect == VIR_DOMAIN_AFFECT_CURRENT)
 flags |= VIR_DOMAIN_AFFECT_CONFIG;
 /* check consistency between flags and the vm state */
 if (flags & VIR_DOMAIN_AFFECT_LIVE) {
-- 
1.7.5.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] sysinfo: delete unnecessary white space of sysinfo.

2011-06-27 Thread Minoru Usui
sysinfo: delete unnecessary white space of sysinfo.

  * Add virSkipSpacesBackwards() to src/util/util.[ch]
  * Trim each element and delete null entry of sysinfo by 
virSkipSpacesBackwards().

Signed-off-by: Minoru Usui 
---
 src/util/sysinfo.c |   34 +-
 src/util/util.c|   27 +++
 src/util/util.h|1 +
 3 files changed, 53 insertions(+), 9 deletions(-)

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index bff1cb8..2ebd34c 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -238,6 +238,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Socket Designation: ")) != NULL) {
 cur += 20;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_socket_destination = strndup(cur, eol - 
cur)) == NULL))
 goto no_memory;
@@ -245,6 +246,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Type: ")) != NULL) {
 cur += 6;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_type = strndup(cur, eol - cur)) == 
NULL))
 goto no_memory;
@@ -252,6 +254,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Family: ")) != NULL) {
 cur += 8;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_family = strndup(cur, eol - cur)) == 
NULL))
 goto no_memory;
@@ -259,6 +262,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Manufacturer: ")) != NULL) {
 cur += 14;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_manufacturer = strndup(cur, eol - cur)) 
== NULL))
 goto no_memory;
@@ -266,6 +270,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Signature: ")) != NULL) {
 cur += 11;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_signature = strndup(cur, eol - cur)) == 
NULL))
 goto no_memory;
@@ -273,6 +278,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Version: ")) != NULL) {
 cur += 9;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_version = strndup(cur, eol - cur)) == 
NULL))
 goto no_memory;
@@ -280,6 +286,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "External Clock: ")) != NULL) {
 cur += 16;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_external_clock = strndup(cur, eol - 
cur)) == NULL))
 goto no_memory;
@@ -287,6 +294,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Max Speed: ")) != NULL) {
 cur += 11;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_max_speed = strndup(cur, eol - cur)) == 
NULL))
 goto no_memory;
@@ -294,6 +302,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Status: ")) != NULL) {
 cur += 8;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_status = strndup(cur, eol - cur)) == 
NULL))
 goto no_memory;
@@ -301,6 +310,7 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Serial Number: ")) != NULL) {
 cur += 15;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_serial_number = strndup(cur, eol - 
cur)) == NULL))
 goto no_memory;
@@ -308,12 +318,13 @@ virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 if ((cur = strstr(base, "Part Number: ")) != NULL) {
 cur += 13;
 eol = strchr(cur, '\n');
+virSkipSpacesBackwards(cur, &eol);
 if ((eol) &&
 ((processor->processor_part_number = strndup(cur, eol - cur)) 
== NULL))
 goto no_memory;
 }
 
-base = eol + 1;
+base += strlen("Proce

Re: [libvirt] [PATCH] build: rename Vcpupin to VcpuPin

2011-06-27 Thread Taku Izumi
On Sat, 25 Jun 2011 09:51:17 -0400
Laine Stump  wrote:

> On 06/24/2011 07:16 PM, Eric Blake wrote:
> > We already have a public virDomainPinVcpu, which implies that
> > Pin and Vcpu are treated as separate words.  Commit e261987c
> > introduced virDomainGetVcpupinInfo as the first public API
> > that used Vcpupin, although we had prior internal uses of that
> > spelling.  For consistency, change the spelling to be two
> > words everywhere, regardless of whether pin comes first or last.
> 
> I think this should get more consensus before being committed, but my 
> vote is to change it to "Pin". Aside from consistency, it's easier to read.

 So do I.
 I think "VcpuPin" is good if it is not disliked that 
 "VcpuPin" coexists with "PinVcpu".

-- 
Taku Izumi 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] sysinfo: fix lack of error check in virSysinfoFormat().

2011-06-27 Thread Minoru Usui
Fix lack of error check in virSysinfoFormat().

Signed-off-by: Minoru Usui 
---
 src/util/sysinfo.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index 31ebdc2..bff1cb8 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -796,6 +796,11 @@ virSysinfoFormat(virSysinfoDefPtr def, const char *prefix)
 
 virBufferAsprintf(&buf, "%s\n", prefix);
 
+if (virBufferError(&buf)) {
+virReportOOMError();
+return NULL;
+}
+
 return virBufferContentAndReset(&buf);
 }
 
-- 
1.7.1
-- 
Minoru Usui 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] sysinfo: cleanup function/struct names.

2011-06-27 Thread Minoru Usui
Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index fab4f06..3ff834e 100644

Signed-off-by: Minoru Usui 
---
 src/util/sysinfo.c |   44 
 src/util/sysinfo.h |   16 
 2 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index fab4f06..31ebdc2 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -128,7 +128,7 @@ virSysinfoRead(void) {
 #else /* !WIN32 */
 
 static char *
-parseBIOSInfo(char *base, virSysinfoDefPtr ret)
+virSysinfoParseBIOS(char *base, virSysinfoDefPtr ret)
 {
 char *cur, *eol;
 
@@ -164,7 +164,7 @@ no_memory:
 }
 
 static char *
-parseSystemInfo(char *base, virSysinfoDefPtr ret)
+virSysinfoParseSystem(char *base, virSysinfoDefPtr ret)
 {
 char *cur, *eol;
 
@@ -222,10 +222,10 @@ no_memory:
 }
 
 static char *
-parseProcessorInfo(char *base, virSysinfoDefPtr ret)
+virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
 {
 char *cur, *eol, *tmp_base;
-virProcessorinfoDefPtr processor;
+virSysinfoProcessorDefPtr processor;
 
 while((tmp_base = strstr(base, "Processor Information")) != NULL) {
 base = tmp_base;
@@ -323,10 +323,10 @@ no_memory:
 }
 
 static char *
-parseMemoryDeviceInfo(char *base, virSysinfoDefPtr ret)
+virSysinfoParseMemory(char *base, virSysinfoDefPtr ret)
 {
 char *cur, *eol, *tmp_base;
-virMemoryDeviceinfoDefPtr memory;
+virSysinfoMemoryDefPtr memory;
 
 while ((tmp_base = strstr(base, "Memory Device")) != NULL) {
 base = tmp_base;
@@ -452,20 +452,20 @@ virSysinfoRead(void) {
 
 base = outbuf;
 
-if ((base = parseBIOSInfo(base, ret)) == NULL)
+if ((base = virSysinfoParseBIOS(base, ret)) == NULL)
 goto no_memory;
 
-if ((base = parseSystemInfo(base, ret)) == NULL)
+if ((base = virSysinfoParseSystem(base, ret)) == NULL)
 goto no_memory;
 
 ret->nprocessor = 0;
 ret->processor = NULL;
-if ((base = parseProcessorInfo(base, ret)) == NULL)
+if ((base = virSysinfoParseProcessor(base, ret)) == NULL)
 goto no_memory;
 
 ret->nmemory = 0;
 ret->memory = NULL;
-if ((base = parseMemoryDeviceInfo(base, ret)) == NULL)
+if ((base = virSysinfoParseMemory(base, ret)) == NULL)
 goto no_memory;
 
 cleanup:
@@ -484,7 +484,8 @@ no_memory:
 #endif /* !WIN32 */
 
 static void
-BIOSInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
+virSysinfoBIOSFormat(virSysinfoDefPtr def, const char *prefix,
+ virBufferPtr buf)
 {
 int len = strlen(prefix);
 
@@ -522,7 +523,8 @@ BIOSInfoFormat(virSysinfoDefPtr def, const char *prefix, 
virBufferPtr buf)
 }
 
 static void
-SystemInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
+virSysinfoSystemFormat(virSysinfoDefPtr def, const char *prefix,
+   virBufferPtr buf)
 {
 int len = strlen(prefix);
 
@@ -580,11 +582,12 @@ SystemInfoFormat(virSysinfoDefPtr def, const char 
*prefix, virBufferPtr buf)
 }
 
 static void
-ProcessorInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
+virSysinfoProcessorFormat(virSysinfoDefPtr def, const char *prefix,
+  virBufferPtr buf)
 {
 int i;
 int len = strlen(prefix);
-virProcessorinfoDefPtr processor;
+virSysinfoProcessorDefPtr processor;
 
 for (i = 0; i < def->nprocessor; i++) {
 processor = &def->processor[i];
@@ -675,11 +678,12 @@ ProcessorInfoFormat(virSysinfoDefPtr def, const char 
*prefix, virBufferPtr buf)
 }
 
 static void
-MemoryDeviceInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr 
buf)
+virSysinfoMemoryFormat(virSysinfoDefPtr def, const char *prefix,
+ virBufferPtr buf)
 {
 int i;
 int len = strlen(prefix);
-virMemoryDeviceinfoDefPtr memory;
+virSysinfoMemoryDefPtr memory;
 
 for (i = 0; i < def->nmemory; i++) {
 memory = &def->memory[i];
@@ -785,10 +789,10 @@ virSysinfoFormat(virSysinfoDefPtr def, const char *prefix)
 
 virBufferAsprintf(&buf, "%s\n", prefix, type);
 
-BIOSInfoFormat(def, prefix, &buf);
-SystemInfoFormat(def, prefix, &buf);
-ProcessorInfoFormat(def, prefix, &buf);
-MemoryDeviceInfoFormat(def, prefix, &buf);
+virSysinfoBIOSFormat(def, prefix, &buf);
+virSysinfoSystemFormat(def, prefix, &buf);
+virSysinfoProcessorFormat(def, prefix, &buf);
+virSysinfoMemoryFormat(def, prefix, &buf);
 
 virBufferAsprintf(&buf, "%s\n", prefix);
 
diff --git a/src/util/sysinfo.h b/src/util/sysinfo.h
index a15c5ac..86fd20f 100644
--- a/src/util/sysinfo.h
+++ b/src/util/sysinfo.h
@@ -33,9 +33,9 @@ enum virSysinfoType {
 VIR_SYSINFO_LAST
 };
 
-typedef struct _virProcessorinfoDef virProcessorinfoDef;
-typedef virProcessorinfoDef *virProcessorinfoDefPtr;
-struct _virProcessorinfoDef {
+typedef struct _virSysinfoPr

Re: [libvirt] libvirt-0.9.3 week freeze, RC1 version to test

2011-06-27 Thread simon

? 2011-6-27 13:01, Daniel Veillard ??:

   So we are entering the week freeze for the new version 0.9.3
I have made an rc1 tarball available at:
ftp://libvirt.org/libvirt/libvirt-0.9.3-rc1.tar.gz
along with rpms for those interested
We pushed a lot of patches in the last few days, we know there is at
least some cleanup issues, but I tried it locally and basic operations
seems to work fine,

   please give it a try too and report issues,

thanks !

Daniel


On fc14.x86_64
TEST: networkxml2argvtest FAIL

Download  libvirt-0.9.3-rc1.tar.gz

./configure&&  make&&  make check

It report1 of 52 tests failed

TEST: networkxml2argvtest
  !.!  7   FAIL
FAIL: networkxml2argvtest

1 of 52 tests failed
Please report tolibvir-l...@redhat.com 
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list