[libvirt] [PATCH] qemu: fix regression with pinning

2012-08-27 Thread Martin Kletzander
Commit 4b03d59167f4a4c6ec57def315a61d977466e75b changed the pinning
behavior in a way that makes some machine non-startable.

The comment mentioning that we cannot control each vcpu when there is
no VCPU-PID mapping available is true, however, this isn't
necessarily an error, because this can be caused by old QEMU without
support for query-cpus command as well as a software emulated
machines that don't create more than one process.
---
 src/qemu/qemu_cgroup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 2237d11..b45bb49 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -567,9 +567,9 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, 
virDomainObjPtr vm)
 /* If we don't know VCPU-PID mapping or all vcpu runs in the same
  * thread, we cannot control each vcpu.
  */
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-_(Unable to get vcpus' pids.));
-goto cleanup;
+VIR_DEBUG(%s, _(Unable to get vcpus' pids.));
+virCgroupFree(cgroup);
+return 0;
 }

 for (i = 0; i  priv-nvcpupids; i++) {
--
1.7.12

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


[libvirt] [PATCH] virsh: fix missing return value

2012-08-27 Thread Alex Jia
Although virsh command raises a correct error information, the command status
returns 0(true), this patch is used for fixing this issue.

Signed-off-by: Alex Jia a...@redhat.com
---
 tools/virsh-host.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index da60895..2f3b413 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -701,11 +701,13 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
 judge = vshCommandOptInt(cmd, timeout, timeout);
 if (judge  0) {
 vshError(ctl, %s, _(timeout number has to be a number));
+goto cleanup;
 } else if (judge  0) {
 judge = 1;
 }
 if (judge  timeout  1) {
 vshError(ctl, %s, _(timeout must be positive));
+goto cleanup;
 }
 
 if (vshCommandOptBool(cmd, async)) {
@@ -719,6 +721,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
 
 if (judge  1) {
 vshError(ctl, %s, _(timeout, async and block options are 
exclusive));
+goto cleanup;
 }
 result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
 
-- 
1.7.1

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


Re: [libvirt] [PATCH] virsh: fix missing return value

2012-08-27 Thread Martin Kletzander
On 08/27/2012 08:07 AM, Alex Jia wrote:
 Although virsh command raises a correct error information, the command status
 returns 0(true), this patch is used for fixing this issue.
 
 Signed-off-by: Alex Jia a...@redhat.com
 ---
  tools/virsh-host.c |3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
 
 diff --git a/tools/virsh-host.c b/tools/virsh-host.c
 index da60895..2f3b413 100644
 --- a/tools/virsh-host.c
 +++ b/tools/virsh-host.c
 @@ -701,11 +701,13 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
  judge = vshCommandOptInt(cmd, timeout, timeout);
  if (judge  0) {
  vshError(ctl, %s, _(timeout number has to be a number));
 +goto cleanup;
  } else if (judge  0) {
  judge = 1;
  }
  if (judge  timeout  1) {
  vshError(ctl, %s, _(timeout must be positive));
 +goto cleanup;
  }
  
  if (vshCommandOptBool(cmd, async)) {
 @@ -719,6 +721,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
  
  if (judge  1) {
  vshError(ctl, %s, _(timeout, async and block options are 
 exclusive));
 +goto cleanup;
  }
  result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
  
 

ACK, Martin.

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


Re: [libvirt] [PATCH] virsh: fix missing return value

2012-08-27 Thread Alex Jia
Thanks and push now.

-- 
Regards, 
Alex


- Original Message -
From: Martin Kletzander mklet...@redhat.com
To: Alex Jia a...@redhat.com
Cc: libvir-list@redhat.com
Sent: Monday, August 27, 2012 2:17:00 PM
Subject: Re: [libvirt] [PATCH] virsh: fix missing return value

On 08/27/2012 08:07 AM, Alex Jia wrote:
 Although virsh command raises a correct error information, the command status
 returns 0(true), this patch is used for fixing this issue.
 
 Signed-off-by: Alex Jia a...@redhat.com
 ---
  tools/virsh-host.c |3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
 
 diff --git a/tools/virsh-host.c b/tools/virsh-host.c
 index da60895..2f3b413 100644
 --- a/tools/virsh-host.c
 +++ b/tools/virsh-host.c
 @@ -701,11 +701,13 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
  judge = vshCommandOptInt(cmd, timeout, timeout);
  if (judge  0) {
  vshError(ctl, %s, _(timeout number has to be a number));
 +goto cleanup;
  } else if (judge  0) {
  judge = 1;
  }
  if (judge  timeout  1) {
  vshError(ctl, %s, _(timeout must be positive));
 +goto cleanup;
  }
  
  if (vshCommandOptBool(cmd, async)) {
 @@ -719,6 +721,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
  
  if (judge  1) {
  vshError(ctl, %s, _(timeout, async and block options are 
 exclusive));
 +goto cleanup;
  }
  result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
  
 

ACK, Martin.

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


[libvirt] [PATCH] qemu: fix regression with spice tls port allocation

2012-08-27 Thread Martin Kletzander
In my quest for reusing variables I failed to edit one variable when
fixing details between two patch versions. That results in a failure
to start qemu with autoport and spice tls, because qemu is trying to
bind two sockets to the same port.
---
 src/qemu/qemu_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index abe6e74..7f85aea 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3500,7 +3500,7 @@ int qemuProcessStart(virConnectPtr conn,
 goto cleanup;
 }

-vm-def-graphics[0]-data.spice.tlsPort = port;
+vm-def-graphics[0]-data.spice.tlsPort = tlsPort;
 }
 }

--
1.7.12

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


Re: [libvirt] [PATCH] qemu: fix regression with spice tls port allocation

2012-08-27 Thread Peter Krempa

On 08/27/12 09:51, Martin Kletzander wrote:

In my quest for reusing variables I failed to edit one variable when
fixing details between two patch versions. That results in a failure
to start qemu with autoport and spice tls, because qemu is trying to
bind two sockets to the same port.
---
  src/qemu/qemu_process.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



ACK.

Peter

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


Re: [libvirt] [PATCH] qemu: fix regression with pinning

2012-08-27 Thread Peter Krempa

On 08/27/12 08:09, Martin Kletzander wrote:

Commit 4b03d59167f4a4c6ec57def315a61d977466e75b changed the pinning
behavior in a way that makes some machine non-startable.


s/machine/machines/


The comment mentioning that we cannot control each vcpu when there is
no VCPU-PID mapping available is true, however, this isn't
necessarily an error, because this can be caused by old QEMU without
support for query-cpus command as well as a software emulated
machines that don't create more than one process.
---
  src/qemu/qemu_cgroup.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 2237d11..b45bb49 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -567,9 +567,9 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, 
virDomainObjPtr vm)
  /* If we don't know VCPU-PID mapping or all vcpu runs in the same
   * thread, we cannot control each vcpu.
   */
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-_(Unable to get vcpus' pids.));
-goto cleanup;


Hm, the cleanup label should be named error in this function.


+VIR_DEBUG(%s, _(Unable to get vcpus' pids.));


We don't translate debug messages.

Wouldn't a VIR_WARN be better in this case? Users usualy don't have 
debug logs turned on.



+virCgroupFree(cgroup);
+return 0;
  }

  for (i = 0; i  priv-nvcpupids; i++) {


ACK when you fix the message.

Peter

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


Re: [libvirt] [PATCH] qemu: fix regression with spice tls port allocation

2012-08-27 Thread Martin Kletzander
On 08/27/2012 10:07 AM, Peter Krempa wrote:
 On 08/27/12 09:51, Martin Kletzander wrote:
 In my quest for reusing variables I failed to edit one variable when
 fixing details between two patch versions. That results in a failure
 to start qemu with autoport and spice tls, because qemu is trying to
 bind two sockets to the same port.
 ---
   src/qemu/qemu_process.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

 
 ACK.
 
 Peter
 

Thanks, pushed.

Martin

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


Re: [libvirt] [PATCH] qemu: fix regression with pinning

2012-08-27 Thread Martin Kletzander
On 08/27/2012 10:18 AM, Peter Krempa wrote:
 On 08/27/12 08:09, Martin Kletzander wrote:
 Commit 4b03d59167f4a4c6ec57def315a61d977466e75b changed the pinning
 behavior in a way that makes some machine non-startable.
 
 s/machine/machines/
 

OK, fixed.

 The comment mentioning that we cannot control each vcpu when there is
 no VCPU-PID mapping available is true, however, this isn't
 necessarily an error, because this can be caused by old QEMU without
 support for query-cpus command as well as a software emulated
 machines that don't create more than one process.
 ---
   src/qemu/qemu_cgroup.c | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)

 diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
 index 2237d11..b45bb49 100644
 --- a/src/qemu/qemu_cgroup.c
 +++ b/src/qemu/qemu_cgroup.c
 @@ -567,9 +567,9 @@ int qemuSetupCgroupForVcpu(struct qemud_driver
 *driver, virDomainObjPtr vm)
   /* If we don't know VCPU-PID mapping or all vcpu runs in
 the same
* thread, we cannot control each vcpu.
*/
 -virReportError(VIR_ERR_INTERNAL_ERROR, %s,
 -_(Unable to get vcpus' pids.));
 -goto cleanup;
 
 Hm, the cleanup label should be named error in this function.
 

Yes it should, maybe some other patch... =)

 +VIR_DEBUG(%s, _(Unable to get vcpus' pids.));
 
 We don't translate debug messages.
 
 Wouldn't a VIR_WARN be better in this case? Users usualy don't have
 debug logs turned on.
 

OK, I've changed it to:

VIR_WARN(Unable to get vcpus' pids.);

But it's hard to say if this is warning or not. Anyway, definitely
better than error.

 +virCgroupFree(cgroup);
 +return 0;
   }

   for (i = 0; i  priv-nvcpupids; i++) {
 
 ACK when you fix the message.
 

Thanks, fixed and pushed.

Martin

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


[libvirt] [PATCH] qemu: Switch to unified func name

2012-08-27 Thread Michal Privoznik
With the latest patches libvirt supports qemu agent monitor
passthrough. However, function in qemu driver is called
qemuDrvDomainAgentCommand. s/Drv// as used in all other names.
---
 src/qemu/qemu_driver.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 64c407d..3fcca0e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13815,7 +13815,7 @@ qemuListAllDomains(virConnectPtr conn,
 }
 
 static char *
-qemuDrvDomainAgentCommand(virDomainPtr domain,
+qemuDomainAgentCommand(virDomainPtr domain,
const char *cmd,
int timeout,
unsigned int flags)
@@ -14028,7 +14028,7 @@ static virDriver qemuDriver = {
 .domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */
 .qemuDomainMonitorCommand = qemuDomainMonitorCommand, /* 0.8.3 */
 .qemuDomainAttach = qemuDomainAttach, /* 0.9.4 */
-.qemuDomainArbitraryAgentCommand = qemuDrvDomainAgentCommand, /* 0.10.0 */
+.qemuDomainArbitraryAgentCommand = qemuDomainAgentCommand, /* 0.10.0 */
 .domainOpenConsole = qemuDomainOpenConsole, /* 0.8.6 */
 .domainOpenGraphics = qemuDomainOpenGraphics, /* 0.9.7 */
 .domainInjectNMI = qemuDomainInjectNMI, /* 0.9.2 */
-- 
1.7.8.6

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


Re: [libvirt] [PATCH] qemu: Switch to unified func name

2012-08-27 Thread Alex Jia
ACK.

-- 
Regards, 
Alex


- Original Message -
From: Michal Privoznik mpriv...@redhat.com
To: libvir-list@redhat.com
Sent: Monday, August 27, 2012 4:49:43 PM
Subject: [libvirt] [PATCH] qemu: Switch to unified func name

With the latest patches libvirt supports qemu agent monitor
passthrough. However, function in qemu driver is called
qemuDrvDomainAgentCommand. s/Drv// as used in all other names.
---
 src/qemu/qemu_driver.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 64c407d..3fcca0e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13815,7 +13815,7 @@ qemuListAllDomains(virConnectPtr conn,
 }
 
 static char *
-qemuDrvDomainAgentCommand(virDomainPtr domain,
+qemuDomainAgentCommand(virDomainPtr domain,
const char *cmd,
int timeout,
unsigned int flags)
@@ -14028,7 +14028,7 @@ static virDriver qemuDriver = {
 .domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */
 .qemuDomainMonitorCommand = qemuDomainMonitorCommand, /* 0.8.3 */
 .qemuDomainAttach = qemuDomainAttach, /* 0.9.4 */
-.qemuDomainArbitraryAgentCommand = qemuDrvDomainAgentCommand, /* 0.10.0 */
+.qemuDomainArbitraryAgentCommand = qemuDomainAgentCommand, /* 0.10.0 */
 .domainOpenConsole = qemuDomainOpenConsole, /* 0.8.6 */
 .domainOpenGraphics = qemuDomainOpenGraphics, /* 0.9.7 */
 .domainInjectNMI = qemuDomainInjectNMI, /* 0.9.2 */
-- 
1.7.8.6

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

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


[libvirt] [PATCH] rpc: fix segmentation fault caused by null client-sock

2012-08-27 Thread Guannan Ren
BZ:https://bugzilla.redhat.com/show_bug.cgi?id=851423
The client-sock could have been set to NULL by eventloop thread
after async event fired.
---
 src/rpc/virnetclient.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 4ecc703..43a9814 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -644,7 +644,8 @@ virNetClientMarkClose(virNetClientPtr client,
   int reason)
 {
 VIR_DEBUG(client=%p, reason=%d, client, reason);
-virNetSocketRemoveIOCallback(client-sock);
+if (client-sock)
+virNetSocketRemoveIOCallback(client-sock);
 client-wantClose = true;
 client-closeReason = reason;
 }
-- 
1.7.11.4

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


Re: [libvirt] [PATCH] rpc: fix segmentation fault caused by null client-sock

2012-08-27 Thread Martin Kletzander
On 08/27/2012 11:09 AM, Guannan Ren wrote:
 BZ:https://bugzilla.redhat.com/show_bug.cgi?id=851423
 The client-sock could have been set to NULL by eventloop thread
 after async event fired.
 ---
  src/rpc/virnetclient.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
 index 4ecc703..43a9814 100644
 --- a/src/rpc/virnetclient.c
 +++ b/src/rpc/virnetclient.c
 @@ -644,7 +644,8 @@ virNetClientMarkClose(virNetClientPtr client,
int reason)
  {
  VIR_DEBUG(client=%p, reason=%d, client, reason);
 -virNetSocketRemoveIOCallback(client-sock);
 +if (client-sock)
 +virNetSocketRemoveIOCallback(client-sock);
  client-wantClose = true;
  client-closeReason = reason;
  }
 

ACK,

Martin

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


Re: [libvirt] Libvirt 0.10.0-rc1 segfaults when daemon run as root

2012-08-27 Thread Guannan Ren

On 08/24/2012 08:16 PM, Shawn Furrow wrote:

Hi all,

For some reason when I run libvirtd -d as root it seems to not 
start. I investigate by running libvirtd -v as root and I get a 
segfault. Here is the output:


2012-08-23 19:01:23.237+: 27464: info : libvirt version: 0.10.0
2012-08-23 19:01:23.237+: 27464: error :
virDriverLoadModule:78 : failed to load module
/usr/local/lib/libvirt/connection-driver/libvirt_driver_qemu.so
/usr/local/lib/libvirt/connection-driver/libvirt_driver_qemu.so:
undefined symbol: virSecurityManagerGetProcessLabel
2012-08-23 19:01:23.238+: 27464: error :
virDriverLoadModule:78 : failed to load module
/usr/local/lib/libvirt/connection-driver/libvirt_driver_lxc.so
/usr/local/lib/libvirt/connection-driver/libvirt_driver_lxc.so:
undefined symbol: virSecurityManagerGetProcessLabel
Caught Segmentation violation dumping internal log buffer:

== start of log =
2012-08-23 19:01:23.235+27464: debug : main:1120 : Decided on
pid file path '/usr/local/var/run/libvirtd.pid'
2012-08-23 19:01:23.235+27464: debug : main:1130 : Decided on
socket paths '/usr/local/var/run/libvirt/libvirt-sock' and
'/usr/local/var/run/libvirt/libvirt-sock-ro'
2012-08-23 19:01:23.235+27464: debug : main:1168 : Ensuring
run dir '/usr/local/var/run/libvirt' exists
2012-08-23 19:01:23.235+27464: debug :
virEventRegisterDefaultImpl:204 : registering default event
implementation
2012-08-23 19:01:23.235+27464: debug :
virEventPollAddHandle:111 : Used 0 handle slots, adding at least
10 more
2012-08-23 19:01:23.235+27464: debug :
virEventPollInterruptLocked:697 : Skip interrupt, 0 0
2012-08-23 19:01:23.236+27464: debug :
virEventPollAddHandle:136 : EVENT_POLL_ADD_HANDLE: watch=1 fd=5
events=1 cb=0x7f323cd415a0 opaque=(nil) ff=(nil)
2012-08-23 19:01:23.236+27464: debug :
virEventRegisterImpl:177 : addHandle=0x7f323cd423d0
updateHandle=0x7f323cd414a0 removeHandle=0x7f323cd41360
addTimeout=0x7f323cd42220 updateTimeout=0x7f323cd415e0
removeTimeout=0x7f323cd41260
2012-08-23 19:01:23.236+27464: debug : virNetServerNew:407 :
srv=0xdd8890 refs=1
2012-08-23 19:01:23.236+27464: debug : main:1206 : Dropping
privileges (if required)
2012-08-23 19:01:23.236+27464: debug :
virDriverModuleInitialize:53 : Module dir
/usr/local/lib/libvirt/connection-driver
2012-08-23 19:01:23.236+27464: debug : virDriverLoadModule:66
: Module load network
2012-08-23 19:01:23.236+27464: debug :
virRegisterNetworkDriver:564 : registering Network as network driver 4
2012-08-23 19:01:23.236+27464: debug : virDriverLoadModule:66
: Module load storage
2012-08-23 19:01:23.236+27464: debug :
virRegisterStorageDriver:624 : registering storage as storage driver 4
2012-08-23 19:01:23.236+27464: debug : virDriverLoadModule:66
: Module load secret
2012-08-23 19:01:23.237+27464: debug :
virRegisterSecretDriver:684 : registering secret as secret driver 3
2012-08-23 19:01:23.237+27464: debug : virDriverLoadModule:66
: Module load nwfilter
2012-08-23 19:01:23.237+27464: debug :
virRegisterNWFilterDriver:714 : registering nwfilter as network
filter driver 3
2012-08-23 19:01:23.237+27464: debug : virDriverLoadModule:66
: Module load qemu
2012-08-23 19:01:23.237+27464: error : virDriverLoadModule:78
: failed to load module
/usr/local/lib/libvirt/connection-driver/libvirt_driver_qemu.so
/usr/local/lib/libvirt/connection-driver/libvirt_driver_qemu.so:
undefined symbol: virSecurityManagerGetProcessLabel
2012-08-23 19:01:23.238+27464: debug : virDriverLoadModule:66
: Module load lxc
2012-08-23 19:01:23.238+27464: error : virDriverLoadModule:78
: failed to load module
/usr/local/lib/libvirt/connection-driver/libvirt_driver_lxc.so
/usr/local/lib/libvirt/connection-driver/libvirt_driver_lxc.so:
undefined symbol: virSecurityManagerGetProcessLabel
2012-08-23 19:01:23.238+27464: debug : virDriverLoadModule:66
: Module load uml
2012-08-23 19:01:23.238+27464: debug : virRegisterDriver:732 :
driver=0x7f3232ec7760 name=UML
2012-08-23 19:01:23.238+27464: debug : virRegisterDriver:747 :
registering UML as driver 6
2012-08-23 19:01:23.238+27464: debug : virDriverLoadModule:66
: Module load xen
2012-08-23 19:01:23.239+27464: debug : virRegisterDriver:732 :
driver=0x7f3232caad00 name=Xen
2012-08-23 19:01:23.239+27464: debug : virRegisterDriver:747 :
registering Xen as driver 7
2012-08-23 19:01:23.239+27464: debug :
virNetServerProgramNew:63 : prog=0xddca40 refs=1
2012-08-23 19:01:23.239+27464: debug :
virNetServerProgramRef:84 : prog=0xddca40 refs=2
2012-08-23 19:01:23.239+27464: debug 

Re: [libvirt] [PATCH] rpc: fix segmentation fault caused by null client-sock

2012-08-27 Thread Guannan Ren

On 08/27/2012 05:20 PM, Martin Kletzander wrote:

On 08/27/2012 11:09 AM, Guannan Ren wrote:

BZ:https://bugzilla.redhat.com/show_bug.cgi?id=851423
The client-sock could have been set to NULL by eventloop thread
after async event fired.
---
  src/rpc/virnetclient.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 4ecc703..43a9814 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -644,7 +644,8 @@ virNetClientMarkClose(virNetClientPtr client,
int reason)
  {
  VIR_DEBUG(client=%p, reason=%d, client, reason);
-virNetSocketRemoveIOCallback(client-sock);
+if (client-sock)
+virNetSocketRemoveIOCallback(client-sock);
  client-wantClose = true;
  client-closeReason = reason;
  }


ACK,

Martin


Thanks Martin
pushed.

Guannan

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


Re: [libvirt] [PATCH] qemu: Switch to unified func name

2012-08-27 Thread Michal Privoznik
On 27.08.2012 10:55, Alex Jia wrote:
 ACK.
 

Thanks, pushed.

Michal

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


Re: [libvirt] [Libvirt-announce] Availability of 0.10.0 release candidate 2

2012-08-27 Thread Justin Clift
On 27/08/2012, at 1:00 PM, Daniel Veillard wrote:
  I tagged the rc2 in the git tree and pushed tarball and rpms to
 the usual place:
  ftp://libvirt.org/libvirt/
 
 it should include the various fixes that were made on top of rc1
 and fix the compilation problem exposed on OS-X, as well as picking
 libnl3 if available,
 
  please give it a try and report, I am still shooting for a final
 release this Wednesday,

Still a no go on OSX.  Different error this time:

  ...
  libvirtd.c: In function 'main':
  libvirtd.c:1316: error: 'NETLINK_ROUTE' undeclared (first use in this 
function)
  libvirtd.c:1316: error: (Each undeclared identifier is reported only once
  libvirtd.c:1316: error: for each function it appears in.)
  libvirtd.c:1322: error: 'NETLINK_KOBJECT_UEVENT' undeclared (first use in 
this function)
  make[3]: *** [libvirtd-libvirtd.o] Error 1
  make[3]: *** Waiting for unfinished jobs

Any ideas?

+ Justin

--
Aeolus Community Manager
http://www.aeolusproject.org


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


[libvirt] [test-API][PATCH v2] utils: Update remote_exec_pexpect function and sync cases

2012-08-27 Thread Wayne Sun
After delete duplicate remote_exec_pexect function, the left function
with same name causes some problem with cases, so update the function
and sync all cases using it.

Signed-off-by: Wayne Sun g...@redhat.com
---
 repos/domain/cpu_topology.py |2 +-
 repos/snapshot/file_flag.py  |8 
 repos/snapshot/flag_check.py |   12 ++--
 utils/utils.py   |   28 ++--
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/repos/domain/cpu_topology.py b/repos/domain/cpu_topology.py
index 5f4ef52..cb071c9 100644
--- a/repos/domain/cpu_topology.py
+++ b/repos/domain/cpu_topology.py
@@ -136,7 +136,7 @@ def cpu_topology_chk(ip, username, password,
 int = 0
 actual_thread = actual_core = actual_socket = ''
 
-for item in output.strip().split('\r'):
+for item in output.split('\r'):
 if int == 5:
 actual_thread = item.split()[-1]
 logger.info(the actual thread in the guest is %s % actual_thread)
diff --git a/repos/snapshot/file_flag.py b/repos/snapshot/file_flag.py
index e18975e..001f13c 100644
--- a/repos/snapshot/file_flag.py
+++ b/repos/snapshot/file_flag.py
@@ -34,12 +34,12 @@ def check_domain_running(conn, guestname, logger):
 
 def make_flag(ipaddr, username, password, logger):
  enter guest OS, create a file in /tmp folder 
-ret = utils.remote_exec_pexpect(ipaddr, username, password, MAKE_FLAG)
-if ret == TIMEOUT!!!:
+ret, out = utils.remote_exec_pexpect(ipaddr, username, password, MAKE_FLAG)
+if ret:
 logger.error(connecting to guest OS timeout)
 return False
-elif ret != '':
-logger.error(failed to make flag in guest OS, %s % ret)
+elif out != '':
+logger.error(failed to make flag in guest OS, %s % out)
 return False
 else:
 logger.info(flag %s is created in /tmp folder % FLAG_FILE)
diff --git a/repos/snapshot/flag_check.py b/repos/snapshot/flag_check.py
index 41314d8..f0ddecf 100644
--- a/repos/snapshot/flag_check.py
+++ b/repos/snapshot/flag_check.py
@@ -68,20 +68,20 @@ def flag_check(params):
 logger.info(vm %s failed to get ip address % guestname)
 return 1
 
-ret = utils.remote_exec_pexpect(ipaddr, username, password, FLAG_CHECK)
-if ret == TIMEOUT!!!:
+ret, out = utils.remote_exec_pexpect(ipaddr, username, password, 
FLAG_CHECK)
+if ret:
 logger.error(connecting to guest OS timeout)
 return 1
-elif ret == FLAG_FILE and expected_result == exist:
+elif out == FLAG_FILE and expected_result == exist:
 logger.info(checking flag %s in guest OS succeeded % FLAG_FILE)
 return 0
-elif ret == FLAG_FILE and expected_result == 'noexist':
+elif out == FLAG_FILE and expected_result == 'noexist':
 logger.error(flag %s still exist, FAILED. % FLAG_FILE)
 return 1
-elif ret != None and expected_result == exist:
+elif out != None and expected_result == exist:
 logger.error(no flag %s exists in the guest %s  % 
(FLAG_FILE,guestname))
 return 1
-elif ret != None and expected_result == 'noexist':
+elif out != None and expected_result == 'noexist':
 logger.info(flag %s is not present, checking succeeded % FLAG_FILE)
 return 0
 
diff --git a/utils/utils.py b/utils/utils.py
index 27ddbc2..e242847 100644
--- a/utils/utils.py
+++ b/utils/utils.py
@@ -427,10 +427,10 @@ def remote_exec_pexpect(hostname, username, password, 
cmd):
 child.sendline(password)
 elif index == 2:
 child.close()
-return 0, child.before
+return 0, string.strip(child.before)
 elif index == 3:
 child.close()
-return 1, 
+return 1, Timeout
 
 return 0
 
@@ -531,8 +531,8 @@ def get_remote_memory(hostname, username, password):
 i = 0
 while i  3:
 i += 1
-memsize = \
-int(remote_exec_pexpect(hostname, username, password, cmd)) * 1024
+ret, out = remote_exec_pexpect(hostname, username, password, cmd)
+memsize = int(out) * 1024
 if memsize == -1:
 continue
 else:
@@ -595,10 +595,10 @@ def libvirt_version(latest_ver = ''):
 def create_dir(hostname, username, password):
 Create new dir
 cmd = mkdir /tmp/test
-mkdir_ret = remote_exec_pexpect(hostname, username, password, cmd)
+ret, mkdir_ret = remote_exec_pexpect(hostname, username, password, cmd)
 if mkdir_ret == '':
 cmd = ls -d /tmp/test
-check_str = remote_exec_pexpect(hostname, username,
+ret, check_str = remote_exec_pexpect(hostname, username,
  password, cmd)
 if check_str == /tmp/test:
 return 0
@@ -613,11 +613,11 @@ def write_file(hostname, username, password):
 Simple test for writting file on specified host
 test_string = 'hello word testing'
 cmd = echo '%s'/tmp/test/test.log % 

[libvirt] [test-API][PATCH] Fix a typo in commit b111531

2012-08-27 Thread Wayne Sun
Signed-off-by: Wayne Sun g...@redhat.com
---
 src/env_inspect.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/env_inspect.py b/src/env_inspect.py
index cf036f7..222ffb1 100644
--- a/src/env_inspect.py
+++ b/src/env_inspect.py
@@ -77,7 +77,7 @@ def sharemod_init(env_parser, logger):
 username = env_parser.get_value('variables', 'username')
 password = env_parser.get_value('variables', 'password')
 conn = utils.get_conn(uri, username, password)
-if not conn
+if not conn:
 return 1
 
 # initialize conn object in sharedmod
-- 
1.7.1

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


[libvirt] [PATCH 2/2] qemu_agent: Switch to virReportSystemError() on system error

2012-08-27 Thread Michal Privoznik
Currently, if a syscall in qemu_agent.c fails we report an internal
error even though we should be reporting the system error.
---
 src/qemu/qemu_agent.c |   30 --
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index ba29783..aaff9fc 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -191,14 +191,16 @@ qemuAgentOpenUnix(const char *monitor, pid_t cpid, bool 
*inProgress)
 }
 
 if (virSetNonBlock(monfd)  0) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   %s, _(Unable to put monitor into non-blocking 
mode));
+virReportSystemError(errno, %s,
+ _(Unable to put monitor 
+   into non-blocking mode));
 goto error;
 }
 
 if (virSetCloseExec(monfd)  0) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   %s, _(Unable to set monitor close-on-exec flag));
+virReportSystemError(errno, %s,
+ _(Unable to set monitor 
+   close-on-exec flag));
 goto error;
 }
 
@@ -256,14 +258,14 @@ qemuAgentOpenPty(const char *monitor)
 int monfd;
 
 if ((monfd = open(monitor, O_RDWR | O_NONBLOCK))  0) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   _(Unable to open monitor path %s), monitor);
+virReportSystemError(errno,
+ _(Unable to open monitor path %s), monitor);
 return -1;
 }
 
 if (virSetCloseExec(monfd)  0) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   %s, _(Unable to set monitor close-on-exec flag));
+virReportSystemError(errno, %s,
+ _(Unable to set monitor close-on-exec flag));
 goto error;
 }
 
@@ -733,14 +735,14 @@ qemuAgentOpen(virDomainObjPtr vm,
 return NULL;
 
 if (virMutexInit(mon-lock)  0) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(cannot initialize monitor mutex));
+virReportSystemError(errno, %s,
+ _(cannot initialize monitor mutex));
 VIR_FREE(mon);
 return NULL;
 }
 if (virCondInit(mon-notify)  0) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(cannot initialize monitor condition));
+virReportSystemError(errno, %s,
+ _(cannot initialize monitor condition));
 virMutexDestroy(mon-lock);
 VIR_FREE(mon);
 return NULL;
@@ -884,8 +886,8 @@ static int qemuAgentSend(qemuAgentPtr mon,
_(Guest agent not available for now));
 ret = -2;
 } else {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(Unable to wait on monitor condition));
+virReportSystemError(errno, %s,
+ _(Unable to wait on monitor condition));
 }
 goto cleanup;
 }
-- 
1.7.8.6

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


[libvirt] [PATCH 1/2] Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code

2012-08-27 Thread Michal Privoznik
Currently, when guest agent is configure but not responsive
(e.g. due to appropriate service not running in the guest)
we return VIR_ERR_INTERNAL_ERROR or VIR_ERR_ARGUMENT_UNSUPPORTED.
Both are wrong. Therefore we need to introduce new error code
to reflect this case.
---
 include/libvirt/virterror.h |2 ++
 src/qemu/qemu_agent.c   |2 +-
 src/qemu/qemu_driver.c  |   24 ++--
 src/util/virterror.c|7 +++
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 69c64aa..5140c38 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -283,6 +283,8 @@ typedef enum {
 VIR_ERR_OPERATION_UNSUPPORTED = 84, /* The requested operation is not
supported */
 VIR_ERR_SSH = 85,   /* error in ssh transport driver */
+VIR_ERR_AGENT_UNRESPONSIVE = 86,/* guest agent is unresponsive,
+   not running or not usable */
 } virErrorNumber;
 
 /**
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index c658bf8..ba29783 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -880,7 +880,7 @@ static int qemuAgentSend(qemuAgentPtr mon,
 if ((timeout  virCondWaitUntil(mon-notify, mon-lock, then)  0) 
||
 (!timeout  virCondWait(mon-notify, mon-lock)  0)) {
 if (errno == ETIMEDOUT) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
_(Guest agent not available for now));
 ret = -2;
 } else {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3fcca0e..f64d9ec 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1734,8 +1734,9 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, 
unsigned int flags) {
 
 if (useAgent) {
 if (priv-agentError) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(QEMU guest agent is not available due to an 
error));
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
+   _(QEMU guest agent is not 
+ available due to an error));
 goto cleanup;
 }
 if (!priv-agent) {
@@ -1815,8 +1816,9 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
 
 if (useAgent) {
 if (priv-agentError) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(QEMU guest agent is not available due to an 
error));
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
+   _(QEMU guest agent is not 
+ available due to an error));
 goto cleanup;
 }
 if (!priv-agent) {
@@ -10391,7 +10393,7 @@ qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
 int freezed;
 
 if (priv-agentError) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
_(QEMU guest agent is not 
  available due to an error));
 return -1;
@@ -10419,7 +10421,7 @@ qemuDomainSnapshotFSThaw(struct qemud_driver *driver,
 
 if (priv-agentError) {
 if (report)
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
_(QEMU guest agent is not 
  available due to an error));
 return -1;
@@ -13708,8 +13710,9 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
 }
 
 if (priv-agentError) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(QEMU guest agent is not available due to an error));
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
+   _(QEMU guest agent is not 
+ available due to an error));
 goto cleanup;
 }
 
@@ -13849,8 +13852,9 @@ qemuDomainAgentCommand(virDomainPtr domain,
 }
 
 if (priv-agentError) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(QEMU guest agent is not available due to an error));
+virReportError(VIR_ERR_AGENT_UNRESPONSIVE, %s,
+   _(QEMU guest agent is not 
+ available due to an error));
 goto cleanup;
 }
 
diff --git a/src/util/virterror.c b/src/util/virterror.c
index 3ee2ae0..7caa69e 100644
--- a/src/util/virterror.c
+++ b/src/util/virterror.c
@@ -1199,6 +1199,13 @@ virErrorMsg(virErrorNumber error, const char *info)
 errmsg = _(SSH transport error);
 else
 errmsg = _(SSH transport error: %s);
+break;
+case VIR_ERR_AGENT_UNRESPONSIVE:
+if (info == NULL)
+errmsg = _(Guest agent 

Re: [libvirt] [PATCH 1/2] Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code

2012-08-27 Thread Martin Kletzander
On 08/27/2012 01:57 PM, Michal Privoznik wrote:
 Currently, when guest agent is configure but not responsive

s/configure/configured/

 (e.g. due to appropriate service not running in the guest)
 we return VIR_ERR_INTERNAL_ERROR or VIR_ERR_ARGUMENT_UNSUPPORTED.

There is no VIR_ERR_ARGUMENT_UNSUPPORTED in the patch.

 Both are wrong. Therefore we need to introduce new error code
 to reflect this case.
 ---

ACK with the commit message fixed,

Martin

P.S.: Looks like a nice start of the 'INTERNAL_ERROR' usage abusement ;)

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


Re: [libvirt] [PATCH 2/2] qemu_agent: Switch to virReportSystemError() on system error

2012-08-27 Thread Martin Kletzander
On 08/27/2012 01:57 PM, Michal Privoznik wrote:
 Currently, if a syscall in qemu_agent.c fails we report an internal
 error even though we should be reporting the system error.

s/the/a/

ACK,

Martin

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


[libvirt] [PATCH] conf: prevent NULL pointer access in virSecurityLabelDefsParseXML

2012-08-27 Thread Ján Tomko
When checking for seclabels without security models, def-nseclabels is
already set to n. In the case of an error def-seclabels is freed but
nseclabels is left untouched. This leads to a segmentation fault when
def is freed in virDomainDefParseXML.
---
 src/conf/domain_conf.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 82ccf4d..c02d6f8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3179,6 +3179,7 @@ error:
 virSecurityLabelDefFree(def-seclabels[i - 1]);
 }
 VIR_FREE(def-seclabels);
+def-nseclabels = 0;
 VIR_FREE(list);
 return -1;
 }
-- 
1.7.8.6

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


Re: [libvirt] [PATCH] conf: prevent NULL pointer access in virSecurityLabelDefsParseXML

2012-08-27 Thread Peter Krempa

On 08/27/12 14:51, Ján Tomko wrote:

When checking for seclabels without security models, def-nseclabels is
already set to n. In the case of an error def-seclabels is freed but
nseclabels is left untouched. This leads to a segmentation fault when
def is freed in virDomainDefParseXML.
---
  src/conf/domain_conf.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)



ACK  pushed.

Peter

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


[libvirt] Regression issues with libvirt DAC isolation

2012-08-27 Thread Marcelo Cerri

Hi,

I was notified that the latest patches for libvirt DAC isolation is 
causing some regression issues. I'm working on fixes for it but I have 
some doubts of how I should handle some scenarios. I'd appreciate some 
suggestions:


* Item 3.2: this is a test case that uses only SELinux driver, but 
seclabels for both DAC and SELinux are dumped in guest's XML. Before my 
patches, libvirt already made use of DAC driver when running in 
privileged mode, but this wasn't reflected in guest's XML. I tried to 
keep the same behavior and libvirt still adds DAC driver when running in 
privileged mode, but I didn't realize this would impact in guest's XML. 
So, I'm thinking about two alternatives:


 1. Simply do not add the DAC driver when running in privileged mode.
 2. Keep it as it  is. Probably applications that parse guest's XML 
will continue to run without problems if they just consider the first 
security label.


* Item 4.1: an error is issued because model is not defined for a 
seclabel inside a device definition. model is used to differentiate each 
label and should only be required when more than one security driver is 
used. The problem here is related to the one in item 3.2, DAC was 
implicitly added because libvirt is running in privileged mode and so we 
have 2 drivers in use.


I can use the order that seclabels appears in XML to match with the 
order that security drivers appears in qemu.conf to avoid this kind of 
error. What do you think of this solution?


Regards,
Marcelo

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


[libvirt] [PATCH] docs: CPU allocation and pinning clarification

2012-08-27 Thread Martin Kletzander
There was a request for clarifying this part of the
documentation. This also fixes a case used with CPU.
---
 docs/formatdomain.html.in | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e671e36..468fc62 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -369,7 +369,8 @@
 if it's specified. If both codecpuset/code and 
codeplacement/code
 are not specified, or if codeplacement/code is static, but no
 codecpuset/code is specified, the domain process will be pinned to
-all the available physical CPUs.
+all the available physical CPUs. These settings can be superseded
+by a href=#elementsCPUTuningCPU tuning/a.
   /dd
 /dl

@@ -404,9 +405,11 @@
   /dd
   dtcodevcpupin/code/dt
   dd
-The optional codevcpupin/code element specifies which of host
-physical CPUS the domain VCPU will be pinned to. If this is omitted,
-each VCPU is pinned to all the physical CPUS by default. It contains 
two
+The optional codevcpupin/code element specifies which of host's
+physical CPUs the domain VCPU will be pinned to. This setting 
supersedes
+previous VCPU placement specified in a 
href=#elementsCPUAllocationCPU
+Allocation/a using codevcpu/code element. If this is omitted,
+each VCPU is pinned to all the physical CPUs by default. It contains 
two
 required attributes, the attribute codevcpu/code specifies vcpu id,
 and the attribute codecpuset/code is same as
 attribute codecpuset/code
-- 
1.7.12

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


Re: [libvirt] [PATCH libvirt-glib] Don't hold events lock when dispatching free callbacks

2012-08-27 Thread Christophe Fergeau
On Mon, Aug 20, 2012 at 04:14:52PM +0100, Daniel P. Berrange wrote:
 From: Daniel P. Berrange berra...@redhat.com
 
 The _event_timeout_remove and _event_handle_remove methods
 were holding onto the global lock when invoking the free
 callback. This is a violation of the libvirt events API
 contract which requires free callbacks to be invoked in
 a re-entrant safe context.

Is it a possible fix for the infamous boxes issue where it sometimes stop
getting events from libvirt? Regardless of that, nice catch!

Christophe


pgprwgJ9h1Uty.pgp
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Can I disable the network filter function in libvirt?

2012-08-27 Thread Zhihong Wang
Dear all:

Can I disable the network filter function in libvirt since the xen driver
of libvirt doesn't support the function at all?
If I can,  what configuration should be made and how to make that come true
? to disable that function
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] qemu: Fix define logic

2012-08-27 Thread Michal Privoznik
With current flow in qemudDomainDefine we might loose data
when updating an existing domain. We parse given XML and
overwrite the configuration.  Then we try to save the new
config. However, this step may fail and we don't perform any
roll back.  In fact, we remove the domain from the list of
domains held up by qemu driver. This is okay as long as the
domain was brand new one.
---

The easiest steps to reproduce:
https://bugzilla.redhat.com/show_bug.cgi?id=851963

 src/qemu/qemu_driver.c |   43 ---
 1 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3fcca0e..e760ed9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5538,6 +5538,7 @@ out:
 static virDomainPtr qemudDomainDefine(virConnectPtr conn, const char *xml) {
 struct qemud_driver *driver = conn-privateData;
 virDomainDefPtr def;
+virDomainDefPtr def_backup = NULL;
 virDomainObjPtr vm = NULL;
 virDomainPtr dom = NULL;
 virDomainEventPtr event = NULL;
@@ -5561,20 +5562,48 @@ static virDomainPtr qemudDomainDefine(virConnectPtr 
conn, const char *xml) {
 if (qemuDomainAssignAddresses(def, NULL, NULL)  0)
 goto cleanup;
 
-if (!(vm = virDomainAssignDef(driver-caps,
-  driver-domains,
-  def, false))) {
-goto cleanup;
+/* We need to differentiate two cases:
+ * a) updating an existing domain - must preserve previous definition
+ *  so we can roll back if something fails
+ * b) defining a brand new domain - virDomainAssignDef is just sufficient
+ */
+if ((vm = virDomainFindByUUID(driver-domains, def-uuid))) {
+if (virDomainObjIsActive(vm)) {
+def_backup = vm-newDef;
+vm-newDef = def;
+} else {
+def_backup = vm-def;
+vm-def = def;
+}
+} else {
+if (!(vm = virDomainAssignDef(driver-caps,
+  driver-domains,
+  def, false))) {
+goto cleanup;
+}
 }
 def = NULL;
 vm-persistent = 1;
 
 if (virDomainSaveConfig(driver-configDir,
 vm-newDef ? vm-newDef : vm-def)  0) {
-VIR_INFO(Defining domain '%s', vm-def-name);
-qemuDomainRemoveInactive(driver, vm);
-vm = NULL;
+if (def_backup) {
+/* There is backup so this VM was defined before.
+ * Just restore the backup. */
+VIR_INFO(Restoring domain '%s' definition, vm-def-name);
+if (virDomainObjIsActive(vm))
+vm-newDef = def_backup;
+else
+vm-def = def_backup;
+} else {
+/* Brand new domain. Remove it */
+VIR_INFO(Deleting domain '%s', vm-def-name);
+qemuDomainRemoveInactive(driver, vm);
+vm = NULL;
+}
 goto cleanup;
+} else {
+virDomainDefFree(def_backup);
 }
 
 event = virDomainEventNewFromObj(vm,
-- 
1.7.8.6

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


Re: [libvirt] [PATCH 1/2] Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code

2012-08-27 Thread Michal Privoznik
On 27.08.2012 14:11, Martin Kletzander wrote:
 On 08/27/2012 01:57 PM, Michal Privoznik wrote:
 Currently, when guest agent is configure but not responsive
 
 s/configure/configured/
 
 (e.g. due to appropriate service not running in the guest)
 we return VIR_ERR_INTERNAL_ERROR or VIR_ERR_ARGUMENT_UNSUPPORTED.
 
 There is no VIR_ERR_ARGUMENT_UNSUPPORTED in the patch.
 
 Both are wrong. Therefore we need to introduce new error code
 to reflect this case.
 ---
 
 ACK with the commit message fixed,

Thanks. I think this is a bug fix rather than enhancement so I've pushed
the whole series. Thanks.

Michal

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


Re: [libvirt] [Libvirt-announce] Availability of 0.10.0 release candidate 2

2012-08-27 Thread Doug Goldstein
On Mon, Aug 27, 2012 at 4:57 AM, Justin Clift jcl...@redhat.com wrote:
 On 27/08/2012, at 1:00 PM, Daniel Veillard wrote:
  I tagged the rc2 in the git tree and pushed tarball and rpms to
 the usual place:
  ftp://libvirt.org/libvirt/

 it should include the various fixes that were made on top of rc1
 and fix the compilation problem exposed on OS-X, as well as picking
 libnl3 if available,

  please give it a try and report, I am still shooting for a final
 release this Wednesday,

 Still a no go on OSX.  Different error this time:

   ...
   libvirtd.c: In function 'main':
   libvirtd.c:1316: error: 'NETLINK_ROUTE' undeclared (first use in this 
 function)
   libvirtd.c:1316: error: (Each undeclared identifier is reported only once
   libvirtd.c:1316: error: for each function it appears in.)
   libvirtd.c:1322: error: 'NETLINK_KOBJECT_UEVENT' undeclared (first use in 
 this function)
   make[3]: *** [libvirtd-libvirtd.o] Error 1
   make[3]: *** Waiting for unfinished jobs

 Any ideas?

 + Justin


You can try something like the following to get you a little farther
and see if it fails farther on. Just trying to see if we can get Mac
OS X built and see what changes need to happen before 0.10.0 goes out
final, not necessary proper patches just yet.

diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
index 1982dae..c3f3e81 100644
--- a/src/util/virnetlink.h
+++ b/src/util/virnetlink.h
@@ -34,6 +34,9 @@ struct nl_msg;
 struct sockaddr_nl;
 struct nlattr;

+#define NETLINK_ROUTE   0   /* Routing/device hook  */
+#define NETLINK_KOBJECT_UEVENT  15  /* Kernel messages to userspace */
+
 # endif /* __linux__ */

 int virNetlinkStartup(void);

-- 
Doug Goldstein

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


Re: [libvirt] [PATCH] qemu: Fix define logic

2012-08-27 Thread Eric Blake
On 08/27/2012 09:59 AM, Michal Privoznik wrote:
 With current flow in qemudDomainDefine we might loose data

s/loose/lose/ (this isn't a case of making data less strict, but a case
of dropping data altogether - it's a shame that this pair of English
words tends to cause disastrous changes in meaning when one is
misspelled for the other).

 when updating an existing domain. We parse given XML and
 overwrite the configuration.  Then we try to save the new
 config. However, this step may fail and we don't perform any
 roll back.  In fact, we remove the domain from the list of
 domains held up by qemu driver. This is okay as long as the
 domain was brand new one.
 ---

ACK.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
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] qemu: Fix define logic

2012-08-27 Thread Michal Privoznik
On 27.08.2012 18:54, Eric Blake wrote:
 On 08/27/2012 09:59 AM, Michal Privoznik wrote:
 With current flow in qemudDomainDefine we might loose data
 
 s/loose/lose/ (this isn't a case of making data less strict, but a case
 of dropping data altogether - it's a shame that this pair of English
 words tends to cause disastrous changes in meaning when one is
 misspelled for the other).

Yeah. I've got an English dictionary lying around. Maybe one day I'll
actually use it :)

 
 when updating an existing domain. We parse given XML and
 overwrite the configuration.  Then we try to save the new
 config. However, this step may fail and we don't perform any
 roll back.  In fact, we remove the domain from the list of
 domains held up by qemu driver. This is okay as long as the
 domain was brand new one.
 ---
 
 ACK.

Thanks, pushed.

Michal

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


[libvirt] libvirt-java, libvirt-client on Centos 6.2

2012-08-27 Thread Gautam Sampathkumar
Hi All,
   I've been trying to upgrade our version of libvirt-java to 0.4.8
since we're now running libvirt 0.10.0 and are running into the following
dependency problems on our Centos 6.2 machine.

libvirt-java requires libvirt-client  0.9.12

1. The libvirt-client RPMs all appear to be targeted to Fedora Core system
and I'm not certain I should be trying to install these RPMs on my CentOS
box. However, I'm unable to find a source tarball so I can build
libvirt-client from source.

2. I did try to install the FC RPM
libvirt-client-0.10.0-0rc0.fc16.x86_64.rpm and this fails with the error
libc.so.6(GLIBC_2.14)(64bit) is needed by
libvirt-client-0.10.0-0rc0.fc16.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by
libvirt-client-0.10.0-0rc0.fc16.x86_64


glib 2.12 is the latest version available via YUM for all CentOS 6.x
distributions, so I attempted to build and install glibc 2.15 from source.
I can confirm that we now have /usr/lib64/libc.so.6 installed. However,
attempting to install libvirt-client still fails with the same error.

3. Not sure why libvirt-java depends on libvirt-client

Any guidance or pointers would be much appreciated.

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

Re: [libvirt] [Libvirt-announce] Availability of 0.10.0 release candidate 2

2012-08-27 Thread Jim Fehlig
Doug Goldstein wrote:
 On Mon, Aug 27, 2012 at 4:57 AM, Justin Clift jcl...@redhat.com wrote:
   
 On 27/08/2012, at 1:00 PM, Daniel Veillard wrote:
 
  I tagged the rc2 in the git tree and pushed tarball and rpms to
 the usual place:
  ftp://libvirt.org/libvirt/

 it should include the various fixes that were made on top of rc1
 and fix the compilation problem exposed on OS-X, as well as picking
 libnl3 if available,

  please give it a try and report, I am still shooting for a final
 release this Wednesday,
   
 Still a no go on OSX.  Different error this time:

   ...
   libvirtd.c: In function 'main':
   libvirtd.c:1316: error: 'NETLINK_ROUTE' undeclared (first use in this 
 function)
   libvirtd.c:1316: error: (Each undeclared identifier is reported only once
   libvirtd.c:1316: error: for each function it appears in.)
   libvirtd.c:1322: error: 'NETLINK_KOBJECT_UEVENT' undeclared (first use in 
 this function)
   make[3]: *** [libvirtd-libvirtd.o] Error 1
   make[3]: *** Waiting for unfinished jobs
 

I'm seeing the same issue building on an older SLES where HAVE_LIBNL is
not defined.

 Any ideas?

 + Justin

 

 You can try something like the following to get you a little farther
 and see if it fails farther on. Just trying to see if we can get Mac
 OS X built and see what changes need to happen before 0.10.0 goes out
 final, not necessary proper patches just yet.

 diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
 index 1982dae..c3f3e81 100644
 --- a/src/util/virnetlink.h
 +++ b/src/util/virnetlink.h
 @@ -34,6 +34,9 @@ struct nl_msg;
  struct sockaddr_nl;
  struct nlattr;

 +#define NETLINK_ROUTE   0   /* Routing/device hook  */
 +#define NETLINK_KOBJECT_UEVENT  15  /* Kernel messages to userspace */
 +
  # endif /* __linux__ */

  int virNetlinkStartup(void);
   

This workaround fixed the build.  Is this an acceptable fix, or should
commits 080bf330 and d5756794 have conditionally called
virNetlinkEventServiceStart(...) based on HAVE_LIBNL?

Regards,
Jim

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


Re: [libvirt] Entering freeze for libvirt-0.10.0

2012-08-27 Thread Eric Blake
On 08/24/2012 10:19 AM, Eric Blake wrote:

 Ah, that rings a bell, I knew I'd seen this issue before.  I'm actually
 surprised it STILL hasn't been fixed in Ubuntu, and maybe it's time to
 apply the workaround below as a build-breaker fix (I think I've posted
 it on list before, but never committed it).
 

 
 diff --git i/src/util/virnetlink.h w/src/util/virnetlink.h
 index 1982dae..82154de 100644
 --- i/src/util/virnetlink.h
 +++ w/src/util/virnetlink.h
 @@ -26,7 +26,11 @@
 
  # if defined(__linux__)  defined(HAVE_LIBNL)
 
 +/* Work around a bug where older libnl-1 headers expected older gcc
 + * semantics of 'extern inline' that conflict with C99 semantics.  */
 +#  define inline
  #  include netlink/msg.h
 +#  undef inline

I've now pushed this under the build-breaker rule.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
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-announce] Availability of 0.10.0 release candidate 2

2012-08-27 Thread Doug Goldstein
On Mon, Aug 27, 2012 at 3:39 PM, Jim Fehlig jfeh...@suse.com wrote:
 Doug Goldstein wrote:
 On Mon, Aug 27, 2012 at 4:57 AM, Justin Clift jcl...@redhat.com wrote:

 On 27/08/2012, at 1:00 PM, Daniel Veillard wrote:

  I tagged the rc2 in the git tree and pushed tarball and rpms to
 the usual place:
  ftp://libvirt.org/libvirt/

 it should include the various fixes that were made on top of rc1
 and fix the compilation problem exposed on OS-X, as well as picking
 libnl3 if available,

  please give it a try and report, I am still shooting for a final
 release this Wednesday,

 Still a no go on OSX.  Different error this time:

   ...
   libvirtd.c: In function 'main':
   libvirtd.c:1316: error: 'NETLINK_ROUTE' undeclared (first use in this 
 function)
   libvirtd.c:1316: error: (Each undeclared identifier is reported only once
   libvirtd.c:1316: error: for each function it appears in.)
   libvirtd.c:1322: error: 'NETLINK_KOBJECT_UEVENT' undeclared (first use in 
 this function)
   make[3]: *** [libvirtd-libvirtd.o] Error 1
   make[3]: *** Waiting for unfinished jobs


 I'm seeing the same issue building on an older SLES where HAVE_LIBNL is
 not defined.

 Any ideas?

 + Justin



 You can try something like the following to get you a little farther
 and see if it fails farther on. Just trying to see if we can get Mac
 OS X built and see what changes need to happen before 0.10.0 goes out
 final, not necessary proper patches just yet.

 diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
 index 1982dae..c3f3e81 100644
 --- a/src/util/virnetlink.h
 +++ b/src/util/virnetlink.h
 @@ -34,6 +34,9 @@ struct nl_msg;
  struct sockaddr_nl;
  struct nlattr;

 +#define NETLINK_ROUTE   0   /* Routing/device hook  */
 +#define NETLINK_KOBJECT_UEVENT  15  /* Kernel messages to userspace */
 +
  # endif /* __linux__ */

  int virNetlinkStartup(void);


 This workaround fixed the build.  Is this an acceptable fix, or should
 commits 080bf330 and d5756794 have conditionally called
 virNetlinkEventServiceStart(...) based on HAVE_LIBNL?

 Regards,
 Jim


Yeah that's what I wasn't sure about when I wrote the patch. I can see
the argument either way.


-- 
Doug Goldstein

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


[libvirt] Reminder: KVM Forum 2012 Call For Participation

2012-08-27 Thread KVM Forum 2012 Program Committee
Just a reminder, the CFP ends this Friday.
--

=
KVM Forum 2012: Call For Participation
November 7-9, 2012 - Hotel Fira Palace - Barcelona, Spain

(All submissions must be received before midnight Aug 31st, 2012)
=

KVM is an industry leading open source hypervisor that provides
an ideal platform for datacenter virtualization, virtual desktop
infrastructure, and cloud computing.  Once again, it's time to bring
together the community of developers and users that define the KVM
ecosystem for our annual technical conference.  We will discuss the
current state of affairs and plan for the future of KVM, its surrounding
infrastructure, and management tools.  We are also excited to announce
the oVirt Workshop will run in parallel with the KVM Forum, bringing in
a community focused on enterprise datacenter virtualization management
built on KVM.  For topics which overlap we will have shared sessions.
So mark your calendar and join us in advancing KVM.

http://events.linuxfoundation.org/events/kvm-forum/

Once again we are colocated with The Linux Foundation's LinuxCon,
Based on feedback from last year, this time it's LinuxCon Europe!
KVM Forum attendees will be able to attend oVirt Workshop sessions and
are eligible to attend LinuxCon Europe for a discounted rate.

http://events.linuxfoundation.org/events/kvm-forum/register

We invite you to lead part of the discussion by submitting a speaking
proposal for KVM Forum 2012.

http://events.linuxfoundation.org/cfp

Suggested topics:

 KVM
 - Scaling and performance
 - Nested virtualization
 - I/O improvements
 - PCI device assignment
 - Driver domains
 - Time keeping
 - Resource management (cpu, memory, i/o)
 - Memory management (page sharing, swapping, huge pages, etc)
 - VEPA, VN-Link, vswitch
 - Security
 - Architecture ports
 
 QEMU
 - Device model improvements
 - New devices and chipsets
 - Scaling and performance
 - Desktop virtualization
 - Spice
 - Increasing robustness and hardening
 - Security model
 - Management interfaces
 - QMP protocol and implementation
 - Image formats
 - Firmware (SeaBIOS, OVMF, UEFI, etc)
 - Live migration
 - Live snapshots and merging
 - Fault tolerance, high availability, continuous backup
 - Real-time guest support
 
 Virtio
 - Speeding up existing devices
 - Alternatives
 - Virtio on non-Linux or non-virtualized
 
 Management infrastructure
 - oVirt (shared track w/ oVirt Workshop)
 - Libvirt
 - KVM autotest
 - OpenStack
 - Network virtualization management
 - Enterprise storage management
 
 Cloud computing
 - Scalable storage
 - Virtual networking
 - Security
 - Provisioning

SUBMISSION REQUIREMENTS

Abstracts due: Aug 31st, 2012
Notification: Sep 14th, 2012

Please submit a short abstract (~150 words) describing your presentation
proposal.  In your submission please note how long your talk will take.
Slots vary in length up to 45 minutes.  Also include in your proposal
the proposal type -- one of:

- technical talk
- end-user talk
- birds of a feather (BOF) session

Submit your proposal here:

http://events.linuxfoundation.org/cfp

You will receive a notification whether or not your presentation proposal
was accepted by Sep 14th.

END-USER COLLABORATION

One of the big challenges as developers is to know what, where and how
people actually use our software.  We will reserve a few slots for end
users talking about their deployment challenges and achievements.

If you are using KVM in production you are encouraged submit a speaking
proposal.  Simply mark it as an end-user collaboration proposal.  As an
end user, this is a unique opportunity to get your input to developers.

BOF SESSION

We will reserve some slots in the evening after the main conference
tracks, for birds of a feather (BOF) sessions. These sessions will be
less formal than presentation tracks and targetted for people who would
like to discuss specific issues with other developers and/or users.
If you are interested in getting developers and/or uses together to
discuss a specific problem, please submit a BOF proposal.

LIGHTNING TALKS

In addition to submitted talks we will also have some room for lightning
talks. These are short (5 minute) discussions to highlight new work or
ideas that aren't complete enough to warrant a full presentation slot.
Lightning talk submissions and scheduling will be handled on-site at
KVM Forum.

HOTEL / TRAVEL

The KVM Forum 2012 will be held in Barcelona, Spain at the Hotel Fira Palace.

http://events.linuxfoundation.org/events/kvm-forum/hotel

Thank you for your interest in KVM.  We're looking forward to your
submissions and seeing you at the KVM Forum 2012 in November!

Thanks,
your KVM Forum 2012 Program Commitee

Please contact us with any questions or comments.
kvm-forum-2012...@redhat.com

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


[libvirt] [PATCH V2] offline migration

2012-08-27 Thread liguang
add offline migration to migrate a domain which is
only defined but not active, this implementation has
nothing to do with type of VM(qemu, xen etc.), 
it transfers data by stream.

From 634687c6ee81c784b633e4a86f3613e109ecda7c Mon Sep 17 00:00:00 2001
From: liguang lig.f...@cn.fujitsu.com
Date: Thu, 9 Aug 2012 16:04:29 +0800
Subject: [PATCH] implement offline migration

Signed-off-by: liguang lig.f...@cn.fujitsu.com
---
 daemon/remote.c  |   46 +++
 docs/hvsupport.pl|2 +
 include/libvirt/libvirt.h.in |6 +++
 python/generator.py  |1 +
 src/driver.h |5 +++
 src/libvirt.c|   22 +
 src/libvirt_public.syms  |1 +
 src/remote/remote_driver.c   |   70
++
 src/remote/remote_protocol.x |   10 +-
 tools/virsh-domain.c |   69
+
 10 files changed, 231 insertions(+), 1 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index d25717c..5c175b2 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -21,6 +21,9 @@
  */
 
 #include config.h
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.h
 
 #include virterror_internal.h
 
@@ -48,6 +51,7 @@
 #include virdbus.h
 #include remote_protocol.h
 #include qemu_protocol.h
+#include fdstream.h
 
 
 #define VIR_FROM_THIS VIR_FROM_RPC
@@ -1617,6 +1621,48 @@ no_memory:
 goto cleanup;
 }
 
+static int remoteDispatchDomainMigrateOffline(
+virNetServerPtr server ATTRIBUTE_UNUSED,
+virNetServerClientPtr client,
+virNetMessagePtr msg ATTRIBUTE_UNUSED,
+virNetMessageErrorPtr rerr,
+remote_domain_migrate_offline_args *args,
+remote_domain_migrate_offline_ret *ret ATTRIBUTE_UNUSED)
+{
+int rv = -1;
+virStreamPtr st = NULL;
+daemonClientStreamPtr stream = NULL;
+daemonClientPrivatePtr priv =
+virNetServerClientGetPrivateData(client);
+
+if (!priv-conn) {
+virReportError(VIR_ERR_INTERNAL_ERROR, %s, _(connection not
open));
+goto cleanup;
+}
+
+st = virStreamNew(priv-conn, VIR_STREAM_NONBLOCK);
+
+if (!(stream = daemonCreateClientStream(client, st, remoteProgram,
msg-header)))
+goto cleanup;
+
+if (virFDStreamCreateFile(st,
+args-name,
+0, 0,
+O_WRONLY, 0)  0)
+goto cleanup;
+
+
+if (daemonAddClientStream(client, stream, false)  0)
+goto cleanup;
+
+rv = 0;
+
+cleanup:
+if (rv  0)
+virNetMessageSaveError(rerr);
+return rv;
+}
+
 static int
 remoteDispatchDomainMigratePrepare(virNetServerPtr server
ATTRIBUTE_UNUSED,
virNetServerClientPtr client
ATTRIBUTE_UNUSED,
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
index 4871739..47fc505 100755
--- a/docs/hvsupport.pl
+++ b/docs/hvsupport.pl
@@ -128,6 +128,8 @@ $apis{virDomainMigratePrepareTunnel3} = 0.9.2;
 $apis{virDomainMigratePerform3} = 0.9.2;
 $apis{virDomainMigrateFinish3} = 0.9.2;
 $apis{virDomainMigrateConfirm3} = 0.9.2;
+$apis{virDomainMigrateOffline} = 0.10.1;
+
 
 
 
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index d21d029..e4a6e14 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -977,6 +977,7 @@ typedef enum {
* whole migration
process; this will be used automatically
* when supported */
 VIR_MIGRATE_UNSAFE= (1  9), /* force migration even
if it is considered unsafe */
+VIR_MIGRATE_OFFLINE   = (1  10), /* offline migration */
 } virDomainMigrateFlags;
 
 /* Domain migration. */
@@ -1012,6 +1013,11 @@ int virDomainMigrateGetMaxSpeed(virDomainPtr
domain,
 unsigned long *bandwidth,
 unsigned int flags);
 
+int
+virDomainMigrateOffline(virConnectPtr dconn,
+char *file);
+
+
 /**
  * VIR_NODEINFO_MAXCPUS:
  * @nodeinfo: virNodeInfo instance
diff --git a/python/generator.py b/python/generator.py
index 6559ece..42e266b 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -427,6 +427,7 @@ skip_impl = (
 'virDomainGetDiskErrors',
 'virConnectUnregisterCloseCallback',
 'virConnectRegisterCloseCallback',
+   'virDomainMigrateOffline',
 )
 
 qemu_skip_impl = (
diff --git a/src/driver.h b/src/driver.h
index aab9766..d17fa22 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -865,6 +865,10 @@ typedef char *
int type,
const char *uri,
unsigned int flags);
+typedef int
+(*virDrvDomainMigrateOffline)(virConnectPtr dconn,
+  const char *file);
+
 
 /**
  * _virDriver:
@@ -1048,6 +1052,7 @@ struct _virDriver {
 virDrvDomainGetDiskErrors   

Re: [libvirt] [Libvirt-announce] Availability of 0.10.0 release candidate 2

2012-08-27 Thread Justin Clift
On 28/08/2012, at 2:32 AM, Doug Goldstein wrote:
snip
 You can try something like the following to get you a little farther
 and see if it fails farther on. Just trying to see if we can get Mac
 OS X built and see what changes need to happen before 0.10.0 goes out
 final, not necessary proper patches just yet.
 
 diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
 index 1982dae..c3f3e81 100644
 --- a/src/util/virnetlink.h
 +++ b/src/util/virnetlink.h
 @@ -34,6 +34,9 @@ struct nl_msg;
 struct sockaddr_nl;
 struct nlattr;
 
 +#define NETLINK_ROUTE   0   /* Routing/device hook  */
 +#define NETLINK_KOBJECT_UEVENT  15  /* Kernel messages to userspace */
 +
 # endif /* __linux__ */
 
 int virNetlinkStartup(void);

Thanks Dough.  This worked, and seems to be the last of
the problems.  The whole compile worked after this. :)

+ Justin

--
Aeolus Community Manager
http://www.aeolusproject.org

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


Re: [libvirt] [Libvirt-announce] ANNOUNCE: libvirt 0.9.11.5 maintenance release

2012-08-27 Thread Justin Clift
On 14/08/2012, at 8:37 AM, Cole Robinson wrote:
 libvirt 0.9.11.5 maintenance release is now available. This is
 libvirt 0.9.11 with additional bugfixes that have accumulated
 upstream since the initial release.
 
 This release can be downloaded at:
 
 http://libvirt.org/sources/stable_updates/libvirt-0.9.11.5.tar.gz

Just tried this on OSX too.

Compilation fails with:

  ...
CC   libvirt_util_la-virnetdevbandwidth.lo
CC   libvirt_util_la-virnetdevbridge.lo
CC   libvirt_util_la-virnetdevmacvlan.lo
  util/virnetdev.c:932: error: expected ';', ',' or ')' before 'macaddr'
  util/virnetdev.c:1666: error: expected ';', ',' or ')' before 'macaddress'
  make[3]: *** [libvirt_util_la-virnetdev.lo] Error 1

Maybe we should do rc's for the maintenance releases as well?

+ Justin

--
Aeolus Community Manager
http://www.aeolusproject.org

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


Re: [libvirt] IVSHMEM support

2012-08-27 Thread Osier Yang

On 2012年08月21日 03:34, Shawn Furrow wrote:

Hi all,

Does anyone know if Libvirt supports shared memory devices such as
IVSHMEM. I know it didn't at one point but I didn't know if support for
it had been recently added.


It's on my plate, but I haven't start it yet. Patches are welcomed. :-)



Thanks,
Shawn


--
Virginia Tech
Bradley Department of Electrical and Computer Engineering
B.S. Electrical Engineering
B.S. Computer Engineering



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


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

Re: [libvirt] Can I disable the network filter function in libvirt?

2012-08-27 Thread Osier Yang

On 2012年08月27日 23:11, Zhihong Wang wrote:

Dear all:

Can I disable the network filter function in libvirt since the xen
driver of libvirt doesn't support the function at all?
If I can,  what configuration should be made and how to make that come
true ? to disable that function


The filters just take effect when you explicitly config it in domain,
so what do you mean to disable the function? build without network
filter support?

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

[libvirt] [PATCH] qemu: Add quotes to kernel command line of direct kernel boot

2012-08-27 Thread Zhou Zheng Sheng

When passing kernel command line arguments, it is possible to have
spaces. The arguments should be protected in qoutes.

In http://libvirt.org/formatdomain.html direct kernel boot section,
there is an example.
  ...
  os
typehvm/type
loader/usr/lib/xen/boot/hvmloader/loader
kernel/root/f8-i386-vmlinuz/kernel
initrd/root/f8-i386-initrd/initrd
cmdlineconsole=ttyS0 ks=http://example.com/f8-i386/os//cmdline
  /os
  ...
If the contents in cmdline are passed as-is to qemu, then qemu will see
  qemu ... -append console=ttyS0 ks=http://example.com/f8-i386/os/ ...
It must be quoted, so let qemu see
  qemu ... -append console=ttyS0 ks=http://example.com/f8-i386/os/; ...

Signed-off-by: Zhou Zheng Sheng zhshz...@linux.vnet.ibm.com
---
 src/qemu/qemu_command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8c32a4d..80b562d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4849,7 +4849,7 @@ qemuBuildCommandLine(virConnectPtr conn,
 if (def-os.initrd)
 virCommandAddArgList(cmd, -initrd, def-os.initrd, NULL);
 if (def-os.cmdline)
-virCommandAddArgList(cmd, -append, def-os.cmdline, NULL);
+virCommandAddArgList(cmd, -append, \, def-os.cmdline, \, NULL);
 } else {
 virCommandAddArgList(cmd, -bootloader, def-os.bootloader, NULL);
 }

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

Re: [libvirt] [test-API][PATCH] Fix a typo in commit b111531

2012-08-27 Thread Osier Yang
On 2012年08月27日 18:43, Wayne Sun wrote:
 Signed-off-by: Wayne Sung...@redhat.com
 ---
   src/env_inspect.py |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/src/env_inspect.py b/src/env_inspect.py
 index cf036f7..222ffb1 100644
 --- a/src/env_inspect.py
 +++ b/src/env_inspect.py
 @@ -77,7 +77,7 @@ def sharemod_init(env_parser, logger):
   username = env_parser.get_value('variables', 'username')
   password = env_parser.get_value('variables', 'password')
   conn = utils.get_conn(uri, username, password)
 -if not conn
 +if not conn:
   return 1
 
   # initialize conn object in sharedmod

ACK and pushed

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

[libvirt] [test-API][PATCH] Fix problem in create netfs pool and logical volume

2012-08-27 Thread Wayne Sun
create_netfs_pool:
In rhel7 the source nfs mount dir shows in /proc/mounts will end with a
'/' which in rhel6 and rhel5 didn't. So the check with exact match will
fail on rhel7. Change with '/*' will accept with both '/' exist or not.

create_logical_volume:
When grep lvcreate command in /etc/lvm/backup/logical_pool for create
logical volume, rhel6 and rhel7 command is slightly differnet with
rhel5, so make the change to fit for all version.

Signed-off-by: Wayne Sun g...@redhat.com
---
 repos/storage/create_logical_volume.py |6 +++---
 repos/storage/create_netfs_pool.py |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/repos/storage/create_logical_volume.py 
b/repos/storage/create_logical_volume.py
index 098c148..9fd1305 100644
--- a/repos/storage/create_logical_volume.py
+++ b/repos/storage/create_logical_volume.py
@@ -54,9 +54,9 @@ def check_volume_create(poolobj, poolname, volname, size):
 logger.debug(%s file path: %s % (poolname, path))
 if os.access(path, os.R_OK):
 logger.debug(execute grep lvcreate %s command % path)
-stat, ret = commands.getstatusoutput(grep \
-'lvcreate --name %s -L %sK /dev/%s' %s\
- % (volname, size, poolname, path))
+stat, ret = commands.getstatusoutput(
+grep 'lvcreate --name %s -L %sK .*%s' %s
+% (volname, size, poolname, path))
 if stat == 0 and volname in poolobj.listVolumes():
 logger.debug(ret)
 return True
diff --git a/repos/storage/create_netfs_pool.py 
b/repos/storage/create_netfs_pool.py
index 9fb7b69..4603788 100644
--- a/repos/storage/create_netfs_pool.py
+++ b/repos/storage/create_netfs_pool.py
@@ -44,7 +44,7 @@ def check_pool_create_OS(conn, poolname, logger):
  (src_host, src_path, dest_path) )
 fd = open(/proc/mounts,r)
 mount = src_host + : + src_path
-pat = mount + \s+ + dest_path
+pat = mount + /*\s+ + dest_path
 found = 0
 for line in fd:
 if re.match(pat, line):
-- 
1.7.1

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


[libvirt] [perl-Sys-Virt][PATCH] Virt.xs: fix flag issue on set_scheduler_parameters

2012-08-27 Thread Alex Jia
From: Alex Jia Alex Jia a...@redhat.com

The default flags are inconsistent on both qemuSetSchedulerParameters()
and qemuGetSchedulerParameters() in libvirt, the qemuGetSchedulerParameters()
always passes 'VIR_DOMAIN_AFFECT_CURRENT' flag to the 
qemuGetSchedulerParametersFlags(),
it should be a expected behavior, but the qemuSetSchedulerParameters() always 
passes 
'VIR_DOMAIN_AFFECT_LIVE' flag to the qemuSetSchedulerParametersFlags(), if 
users use
default flag=0 or explicitly give a 'VIR_DOMAIN_AFFECT_CURRENT' flag to the 
set_scheduler_parameters() in perl-Sys-Virt, because the flag value is 0, the 
result is 
the virDomainSetSchedulerParameters() is called incorrectly.

How to reproduce?

# cat test.pl

#!/usr/bin/env perl
use warnings;
use strict;
use Sys::Virt;

my $uri = qemu:///system;
my $domname = foo;  # change your guest name
my $con = Sys::Virt-new(address = $uri, readonly = 0);
my $dom = $con-get_domain_by_name($domname);
my %sched_param = (Sys::Virt::Domain::SCHEDULER_CPU_SHARES=1);
$dom-set_scheduler_parameters(\%sched_param, 
Sys::Virt::Domain::AFFECT_CURRENT);

# perl test.pl
libvirt error code: 55, message: Requested operation is not valid: domain is 
not running


Signed-off-by: Alex Jia Alex Jia a...@redhat.com
---
 Virt.xs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Virt.xs b/Virt.xs
index 2b8d74c..0ebf95d 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -2833,7 +2833,7 @@ set_scheduler_parameters(dom, newparams, flags=0)
   }
   }
   vir_typed_param_from_hv(newparams, params, nparams);
-  if (flags) {
+  if (flags != 1) {
   if (virDomainSetSchedulerParametersFlags(dom, params, nparams, 
flags)  0)
   _croak_error();
   } else {
-- 
1.7.1

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


Re: [libvirt] [perl-Sys-Virt][PATCH] Virt.xs: fix flag issue on set_scheduler_parameters

2012-08-27 Thread Alex Jia
In fact, the virsh schedinfo always calls 
virDomain{Get,Set}SchedulerParametersFlags()
regardless what's flag, so I think we may also remove 
'virDomainSetSchedulerParameters()' 
relevant branch.

-- 
Regards, 
Alex


- Original Message -
From: Alex Jia a...@redhat.com
To: libvir-list@redhat.com
Cc: Alex Jia alex.jia.a...@redhat.com
Sent: Tuesday, August 28, 2012 11:38:52 AM
Subject: [libvirt][perl-Sys-Virt][PATCH] Virt.xs: fix flag issue on 
set_scheduler_parameters

From: Alex Jia Alex Jia a...@redhat.com

The default flags are inconsistent on both qemuSetSchedulerParameters()
and qemuGetSchedulerParameters() in libvirt, the qemuGetSchedulerParameters()
always passes 'VIR_DOMAIN_AFFECT_CURRENT' flag to the 
qemuGetSchedulerParametersFlags(),
it should be a expected behavior, but the qemuSetSchedulerParameters() always 
passes 
'VIR_DOMAIN_AFFECT_LIVE' flag to the qemuSetSchedulerParametersFlags(), if 
users use
default flag=0 or explicitly give a 'VIR_DOMAIN_AFFECT_CURRENT' flag to the 
set_scheduler_parameters() in perl-Sys-Virt, because the flag value is 0, the 
result is 
the virDomainSetSchedulerParameters() is called incorrectly.

How to reproduce?

# cat test.pl

#!/usr/bin/env perl
use warnings;
use strict;
use Sys::Virt;

my $uri = qemu:///system;
my $domname = foo;  # change your guest name
my $con = Sys::Virt-new(address = $uri, readonly = 0);
my $dom = $con-get_domain_by_name($domname);
my %sched_param = (Sys::Virt::Domain::SCHEDULER_CPU_SHARES=1);
$dom-set_scheduler_parameters(\%sched_param, 
Sys::Virt::Domain::AFFECT_CURRENT);

# perl test.pl
libvirt error code: 55, message: Requested operation is not valid: domain is 
not running


Signed-off-by: Alex Jia Alex Jia a...@redhat.com
---
 Virt.xs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Virt.xs b/Virt.xs
index 2b8d74c..0ebf95d 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -2833,7 +2833,7 @@ set_scheduler_parameters(dom, newparams, flags=0)
   }
   }
   vir_typed_param_from_hv(newparams, params, nparams);
-  if (flags) {
+  if (flags != 1) {
   if (virDomainSetSchedulerParametersFlags(dom, params, nparams, 
flags)  0)
   _croak_error();
   } else {
-- 
1.7.1

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


Re: [libvirt] [PATCH] qemu: Add quotes to kernel command line of direct kernel boot

2012-08-27 Thread Eric Blake
On 08/27/2012 08:05 PM, Zhou Zheng Sheng wrote:
 When passing kernel command line arguments, it is possible to have
 spaces. The arguments should be protected in qoutes.

NACK.


 If the contents in cmdline are passed as-is to qemu, then qemu will see
   qemu ... -append console=ttyS0 ks=http://example.com/f8-i386/os/ ...

That's what shows in the guest log, because we don't (yet) properly
quote arguments in the log.  But if you look at what we actually pass to
the exec() family,...


  if (def-os.cmdline)
 -virCommandAddArgList(cmd, -append, def-os.cmdline, NULL);

...this code properly passes def-os.cmdline as a single exec()
argument.  Remember, virCommand is NOT subject to further shell
interpretation.  You are getting confused by trying to treat the log
output as though libvirt were invoking /bin/sh to start the command,
instead of calling exec() directly.

If anything, the real bug to fix would be virCommandToString to have a
mode that lists the output with shell quoting as needed, and to use that
mode when outputting log file information.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
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 V3] implement offline migration

2012-08-27 Thread liguang
Signed-off-by: liguang lig.f...@cn.fujitsu.com
---
 daemon/remote.c  |   46 +++
 docs/hvsupport.pl|2 +
 include/libvirt/libvirt.h.in |6 +++
 python/generator.py  |1 +
 src/driver.h |5 +++
 src/libvirt.c|   22 +
 src/libvirt_public.syms  |1 +
 src/remote/remote_driver.c   |   70 ++
 src/remote/remote_protocol.x |   10 +-
 tools/virsh-domain.c |   69 +
 10 files changed, 231 insertions(+), 1 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 24928f4..c47a580 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -21,6 +21,9 @@
  */
 
 #include config.h
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.h
 
 #include virterror_internal.h
 
@@ -48,6 +51,7 @@
 #include virdbus.h
 #include remote_protocol.h
 #include qemu_protocol.h
+#include fdstream.h
 
 
 #define VIR_FROM_THIS VIR_FROM_RPC
@@ -1768,6 +1772,48 @@ no_memory:
 goto cleanup;
 }
 
+static int remoteDispatchDomainMigrateOffline(
+virNetServerPtr server ATTRIBUTE_UNUSED,
+virNetServerClientPtr client,
+virNetMessagePtr msg ATTRIBUTE_UNUSED,
+virNetMessageErrorPtr rerr,
+remote_domain_migrate_offline_args *args,
+remote_domain_migrate_offline_ret *ret ATTRIBUTE_UNUSED)
+{
+int rv = -1;
+virStreamPtr st = NULL;
+daemonClientStreamPtr stream = NULL;
+daemonClientPrivatePtr priv =
+virNetServerClientGetPrivateData(client);
+
+if (!priv-conn) {
+virReportError(VIR_ERR_INTERNAL_ERROR, %s, _(connection not open));
+goto cleanup;
+}
+
+st = virStreamNew(priv-conn, VIR_STREAM_NONBLOCK);
+
+if (!(stream = daemonCreateClientStream(client, st, remoteProgram, 
msg-header)))
+goto cleanup;
+
+if (virFDStreamCreateFile(st,
+args-name,
+0, 0,
+O_WRONLY, 0)  0)
+goto cleanup;
+
+
+if (daemonAddClientStream(client, stream, false)  0)
+goto cleanup;
+
+rv = 0;
+
+cleanup:
+if (rv  0)
+virNetMessageSaveError(rerr);
+return rv;
+}
+
 static int
 remoteDispatchDomainMigratePrepare(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client 
ATTRIBUTE_UNUSED,
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
index 4871739..47fc505 100755
--- a/docs/hvsupport.pl
+++ b/docs/hvsupport.pl
@@ -128,6 +128,8 @@ $apis{virDomainMigratePrepareTunnel3} = 0.9.2;
 $apis{virDomainMigratePerform3} = 0.9.2;
 $apis{virDomainMigrateFinish3} = 0.9.2;
 $apis{virDomainMigrateConfirm3} = 0.9.2;
+$apis{virDomainMigrateOffline} = 0.10.1;
+
 
 
 
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index cfe5047..7c9cf3c 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -995,6 +995,7 @@ typedef enum {
* whole migration process; this 
will be used automatically
* when supported */
 VIR_MIGRATE_UNSAFE= (1  9), /* force migration even if it is 
considered unsafe */
+VIR_MIGRATE_OFFLINE   = (1  10), /* offline migration */
 } virDomainMigrateFlags;
 
 /* Domain migration. */
@@ -1030,6 +1031,11 @@ int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
 unsigned long *bandwidth,
 unsigned int flags);
 
+int
+virDomainMigrateOffline(virConnectPtr dconn,
+char *file);
+
+
 /**
  * VIR_NODEINFO_MAXCPUS:
  * @nodeinfo: virNodeInfo instance
diff --git a/python/generator.py b/python/generator.py
index 7beb361..a1b1203 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -427,6 +427,7 @@ skip_impl = (
 'virDomainGetDiskErrors',
 'virConnectUnregisterCloseCallback',
 'virConnectRegisterCloseCallback',
+   'virDomainMigrateOffline',
 )
 
 qemu_skip_impl = (
diff --git a/src/driver.h b/src/driver.h
index e88ab28..9041005 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -881,6 +881,10 @@ typedef char *
int type,
const char *uri,
unsigned int flags);
+typedef int
+(*virDrvDomainMigrateOffline)(virConnectPtr dconn,
+  const char *file);
+
 
 /**
  * _virDriver:
@@ -1068,6 +1072,7 @@ struct _virDriver {
 virDrvDomainGetDiskErrors   domainGetDiskErrors;
 virDrvDomainSetMetadata domainSetMetadata;
 virDrvDomainGetMetadata domainGetMetadata;
+virDrvDomainMigrateOffline  domainMigrateOffline;
 };
 
 typedef int
diff --git a/src/libvirt.c b/src/libvirt.c
index b034ed6..2878384 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5001,6 +5001,28 @@