Re: [libvirt] [RFC] Support for CPUID masking v2

2009-09-14 Thread 'Jiri Denemark'
  I'm not sure how to deal with named CPUs suggested by Dan. Either we need
  to come up with global set of named CPUs and document what they mean or
  let drivers specify their own named CPUs and advertise them through guest
  capabilities:
  guest
  ...
  cpu model=NAME
  featureNAME/feature
  ...
  /cpu
  /guest
 [IH] you also need to support removing a feature from the base cpu model,
 if it is disabled by bios, like the nx flag).

Indeed, the above XML snippet describes capabilities, that is what features
are turned on by each model name.

...
  And finally, CPU may be configured in domain XML configuration:
  
  domain
  ...
  cpu model=NAME
  topology
  socketsNUMBER_OF_SOCKETS/sockets
  coresCORES_PER_SOCKET/cores
  threadsTHREADS_PER_CORE/threads
  /topology
  
  feature name=NAME mode=set|check value=on|off/
  /cpu
  /domain
  
  Mode 'check' checks physical CPU for the feature and refuses the domain to
  start if it doesn't match. VCPU feature is set to the same value. Mode
  'set' just sets the VCPU feature.

While here, when configuring a domain, you would use something like

cpu model=whatever
feature name=sse6 mode=set value=off/
/cpu

to turn off 'sse6' feature which was turned on by selecting CPU model
'whatever'.

Jirka

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


[libvirt] [PATCH]: API Change patch for VBox 3.0.6

2009-09-14 Thread Pritesh Kothari
Hi All,

VirtualBox 3.0.6 was released few days ago and there were some minor API 
changes in it. I have created a patch for the same and posting it here.

Regards,
Pritesh
commit 72088db113ce5837cce91616ebbf64dcd1a2b0ee
Author: Pritesh Kothari pritesh.koth...@sun.com
Date:   Mon Sep 14 09:05:38 2009 +0200

libvirt: API Changes for VBox 3.0.6

diff --git a/src/vbox/vbox_CAPI_v3_0.h b/src/vbox/vbox_CAPI_v3_0.h
index 13b4d4d..0644dd9 100644
--- a/src/vbox/vbox_CAPI_v3_0.h
+++ b/src/vbox/vbox_CAPI_v3_0.h
@@ -899,6 +899,7 @@ struct nsIEventQueue {
 
 
 struct IVirtualBoxErrorInfo;
+struct ILocalOwner;
 struct IVirtualBoxCallback;
 struct IDHCPServer;
 struct IVirtualBox;
@@ -954,6 +955,7 @@ struct IPerformanceMetric;
 struct IPerformanceCollector;
 
 typedef struct IVirtualBoxErrorInfo IVirtualBoxErrorInfo;
+typedef struct ILocalOwner ILocalOwner;
 typedef struct IVirtualBoxCallback IVirtualBoxCallback;
 typedef struct IDHCPServer IDHCPServer;
 typedef struct IVirtualBox IVirtualBox;
@@ -1840,6 +1842,30 @@ struct IVirtualBoxErrorInfo
 /* End of struct IVirtualBoxErrorInfo Declaration */
 
 
+/* Start of struct ILocalOwner Declaration */
+#define ILOCALOWNER_IID_STR 308FF42A-DC45-49D4-A950-B1EEE5E00BB5
+#define ILOCALOWNER_IID { \
+0x308FF42A, 0xDC45, 0x49D4, \
+{ 0xA9, 0x50, 0xB1, 0xEE, 0xE5, 0xE0, 0x0B, 0xB5 } \
+}
+struct ILocalOwner_vtbl
+{
+struct nsISupports_vtbl nsisupports;
+
+nsresult (*SetLocalObject)(
+ILocalOwner *pThis,
+nsISupports * object
+);
+
+};
+
+struct ILocalOwner
+{
+struct ILocalOwner_vtbl *vtbl;
+};
+/* End of struct ILocalOwner Declaration */
+
+
 /* Start of struct IVirtualBoxCallback Declaration */
 #define IVIRTUALBOXCALLBACK_IID_STR 2990059f-5bc8-4635-8415-658917cd3186
 #define IVIRTUALBOXCALLBACK_IID { \
@@ -5050,9 +5076,9 @@ struct IInternalSessionControl
 
 
 /* Start of struct ISession Declaration */
-#define ISESSION_IID_STR 12F4DCDB-12B2-4ec1-B7CD-DDD9F6C5BF4D
+#define ISESSION_IID_STR 12F4DCDB-12B2-4EC1-B7CD-DDD9F6C5BF4D
 #define ISESSION_IID { \
-0x12F4DCDB, 0x12B2, 0x4ec1, \
+0x12F4DCDB, 0x12B2, 0x4EC1, \
 { 0xB7, 0xCD, 0xDD, 0xD9, 0xF6, 0xC5, 0xBF, 0x4D } \
 }
 struct ISession_vtbl
@@ -5262,7 +5288,7 @@ struct IPerformanceCollector
 
 
 #define NS_SESSION_CID { \
-0x3C02F46D, 0xC9D2, 0x4f11, \
+0x3C02F46D, 0xC9D2, 0x4F11, \
 { 0xA3, 0x84, 0x53, 0xF0, 0xCF, 0x91, 0x72, 0x14 } \
 }
 #define NS_SESSION_CONTRACTID @virtualbox.org/Session;1
@@ -5271,6 +5297,16 @@ struct IPerformanceCollector
 
 
 
+#define NS_CALLBACKWRAPPER_CID { \
+0x49EE8561, 0x5563, 0x4715, \
+{ 0xB1, 0x8C, 0xA4, 0xB1, 0xA4, 0x90, 0xDA, 0xFE } \
+}
+#define NS_CALLBACKWRAPPER_CONTRACTID @virtualbox.org/CallbackWrapper;1
+/* for compatibility with Win32 */
+#define CLSID_CallbackWrapper (nsCID) NS_CALLBACKWRAPPER_CID
+
+
+
 #endif /* !__cplusplus */
 
 #ifdef IN_VBOXXPCOMC
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Interface driver and ESX support

2009-09-14 Thread Shahar Klein
Thanks Matthias

works great : )




From: Matthias Bolte matthias.bo...@googlemail.com
To: Shahar Klein shaharkl...@yahoo.com
Cc: libvir-list@redhat.com
Sent: Monday, September 14, 2009 3:57:52 AM
Subject: Re: [libvirt] Interface driver and ESX support

Okay, I finally got the patches cleaned up.

I just posted this 12 patches series to the mailing list. Apply them
all to an up to date git clone and apply the attached, updated ESX
interface driver stub patch in the end.

Patch 6 of 12 adds the binding for HostCpuIdInfo and contains the
functions to handle ArrayOf* types.

Matthias

2009/9/13 Shahar Klein shaharkl...@yahoo.com:
 I see
 You are making my (coding) life easier : )
 thanks
 
 From: Matthias Bolte matthias.bo...@googlemail.com
 To: Shahar Klein shaharkl...@yahoo.com
 Cc: libvir-list@redhat.com
 Sent: Sunday, September 13, 2009 4:39:22 PM
 Subject: Re: [libvirt] Interface driver and ESX support

 No, as I said before you should wait until you can use the unpublished
 binding of HostCpuIdInfo as an example. This also includes the code to
 handle ArrayOf* types. I'm currently cleaning up this patches (didn't
 have time on thursday for that) and will post them today, just wait
 for this patches, because they will help you.

 Matthias

 2009/9/13 Shahar Klein shaharkl...@yahoo.com:
 I've defined (among others):
 int esxVI_PhysicalNic_CastListFromAnyType(virConnectPtr conn,
 esxVI_AnyType
 *anyType, esxVI_PhysicalNic **pNicList);
 but runing it returns somthing like:
 Expecting type 'PhysicalNic' but found 'ArrayOfPhysicalNic'
 Does it mean I should also implement:
 esxVI_ArrayOfPhysicalNic_CastListFromAnyType()
 and all the funcs/type definition coming with it?
 thanks
 Shahar
 
 From: Matthias Bolte matthias.bo...@googlemail.com
 To: Shahar Klein shaharkl...@yahoo.com
 Cc: libvir-list@redhat.com
 Sent: Thursday, September 10, 2009 6:24:25 PM
 Subject: Re: [libvirt] Interface driver and ESX support

 2009/9/10 Shahar Klein shaharkl...@yahoo.com:
 I'm not sure what you mean about mapping
 lets take the pnics as a study case for me
 do I need to define a structure similar to this:


 http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.PhysicalNic.html
 and also take care for it's allocation?


 Yes, you need to implement the mapping (a better word may be
 'binding') of this VI API type to a C type, that also includes to care
 about its allocation. You'll need to implement at least this set of
 function in esx_vi_types.[ch]:

 esxVI_PhysicalNic_Alloc()
 esxVI_PhysicalNic_Free()
 esxVI_PhysicalNic_CastFromAnyType()
 esxVI_PhysicalNic_CastListFromAnyType()
 esxVI_PhysicalNic_Deserialize()
 esxVI_PhysicalNic_DeserializeList()

 You could use the binding for the HostCpuIdInfo type, but
 unfortunately I haven't published the code for it yet. This code also
 includes some essential helper functions for
 esxVI_PhysicalNic_CastListFromAnyType().

 Beside the PhysicalNic type, you may also have to bind the types of
 its members like PhysicalNicLinkInfo, PhysicalNicSpec and
 HostIpConfig, if you need or care about the information provided by
 them.

 The binding for HostCpuIdInfo is part of a larger set of patches that
 add some new features to ESX driver, but the patches needs some
 cleanup first. I may have some time later this evening to clean them
 up and post them.

 PS: You should refer to version 2.5 of the VI API [1] and not 4.0,
 because the complete VI API mapping is currently based on version 2.5.
 At some point I'll have to properly distinguish between version 2.5
 and 4.0, but currently I would like to stick to version 2.5 only.

 [1]
 http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/

 Matthias







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


Re: [libvirt] [PATCH]: API Change patch for VBox 3.0.6

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 09:11:29AM +0200, Pritesh Kothari wrote:
 Hi All,
 
 VirtualBox 3.0.6 was released few days ago and there were some minor API 
 changes in it. I have created a patch for the same and posting it here.

  Okay, since you promised me on IRC this was really risk free and
fully tested, I applied it so 0.7.1 can have support for the new
release,

  thanks !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


[libvirt] Python binding to virConnectListInterfaces

2009-09-14 Thread Shahar Klein


Hi

I'm trying to implement virConnectListInterfaces for the ESX driver
(actually the esx_interface driver)
but the python generator does not write the code for this function

in generator.py this function is in a special table called: skip_impl

and there is a comment saying:
# Class methods which are written by hand in libvir.c but the Python-level
# code is still automatically generated (so they are not in skip_function())

I'm not sure what does it mean 

should I implement in libvir.c? 
and I'm done?

thanks ahead

Shahar


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


Re: [libvirt] ESX [11/12]: Reorder some function calls to avoid potential virDomainPtr leaks

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 02:45:34AM +0200, Matthias Bolte wrote:
 * src/esx/esx_driver.c: avoid potential virDomainPtr leaks

 diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
 index 5a93d1f..91de407 100644
 --- a/src/esx/esx_driver.c
 +++ b/src/esx/esx_driver.c

  Okay, that's clearly a bug fix applying to current code, so commited
  now,

thanks !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] ESX [05/12]: Also strip (C) and (TM) from the CPU model string

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 02:42:35AM +0200, Matthias Bolte wrote:
 * src/esx/esx_driver.c: also strip (C) and (TM) from the CPU model string

 diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
 index 3f3ee30..96d5976 100644
 --- a/src/esx/esx_driver.c
 +++ b/src/esx/esx_driver.c
 @@ -746,9 +746,12 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr 
 nodeinfo)
  if (STRPREFIX (ptr,   )) {
  memmove(ptr, ptr + 1, strlen (ptr + 1) + 1);
  continue;
 -} else if (STRPREFIX (ptr, (R))) {
 +} else if (STRPREFIX(ptr, (R)) || STRPREFIX(ptr, (C))) {
  memmove(ptr, ptr + 3, strlen (ptr + 3) + 1);
  continue;
 +} else if (STRPREFIX(ptr, (TM))) {
 +memmove(ptr, ptr + 4, strlen(ptr + 4) + 1);
 +continue;
  }
  
  ++ptr;

  Okay, I think it's better to have this sooner than later, first it's
a cleanup and it's also somehow an interface, if people start to use
those values it's better for them to have the cleaned up set, and I
don't see any risk.

  So pushed to git too, thanks !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] ESX [07/12]: Whitespace cleanup

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 02:43:33AM +0200, Matthias Bolte wrote:
 Subject says it all.

 diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
 index 745b744..8194b49 100644
 --- a/src/esx/esx_driver.c
 +++ b/src/esx/esx_driver.c
 @@ -752,13 +752,13 @@ esxGetHostname(virConnectPtr conn)
  }
  }
  
 -if (hostName == NULL || strlen (hostName)  1) {
 +if (hostName == NULL || strlen(hostName)  1) {
  ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
Missing or empty 'hostName' property);
  goto failure;
  }
  
 -if (domainName == NULL || strlen (domainName)  1) {
 +if (domainName == NULL || strlen(domainName)  1) {
  ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
Missing or empty 'domainName' property);
  goto failure;
 @@ -800,7 +800,7 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr 
 nodeinfo)
  int32_t numaInfo_numNodes = 0;
  char *ptr = NULL;
  
 -memset (nodeinfo, 0, sizeof (virNodeInfo));
 +memset(nodeinfo, 0, sizeof(virNodeInfo));
  
  if (priv-phantom) {
  ESX_ERROR(conn, VIR_ERR_OPERATION_INVALID,
 @@ -891,11 +891,11 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr 
 nodeinfo)
  
  /* Strip the string to fit more relevant information in 32 chars 
 */
  while (*ptr != '\0') {
 -if (STRPREFIX (ptr,   )) {
 -memmove(ptr, ptr + 1, strlen (ptr + 1) + 1);
 +if (STRPREFIX(ptr,   )) {
 +memmove(ptr, ptr + 1, strlen(ptr + 1) + 1);
  continue;
  } else if (STRPREFIX(ptr, (R)) || STRPREFIX(ptr, (C))) {
 -memmove(ptr, ptr + 3, strlen (ptr + 3) + 1);
 +memmove(ptr, ptr + 3, strlen(ptr + 3) + 1);
  continue;
  } else if (STRPREFIX(ptr, (TM))) {
  memmove(ptr, ptr + 4, strlen(ptr + 4) + 1);
 @@ -905,9 +905,9 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr 
 nodeinfo)
  ++ptr;
  }
  
 -strncpy (nodeinfo-model, dynamicProperty-val-string,
 - sizeof (nodeinfo-model) - 1);
 -nodeinfo-model[sizeof (nodeinfo-model) - 1] = '\0';
 +strncpy(nodeinfo-model, dynamicProperty-val-string,
 +sizeof(nodeinfo-model) - 1);
 +nodeinfo-model[sizeof(nodeinfo-model) - 1] = '\0';
  } else {
  VIR_WARN(Unexpected '%s' property, dynamicProperty-name);
  }
 @@ -1196,7 +1196,7 @@ esxDomainLookupByUUID(virConnectPtr conn, const 
 unsigned char *uuid)
  }
  
  if (memcmp(uuid, uuid_candidate,
 -   VIR_UUID_BUFLEN * sizeof (unsigned char)) != 0) {
 +   VIR_UUID_BUFLEN * sizeof(unsigned char)) != 0) {
  continue;
  }
  
 @@ -2732,7 +2732,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
   dynamicProperty != NULL  mask != 7  i  3;
   dynamicProperty = dynamicProperty-_next) {
  if (STREQ(dynamicProperty-name, config.cpuAllocation.reservation) 
 
 -!(mask  (1  0))) {
 +! (mask  (1  0))) {
  snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, %s,
reservation);
  
 @@ -2748,7 +2748,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
  ++i;
  } else if (STREQ(dynamicProperty-name,
   config.cpuAllocation.limit) 
 -   !(mask  (1  1))) {
 +   ! (mask  (1  1))) {
  snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, %s,
limit);
  
 @@ -2764,7 +2764,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
  ++i;
  } else if (STREQ(dynamicProperty-name,
   config.cpuAllocation.shares) 
 -   !(mask  (1  2))) {
 +   ! (mask  (1  2))) {
  snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, %s,
shares);
  
 diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
 index 38014de..7130a41 100644
 --- a/src/esx/esx_util.c
 +++ b/src/esx/esx_util.c
 @@ -271,7 +271,7 @@ esxUtil_ResolveHostname(virConnectPtr conn, const char 
 *hostname,
  struct addrinfo *result = NULL;
  int errcode;
  
 -memset(hints, 0, sizeof (struct addrinfo));
 +memset(hints, 0, sizeof(struct addrinfo));
  
  hints.ai_flags = AI_ADDRCONFIG;
  hints.ai_family = AF_INET;
 @@ -455,12 +455,12 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr 
 conf, const char *name,
  
  int
  esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
 - const char *name, int *boolval, int default_,
 + const char *name, int *boolean_, int default_,
   int optional)
  {
  virConfValuePtr value;
  
 -*boolval 

[libvirt] [PATCH] Fix win32 platform build

2009-09-14 Thread Daniel P. Berrange
* configure.in: Only define WITH_SECRETS if libvirtd is present
* src/Makefile.am: Only build secrets driver if WITH_SECRETS is
  defined. Always add SECRET_DRIVER_SOURCES to EXTRA_DIST
---
 configure.in|   11 +++
 src/Makefile.am |3 +++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 120f7e7..fad1297 100644
--- a/configure.in
+++ b/configure.in
@@ -1062,6 +1062,17 @@ AM_CONDITIONAL([WITH_NETCF], [test $with_netcf = 
yes])
 AC_SUBST([NETCF_CFLAGS])
 AC_SUBST([NETCF_LIBS])
 
+
+with_secrets=yes
+if test $with_libvirtd = no; then
+  with_secrets=no
+fi
+if test $with_secrets = yes ; then
+  AC_DEFINE_UNQUOTED([WITH_SECRETS], 1, [whether local secrets management 
driver is available])
+fi
+AM_CONDITIONAL([WITH_SECRETS], [test $with_secrets = yes])
+
+
 AC_ARG_WITH([storage-fs],
 [  --with-storage-fs   with FileSystem backend for the storage driver 
(on)],[],[with_storage_fs=check])
 AC_ARG_WITH([storage-lvm],
diff --git a/src/Makefile.am b/src/Makefile.am
index 14a3a63..69f5ee7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -461,6 +461,7 @@ endif
 libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
 endif
 
+if WITH_SECRETS
 if WITH_DRIVER_MODULES
 mod_LTLIBRARIES += libvirt_driver_secret.la
 else
@@ -471,6 +472,7 @@ if WITH_DRIVER_MODULES
 libvirt_driver_secret_la_LDFLAGS = -module -avoid-version
 endif
 libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
+endif
 
 # Needed to keep automake quiet about conditionals
 libvirt_driver_storage_la_SOURCES =
@@ -574,6 +576,7 @@ EXTRA_DIST +=   
\
$(NODE_DEVICE_DRIVER_HAL_SOURCES)   \
$(NODE_DEVICE_DRIVER_DEVKIT_SOURCES)\
$(SECURITY_DRIVER_SELINUX_SOURCES)  \
+   $(SECRET_DRIVER_SOURCES)\
$(VBOX_DRIVER_EXTRA_DIST)
 
 #
-- 
1.6.2.5

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


Re: [libvirt] [PATCH] Fix win32 platform build

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 01:32:38PM +0100, Daniel P. Berrange wrote:
 * configure.in: Only define WITH_SECRETS if libvirtd is present
 * src/Makefile.am: Only build secrets driver if WITH_SECRETS is
   defined. Always add SECRET_DRIVER_SOURCES to EXTRA_DIST
 ---
  configure.in|   11 +++
  src/Makefile.am |3 +++
  2 files changed, 14 insertions(+), 0 deletions(-)
 
 diff --git a/configure.in b/configure.in
 index 120f7e7..fad1297 100644
 --- a/configure.in
 +++ b/configure.in
 @@ -1062,6 +1062,17 @@ AM_CONDITIONAL([WITH_NETCF], [test $with_netcf = 
 yes])
  AC_SUBST([NETCF_CFLAGS])
  AC_SUBST([NETCF_LIBS])
  
 +
 +with_secrets=yes
 +if test $with_libvirtd = no; then
 +  with_secrets=no
 +fi
 +if test $with_secrets = yes ; then
 +  AC_DEFINE_UNQUOTED([WITH_SECRETS], 1, [whether local secrets management 
 driver is available])
 +fi
 +AM_CONDITIONAL([WITH_SECRETS], [test $with_secrets = yes])
 +
 +
  AC_ARG_WITH([storage-fs],
  [  --with-storage-fs   with FileSystem backend for the storage 
 driver (on)],[],[with_storage_fs=check])
  AC_ARG_WITH([storage-lvm],
 diff --git a/src/Makefile.am b/src/Makefile.am
 index 14a3a63..69f5ee7 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -461,6 +461,7 @@ endif
  libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
  endif
  
 +if WITH_SECRETS
  if WITH_DRIVER_MODULES
  mod_LTLIBRARIES += libvirt_driver_secret.la
  else
 @@ -471,6 +472,7 @@ if WITH_DRIVER_MODULES
  libvirt_driver_secret_la_LDFLAGS = -module -avoid-version
  endif
  libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
 +endif
  
  # Needed to keep automake quiet about conditionals
  libvirt_driver_storage_la_SOURCES =
 @@ -574,6 +576,7 @@ EXTRA_DIST += 
 \
   $(NODE_DEVICE_DRIVER_HAL_SOURCES)   \
   $(NODE_DEVICE_DRIVER_DEVKIT_SOURCES)\
   $(SECURITY_DRIVER_SELINUX_SOURCES)  \
 + $(SECRET_DRIVER_SOURCES)\
   $(VBOX_DRIVER_EXTRA_DIST)
  
  #

  Good catch, ACK !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


[libvirt] RFE storage cloning across connections.

2009-09-14 Thread Jóhann B. Guðmundsson

Virt-manager now supports migration and VM cloning however cloning only works 
within a connection though so you can't clone to another machine. It certainly 
would be a nice addition if supports storage cloning across connections.

Best regards.
 Jóhann B.


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


Re: [libvirt] [PATCH 1/4] Fix UUID handling in secrets/storage encryption APIs

2009-09-14 Thread Daniel P. Berrange
On Fri, Sep 11, 2009 at 08:28:59PM -0400, Miloslav Trmac wrote:
 
 - Daniel P. Berrange berra...@redhat.com wrote:
  @@ -635,49 +620,25 @@ secretLookupByUUIDString(virConnectPtr conn,
  const char *uuid)
   
   pptr = secretFind(driver, uuid);
   if (pptr == NULL) {
  +char uuidstr[VIR_UUID_STRING_BUFLEN];
  +virUUIDFormat(uuid, uuidstr);
   virSecretReportError(conn, VIR_ERR_NO_SECRET,
  - _(no secret with matching id '%s'), uuid);
  + _(no secret with matching uuid '%s'), 
  uuidstr);
   goto cleanup;
   }
   
  -ret = virGetSecret(conn, (*pptr)-def-id);
  +ret = virGetSecret(conn, (*pptr)-def-uuid);
   
   cleanup:
  +if (1) {
  +char uuidstr[VIR_UUID_STRING_BUFLEN];
  +virUUIDFormat(uuid, uuidstr);
  +VIR_ERROR(Lookup %s got %p, uuidstr, ret);
  +}
 This looks like a debug print that should be removed in the final version.

Opps, yes that's killed now


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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


Re: [libvirt] Interface driver and ESX support

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 02:57:52AM +0200, Matthias Bolte wrote:
 Okay, I finally got the patches cleaned up.
 
 I just posted this 12 patches series to the mailing list. Apply them
 all to an up to date git clone and apply the attached, updated ESX
 interface driver stub patch in the end.
 
 Patch 6 of 12 adds the binding for HostCpuIdInfo and contains the
 functions to handle ArrayOf* types.

  Okay, overall they look good to me, but at this point I would rather
add them post 0.7.1 except for a couple of cleanups, i.e. push them
tomorrow after the release,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] [PATCH 2/4] Add usage type/id as a public API property of virSecret

2009-09-14 Thread Daniel Veillard
On Fri, Sep 11, 2009 at 06:31:02PM +0100, Daniel P. Berrange wrote:
 On Fri, Sep 11, 2009 at 06:17:40PM +0200, Daniel Veillard wrote:
  On Fri, Sep 11, 2009 at 03:19:18PM +0100, Daniel P. Berrange wrote:

   +/**
   + * virSecretGetUsageType:
   + * @secret: a secret object
   + *
   + * Get the type of object which uses this secret
   + *
   + * Returns a positive integer identifying the type of object,
   + * or -1 upon error.
   + */
   +int
   +virSecretGetUsageType(virSecretPtr secret)
   +{
   +DEBUG(secret=%p, secret);
   +
   +virResetLastError();
   +
   +if (!VIR_IS_SECRET(secret)) {
   +virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
   +return (-1);
   +}
   +return (secret-usageType);
   +}
   +
   +/**
   + * virSecretGetUsageID:
   + * @secret: a secret object
   + *
   + * Get the unique identifier of the object with which this
   + * secret is to be used
   + *
   + * Returns a string identifying the object using the secret,
   + * or NULL upon error
   + */
   +const char *
   +virSecretGetUsageID(virSecretPtr secret)
   +{
   +DEBUG(secret=%p, secret);
   +
   +virResetLastError();
   +
   +if (!VIR_IS_SECRET(secret)) {
   +virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
   +return (NULL);
   +}
   +return (secret-usageID);
   +}
   +
  
Looking from the outside I find that hard to graps especially the last
  one. virSecretGetUsageID return value supposed to be an UUID , the
  comment let the user expect this but it seems to be actually free form.
  
I'm not against the patch but I think this needs some example or
  improved comments to really set properly the mechanism and expectations
  for the user. This may come after as a set of documentations, but if
  the function description could be clarified a bit this would be nice.
 
 I'll expand the API docs for this method.  It is not returning a UUID.
 I named it 'ID' to imply a arbitrary type of unique identifier since
 the format of the identifier returned by 'virSecretGetUsageID' will
 vary depending on what 'virSecretGetUsageType' shows. For a usage
 type of VIR_SECRET_USAGE_TYPE_VOLUME, the identifier will be the
 full volume file path, eg /var/lib/libvirt/images/encrypted1.img
 
 As and when we add new usage types (eg perhaps for VNC passwords, or
 SPICE credentials), then we'll define appropriate formats for their
 identifiers. 
 
 As an example, with virsh, using the virSecretGetUsageID method, it
 will now show 
 
 $ virsh secret-list
 UUID Usage
 ---
 0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f Volume 
 /home/berrange/VirtualMachines/encrypted2.img
 80cfa88e-baa3-3e6f-a2aa-12d0576bc7c5 Volume /foo/bar
 e3a9758f-b0c6-7a3a-ebb9-71a69c930289 Volume 
 /home/berrange/VirtualMachines/encrypted1.img
 e3b61a0f-714a-0b62-78c2-81eeb1d7d7a5 Unused
 
 The path bit of the usage there comes directly from the virSecretGetUsageType
 method, and also happens to match te usagevolume../volume/usage
 XML element contents.

  Okay, that clears things up ! ACK,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] Interface driver and ESX support

2009-09-14 Thread Matthias Bolte
2009/9/14 Daniel Veillard veill...@redhat.com:
 On Mon, Sep 14, 2009 at 02:57:52AM +0200, Matthias Bolte wrote:
 Okay, I finally got the patches cleaned up.

 I just posted this 12 patches series to the mailing list. Apply them
 all to an up to date git clone and apply the attached, updated ESX
 interface driver stub patch in the end.

 Patch 6 of 12 adds the binding for HostCpuIdInfo and contains the
 functions to handle ArrayOf* types.

  Okay, overall they look good to me, but at this point I would rather
 add them post 0.7.1 except for a couple of cleanups, i.e. push them
 tomorrow after the release,

 Daniel

Yep, the patches were meant to be applied after the 0.7.1 release. I
posted them now, so Shahar can use some of the new VI API bindings to
work on the ESX interface driver.

Matthias

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


Re: [libvirt] [RFC, PATCH] network: add 'netboot' option to dhcp config

2009-09-14 Thread Paolo Bonzini

On 09/11/2009 06:47 AM, Jeremy Kerr wrote:

Currently, libvirtd will start a dnsmasq process for the virtual
network, but (aside from killing the dnsmasq process and replacing it),
there's no way to define tftp boot options.

This change introduces a 'netboot' tag to the dhcp configuration:

  network
namedefault/name
bridge name=virbr%d /
forward/
ip address=192.168.122.1 netmask=255.255.255.0
  dhcp
range start=192.168.122.2 end=192.168.122.254 /
netboot root=/srv/tftp file=pxeboot.img/
  /dhcp
/ip
  /network

When root= and file= attributes are present, these are passed to the
arguments to dnsmasq:

  dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img

At present, only local tftp servers are supported (ie, dnsmasq runs as
the tftp server), but we could improve this in future by adding a
server= attribute.


Since there is only one TFTP server running in the network, it is not 
possible to specify different roots for different dhcp ranges.  I think 
the schema should be


ip address=192.168.122.1 netmask=255.255.255.0
  tftp root=/srv/tftp
  dhcp
range start=192.168.122.2 end=192.168.122.254 /
bootp file=pxeboot.img/
  /dhcp
/ip

where in the future the bootp argument could grow a server attribute as 
mentioned by Jeremy.


Paolo

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


[libvirt] [PATCH]: Bug when you try to start machines made will older VBox versions

2009-09-14 Thread Pritesh Kothari
Hi All,

Thanks to Florian, who pointed out the bug, due to which you can't start 
domains defined with older builds or with empty FRONTEND/Type tag in their 
xml files.

Fixed it in the following patch.

Regards,
Pritesh
commit 612e914a8b5902f779223f70552a16d86ede6e6f
Author: Pritesh Kothari pritesh.koth...@sun.com
Date:   Mon Sep 14 16:35:10 2009 +0200

libvirt: sessionType can't be null while calling OpenRemoteSession

diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 8024243..7270710 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2850,6 +2850,13 @@ static int vboxDomainCreate(virDomainPtr dom) {
 vrdpPresent = 1;
 }
 
+if (!vrdpPresent  !sdlPresent  !guiPresent) {
+/* if nothing is selected it means either the machine xml
+ * file is really old or some values are missing so fallback
+ */
+guiPresent = 1;
+}
+
 data-pFuncs-pfnUtf8Free(valueTypeUtf8);
 
 } else {
@@ -2882,12 +2889,12 @@ static int vboxDomainCreate(virDomainPtr dom) {
 data-pFuncs-pfnUtf8ToUtf16(vrdp, sessionType);
 }
 
-data-vboxObj-vtbl-OpenRemoteSession(data-vboxObj,
-   data-vboxSession,
-   iid,
-   sessionType,
-   env,
-   progress );
+rc = data-vboxObj-vtbl-OpenRemoteSession(data-vboxObj,
+data-vboxSession,
+iid,
+sessionType,
+env,
+progress );
 if (NS_FAILED(rc)) {
 vboxError(dom-conn, VIR_ERR_OPERATION_FAILED,
   %s, openremotesession failed, domain can't be started);
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH]: Bug when you try to start machines made will older VBox versions

2009-09-14 Thread Daniel Veillard
On Mon, Sep 14, 2009 at 04:53:32PM +0200, Pritesh Kothari wrote:
 Hi All,
 
 Thanks to Florian, who pointed out the bug, due to which you can't start 
 domains defined with older builds or with empty FRONTEND/Type tag in their 
 xml files.
 
 Fixed it in the following patch.

 Okay since it's a bug fix and based on IRC discussions it was validated
by the bug reporter, ACK, pushed to git,

 thanks !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


[libvirt] [PATCH] network: add 'bootp' and 'tftp' config

2009-09-14 Thread Paolo Bonzini
Currently, libvirtd will start a dnsmasq process for the virtual
network, but (aside from killing the dnsmasq process and replacing it),
there's no way to define tftp boot options.

This change introduces the appropriate tags to the dhcp configuration:

 network
   namedefault/name
   bridge name=virbr%d /
   forward/
   ip address=192.168.122.1 netmask=255.255.255.0
 tftp root=/var/lib/tftproot /
 dhcp
   range start=192.168.122.2 end=192.168.122.254 /
   bootp file=pxeboot.img/
 /dhcp
   /ip
 /network

When the attributes are present, these are passed to the
arguments to dnsmasq:

 dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img
   ^^^ ^^^
  from tftp / from bootp /

At present, only local tftp servers are supported (ie, dnsmasq runs as
the tftp server), but we could improve this in future by adding a
server= attribute.

Signed-off-by: Jeremy Kerr j...@ozlabs.org
Signed-off-by: Paolo Bonzini pbonz...@redhat.com

2009-09-14  Paolo Bonzini  pbonz...@redhat.com
Jeremy Kerr  j...@ozlabs.org

* docs/formatnetwork.html.in: Document new tags.
* docs/formatnetwork.html: Regenerate.
* docs/schemas/network.rng: Update.
* src/network_conf.c (virNetworkDefFree): Free new fields.
(virNetworkDHCPRangeDefParseXML): Parse bootp.
(virNetworkIPParseXML): New, parsing dhcp and tftp.
(virNetworkDefParseXML): Use virNetworkIPParseXML instead of
virNetworkDHCPRangeDefParseXML.
(virNetworkDefFormat): Pretty print new fields.
* src/network_conf.h (struct _virNetworkDef): Add netboot fields.
* src/network_driver.c (networkBuildDnsmasqArgv): Add
TFTP and BOOTP arguments.

* tests/Makefile.am (EXTRA_DIST): Add networkschemadata.
* tests/networkschematest: Look in networkschemadata.
* tests/networkschemadata/netboot-network.xml: New.
---
 docs/formatnetwork.html |   12 +-
 docs/formatnetwork.html.in  |   12 +-
 docs/schemas/network.rng|   10 
 src/network_conf.c  |   60 +-
 src/network_conf.h  |3 +
 src/network_driver.c|   14 ++
 tests/Makefile.am   |1 +
 tests/networkschemadata/netboot-network.xml |   12 +
 tests/networkschematest |2 +-
 9 files changed, 120 insertions(+), 6 deletions(-)
 create mode 100644 tests/networkschemadata/netboot-network.xml

diff --git a/docs/formatnetwork.html b/docs/formatnetwork.html
index 845e558..1f01f5d 100644
--- a/docs/formatnetwork.html
+++ b/docs/formatnetwork.html
@@ -235,7 +235,13 @@
address will be their default route. The codenetmask/code
attribute defines the significant bits of the network address,
again specified in dotted-decimal format.  span class=sinceSince 
0.3.0/span
-  /dddtcodedhcp/code/dtddImmediately within the 
codeip/code element there is an
+  /dddtcodetftp/code/dtddImmediately within
+   the codeip/code element there is an optional codetftp/code
+   element. The presence of this element and of its attribute
+   coderoot/code enables TFTP services.  The attribute specifies
+   the path to the root directory served via TFTP.
+   span class=sinceSince 0.7.1/span
+  /dddtcodedhcp/code/dtddAlso within the codeip/code 
element there is an
optional codedhcp/code element. The presence of this element
enables DHCP services on the virtual network. It will further
contain one or more coderange/code elements.
@@ -253,6 +259,10 @@
 assigned to that host (via the codeip/code attribute), and the
name to be given that host by the DHCP server (via the
 codename/code attribute).  span class=sinceSince 0.4.5/span
+  /dddtcodebootp/code/dtddThe optional codebootp/code
+   element specifies BOOTP options to be provided by the DHCP server.
+   Only one attribute is supported, codefile/code, giving the file
+   to be used for the boot image).  span class=sinceSince 0.7.1./span
   /dd/dl
 h2
   a name=examples id=examplesExample configuration/a
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index fd68430..fb93a12 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -114,7 +114,13 @@
attribute defines the significant bits of the network address,
again specified in dotted-decimal format.  span class=sinceSince 
0.3.0/span
   /dd
-  dtcodedhcp/code/dt
+  /dddtcodetftp/code/dtddImmediately within
+   the codeip/code element there is an optional codetftp/code
+   element. The presence of this element and of its attribute
+   coderoot/code enables TFTP services.  The attribute 

[libvirt] ANNOUNCE: perl bindings Sys-Virt release 0.2.2

2009-09-14 Thread Daniel P. Berrange
FYI I have just uploaded a new release 0.2.2 of the libvirt perl bindings,
Sys-Virt, to CPAN. 

  http://search.cpan.org/dist/Sys-Virt/

Direct download link 

  http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.2.2.tar.gz

Changes since 0.2.1:

 - Add all new APIs upto libvirt 0.7.0 APIs (listing defined
   network interfaces)
 - Add missing APIs for looking up storage volumes based
   on path and key
 - Fix lookup of network interfaces based on MAC address
 - Add missing APIs for defining network interfaces and
   starting defined interfaces

There will of course shortly be another release to cover the soon to be
released APIs in libvirt 0.7.1

Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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


Re: [libvirt] [RFC, PATCH] network: add 'netboot' option to dhcp config

2009-09-14 Thread Jeremy Kerr
Hi Paolo,

 Since there is only one TFTP server running in the network

IIRC, it's possible to have more than one: the Server-Name (id 66) of the DHCP 
response specifies which. However, we probably only ever want to start one 
server, so the tftp tag should work fine.

 , it is not
 possible to specify different roots for different dhcp ranges.  I think
 the schema should be
 
  ip address=192.168.122.1 netmask=255.255.255.0
tftp root=/srv/tftp
dhcp
  range start=192.168.122.2 end=192.168.122.254 /
  bootp file=pxeboot.img/
/dhcp
  /ip

If you want it to be specific to the range, shouldn't it be within the range 
tag? Currently the code will only parse one dhcp tag.

Otherwise, looks fine - I'm happy with either method.

One thing that I've tried to keep in mind is that the tftp service may be 
provided by a separate machine in the network, so we may need some way in the 
future to represent that - maybe no tftp tag, and use server=w.x.y.z in 
the bootp tag. Also, would be cool to have separate files for different hosts, 
but that may be thinking too far ahead at this stage :)

Cheers,


Jeremy

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


Re: [libvirt] [RFC, PATCH] network: add 'netboot' option to dhcp config

2009-09-14 Thread Paolo Bonzini

On 09/15/2009 01:01 AM, Jeremy Kerr wrote:

Hi Paolo,


Since there is only one TFTP server running in the network


IIRC, it's possible to have more than one: the Server-Name (id 66) of the DHCP
response specifies which. However, we probably only ever want to start one
server, so thetftp  tag should work fine.


Yes, what I meant is that in general the TFTP server started by libvirt 
will run on the address provided by /network/i...@address.  So libvirt can 
only start one TFTP server even though in the future it might support 
multiple DHCP ranges.


In this case, some ranges may not support BOOTP and some may, and they 
can give different boot files, but all must share a single 
dnsmasq-provided TFTP server (using a server attribute would be fine; 
but that TFTP server will not be started by libvirt).


This can be seen from the fact that BOOTP is nothing more than a few 
options within a DHCP packet (i.e. dhcpbootp//dhcp), but TFTP 
binds on a completely different port and could be a separate process 
(hence tftp is a sibling of dhcp).  dnsmasq is special.



, it is not
possible to specify different roots for different dhcp ranges.  I think
the schema should be

  ip address=192.168.122.1 netmask=255.255.255.0
tftp root=/srv/tftp
dhcp
  range start=192.168.122.2 end=192.168.122.254 /
  bootp file=pxeboot.img/
/dhcp
  /ip


If you want it to be specific to the range, shouldn't it be within therange
tag? Currently the code will only parse onedhcp  tag.


No, I want it to be specific to the _network_, since it will bind to 
/network/i...@address.



One thing that I've tried to keep in mind is that the tftp service may be
provided by a separate machine in the network, so we may need some way in the
future to represent that - maybe notftp  tag


That's already implemented by my patch, and can be used with an external 
TFTP server, for example started via (x)inetd.



and use server=w.x.y.z in
the bootp tag. Also, would be cool to have separate files for different hosts,
but that may be thinking too far ahead at this stage :)


Yes.  That's something you'd get for free if libvirt supported multiple 
DHCP ranges.


Paolo

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