Re: [libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-03-03 Thread Joao Martins


On 03/03/2017 11:35 AM, Daniel P. Berrange wrote:
> On Fri, Mar 03, 2017 at 11:36:25AM +, Joao Martins wrote:
>>
>>
>> On 03/02/2017 05:58 PM, Jim Fehlig wrote:
>>> Sorry for the review delay.
>>>
>>> On 02/08/2017 09:44 AM, Joao Martins wrote:
 As it could be shared with libxl which now allows channels to
 be created. Also changed filename to match others in the same
 directory namely to virqemuagent.{h,c}

 Signed-off-by: Joao Martins 
 ---
  po/POTFILES.in   |2 +-
  src/Makefile.am  |2 +-
  src/libvirt_private.syms |   21 +
  src/qemu/qemu_agent.c| 2248 
 --
  src/qemu/qemu_agent.h|  123 ---
  src/qemu/qemu_domain.h   |2 +-
  src/qemu/qemu_driver.c   |2 +-
  src/util/virqemuagent.c  | 2248 
 ++
  src/util/virqemuagent.h  |  123 +++
  tests/qemuagenttest.c|2 +-
  tests/qemumonitortestutils.c |2 +-
  tests/qemumonitortestutils.h |2 +-
  12 files changed, 2399 insertions(+), 2378 deletions(-)
  delete mode 100644 src/qemu/qemu_agent.c
  delete mode 100644 src/qemu/qemu_agent.h
  create mode 100644 src/util/virqemuagent.c
  create mode 100644 src/util/virqemuagent.h
>>>
>>> I hope others will opine on this change. It seems reasonable to me and I'm 
>>> surprised the qemu driver only needed tiny changes to accommodate moving 
>>> all 
>>> this code.
>>
>> Yeap, I too was surprised on how the changes were non disruptive wrt to qemu
>> driver :)
>>
>>>
>>> [...]
 diff --git a/src/util/virqemuagent.h b/src/util/virqemuagent.h
 new file mode 100644
 index 000..2e81020
 --- /dev/null
 +++ b/src/util/virqemuagent.h
 @@ -0,0 +1,123 @@
 +/*
 + * virqemuagent.h: interaction with QEMU guest agent
 + *
 + * Copyright (C) 2006-2012 Red Hat, Inc.
 + * Copyright (C) 2006 Daniel P. Berrange
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * This library is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library.  If not, see
 + * .
 + *
 + * Author: Daniel P. Berrange 
 + */
 +
 +
 +#ifndef __QEMU_AGENT_H__
 +# define __QEMU_AGENT_H__
 +
 +# include "internal.h"
 +# include "domain_conf.h"
>>>
>>> ISTR a recent discussion on the list frowning on using code from src/conf 
>>> in 
>>> src/util, although virthostdev.h also includes domain_conf.h.
>>>
>>> BTW, compilation fails here
>>>
>>> In file included from util/virqemuagent.c:35:0:
>>> util/virqemuagent.h:29:26: fatal error: domain_conf.h: No such file or 
>>> directory
>>>   # include "domain_conf.h"
>>>
>> Hmm, will have to fix it for v1. This series were applied on top of commit
>> 2841e67 ("qemu: propagate bridge MTU into qemu "host_mtu" option") and I 
>> didn't
>> observe compilation  issues (neither make {syntax-check,check} IIRC).
>>
 +
 +typedef struct _qemuAgent qemuAgent;
 +typedef qemuAgent *qemuAgentPtr;
 +
 +typedef struct _qemuAgentCallbacks qemuAgentCallbacks;
 +typedef qemuAgentCallbacks *qemuAgentCallbacksPtr;
 +struct _qemuAgentCallbacks {
 +void (*destroy)(qemuAgentPtr mon,
 +virDomainObjPtr vm);
 +void (*eofNotify)(qemuAgentPtr mon,
 +  virDomainObjPtr vm);
 +void (*errorNotify)(qemuAgentPtr mon,
 +virDomainObjPtr vm);
 +};
 +
 +
 +qemuAgentPtr qemuAgentOpen(virDomainObjPtr vm,
 +   const virDomainChrSourceDef *config,
 +   qemuAgentCallbacksPtr cb);
 +
 +void qemuAgentClose(qemuAgentPtr mon);
>>>
>>> Other files in src/util prefix structs and functions with "vir". I'm not 
>>> sure 
>>> how picky folks are about that. If the consensus is towards the "vir" 
>>> prefix, 
>>> perhaps it would be easier done with a follow-up after the move?
>> Yeah I noticed the pattern. Though given the big move of code into util 
>> making
>> as a follow-up patch would easy review perhaps.
> 
> It would be desirable to use the vir name prefix here, but that should
> certainly be done as a separate patch
BTW I said follow-up when I actually meant it in the context of this series i.e.
patch 2/5 would

Re: [libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-03-03 Thread Daniel P. Berrange
On Fri, Mar 03, 2017 at 11:36:25AM +, Joao Martins wrote:
> 
> 
> On 03/02/2017 05:58 PM, Jim Fehlig wrote:
> > Sorry for the review delay.
> > 
> > On 02/08/2017 09:44 AM, Joao Martins wrote:
> >> As it could be shared with libxl which now allows channels to
> >> be created. Also changed filename to match others in the same
> >> directory namely to virqemuagent.{h,c}
> >>
> >> Signed-off-by: Joao Martins 
> >> ---
> >>  po/POTFILES.in   |2 +-
> >>  src/Makefile.am  |2 +-
> >>  src/libvirt_private.syms |   21 +
> >>  src/qemu/qemu_agent.c| 2248 
> >> --
> >>  src/qemu/qemu_agent.h|  123 ---
> >>  src/qemu/qemu_domain.h   |2 +-
> >>  src/qemu/qemu_driver.c   |2 +-
> >>  src/util/virqemuagent.c  | 2248 
> >> ++
> >>  src/util/virqemuagent.h  |  123 +++
> >>  tests/qemuagenttest.c|2 +-
> >>  tests/qemumonitortestutils.c |2 +-
> >>  tests/qemumonitortestutils.h |2 +-
> >>  12 files changed, 2399 insertions(+), 2378 deletions(-)
> >>  delete mode 100644 src/qemu/qemu_agent.c
> >>  delete mode 100644 src/qemu/qemu_agent.h
> >>  create mode 100644 src/util/virqemuagent.c
> >>  create mode 100644 src/util/virqemuagent.h
> > 
> > I hope others will opine on this change. It seems reasonable to me and I'm 
> > surprised the qemu driver only needed tiny changes to accommodate moving 
> > all 
> > this code.
> 
> Yeap, I too was surprised on how the changes were non disruptive wrt to qemu
> driver :)
> 
> > 
> > [...]
> >> diff --git a/src/util/virqemuagent.h b/src/util/virqemuagent.h
> >> new file mode 100644
> >> index 000..2e81020
> >> --- /dev/null
> >> +++ b/src/util/virqemuagent.h
> >> @@ -0,0 +1,123 @@
> >> +/*
> >> + * virqemuagent.h: interaction with QEMU guest agent
> >> + *
> >> + * Copyright (C) 2006-2012 Red Hat, Inc.
> >> + * Copyright (C) 2006 Daniel P. Berrange
> >> + *
> >> + * This library is free software; you can redistribute it and/or
> >> + * modify it under the terms of the GNU Lesser General Public
> >> + * License as published by the Free Software Foundation; either
> >> + * version 2.1 of the License, or (at your option) any later version.
> >> + *
> >> + * This library is distributed in the hope that it will be useful,
> >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> >> + * Lesser General Public License for more details.
> >> + *
> >> + * You should have received a copy of the GNU Lesser General Public
> >> + * License along with this library.  If not, see
> >> + * .
> >> + *
> >> + * Author: Daniel P. Berrange 
> >> + */
> >> +
> >> +
> >> +#ifndef __QEMU_AGENT_H__
> >> +# define __QEMU_AGENT_H__
> >> +
> >> +# include "internal.h"
> >> +# include "domain_conf.h"
> > 
> > ISTR a recent discussion on the list frowning on using code from src/conf 
> > in 
> > src/util, although virthostdev.h also includes domain_conf.h.
> > 
> > BTW, compilation fails here
> > 
> > In file included from util/virqemuagent.c:35:0:
> > util/virqemuagent.h:29:26: fatal error: domain_conf.h: No such file or 
> > directory
> >   # include "domain_conf.h"
> > 
> Hmm, will have to fix it for v1. This series were applied on top of commit
> 2841e67 ("qemu: propagate bridge MTU into qemu "host_mtu" option") and I 
> didn't
> observe compilation  issues (neither make {syntax-check,check} IIRC).
> 
> >> +
> >> +typedef struct _qemuAgent qemuAgent;
> >> +typedef qemuAgent *qemuAgentPtr;
> >> +
> >> +typedef struct _qemuAgentCallbacks qemuAgentCallbacks;
> >> +typedef qemuAgentCallbacks *qemuAgentCallbacksPtr;
> >> +struct _qemuAgentCallbacks {
> >> +void (*destroy)(qemuAgentPtr mon,
> >> +virDomainObjPtr vm);
> >> +void (*eofNotify)(qemuAgentPtr mon,
> >> +  virDomainObjPtr vm);
> >> +void (*errorNotify)(qemuAgentPtr mon,
> >> +virDomainObjPtr vm);
> >> +};
> >> +
> >> +
> >> +qemuAgentPtr qemuAgentOpen(virDomainObjPtr vm,
> >> +   const virDomainChrSourceDef *config,
> >> +   qemuAgentCallbacksPtr cb);
> >> +
> >> +void qemuAgentClose(qemuAgentPtr mon);
> > 
> > Other files in src/util prefix structs and functions with "vir". I'm not 
> > sure 
> > how picky folks are about that. If the consensus is towards the "vir" 
> > prefix, 
> > perhaps it would be easier done with a follow-up after the move?
> Yeah I noticed the pattern. Though given the big move of code into util making
> as a follow-up patch would easy review perhaps.

It would be desirable to use the vir name prefix here, but that should
certainly be done as a separate patch - it is bad practice to move and
rename code at the same time, as it makes diffs harder to review.


Regards,
Daniel
-- 
|: http://berrange.com  -o-http:

Re: [libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-03-03 Thread Joao Martins


On 03/02/2017 05:58 PM, Jim Fehlig wrote:
> Sorry for the review delay.
> 
> On 02/08/2017 09:44 AM, Joao Martins wrote:
>> As it could be shared with libxl which now allows channels to
>> be created. Also changed filename to match others in the same
>> directory namely to virqemuagent.{h,c}
>>
>> Signed-off-by: Joao Martins 
>> ---
>>  po/POTFILES.in   |2 +-
>>  src/Makefile.am  |2 +-
>>  src/libvirt_private.syms |   21 +
>>  src/qemu/qemu_agent.c| 2248 
>> --
>>  src/qemu/qemu_agent.h|  123 ---
>>  src/qemu/qemu_domain.h   |2 +-
>>  src/qemu/qemu_driver.c   |2 +-
>>  src/util/virqemuagent.c  | 2248 
>> ++
>>  src/util/virqemuagent.h  |  123 +++
>>  tests/qemuagenttest.c|2 +-
>>  tests/qemumonitortestutils.c |2 +-
>>  tests/qemumonitortestutils.h |2 +-
>>  12 files changed, 2399 insertions(+), 2378 deletions(-)
>>  delete mode 100644 src/qemu/qemu_agent.c
>>  delete mode 100644 src/qemu/qemu_agent.h
>>  create mode 100644 src/util/virqemuagent.c
>>  create mode 100644 src/util/virqemuagent.h
> 
> I hope others will opine on this change. It seems reasonable to me and I'm 
> surprised the qemu driver only needed tiny changes to accommodate moving all 
> this code.

Yeap, I too was surprised on how the changes were non disruptive wrt to qemu
driver :)

> 
> [...]
>> diff --git a/src/util/virqemuagent.h b/src/util/virqemuagent.h
>> new file mode 100644
>> index 000..2e81020
>> --- /dev/null
>> +++ b/src/util/virqemuagent.h
>> @@ -0,0 +1,123 @@
>> +/*
>> + * virqemuagent.h: interaction with QEMU guest agent
>> + *
>> + * Copyright (C) 2006-2012 Red Hat, Inc.
>> + * Copyright (C) 2006 Daniel P. Berrange
>> + *
>> + * This library is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * This library is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this library.  If not, see
>> + * .
>> + *
>> + * Author: Daniel P. Berrange 
>> + */
>> +
>> +
>> +#ifndef __QEMU_AGENT_H__
>> +# define __QEMU_AGENT_H__
>> +
>> +# include "internal.h"
>> +# include "domain_conf.h"
> 
> ISTR a recent discussion on the list frowning on using code from src/conf in 
> src/util, although virthostdev.h also includes domain_conf.h.
> 
> BTW, compilation fails here
> 
> In file included from util/virqemuagent.c:35:0:
> util/virqemuagent.h:29:26: fatal error: domain_conf.h: No such file or 
> directory
>   # include "domain_conf.h"
> 
Hmm, will have to fix it for v1. This series were applied on top of commit
2841e67 ("qemu: propagate bridge MTU into qemu "host_mtu" option") and I didn't
observe compilation  issues (neither make {syntax-check,check} IIRC).

>> +
>> +typedef struct _qemuAgent qemuAgent;
>> +typedef qemuAgent *qemuAgentPtr;
>> +
>> +typedef struct _qemuAgentCallbacks qemuAgentCallbacks;
>> +typedef qemuAgentCallbacks *qemuAgentCallbacksPtr;
>> +struct _qemuAgentCallbacks {
>> +void (*destroy)(qemuAgentPtr mon,
>> +virDomainObjPtr vm);
>> +void (*eofNotify)(qemuAgentPtr mon,
>> +  virDomainObjPtr vm);
>> +void (*errorNotify)(qemuAgentPtr mon,
>> +virDomainObjPtr vm);
>> +};
>> +
>> +
>> +qemuAgentPtr qemuAgentOpen(virDomainObjPtr vm,
>> +   const virDomainChrSourceDef *config,
>> +   qemuAgentCallbacksPtr cb);
>> +
>> +void qemuAgentClose(qemuAgentPtr mon);
> 
> Other files in src/util prefix structs and functions with "vir". I'm not sure 
> how picky folks are about that. If the consensus is towards the "vir" prefix, 
> perhaps it would be easier done with a follow-up after the move?
Yeah I noticed the pattern. Though given the big move of code into util making
as a follow-up patch would easy review perhaps.

> 
> Thanks a lot for working on this feature! It would be cool to get it in the 
> 3.2.0 release.
> 
> Regards,
> Jim
> 

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


Re: [libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-03-02 Thread Jim Fehlig

Another self-reply...

On 03/02/2017 10:58 AM, Jim Fehlig wrote:

Sorry for the review delay.

On 02/08/2017 09:44 AM, Joao Martins wrote:

As it could be shared with libxl which now allows channels to
be created. Also changed filename to match others in the same
directory namely to virqemuagent.{h,c}

Signed-off-by: Joao Martins 
---
 po/POTFILES.in   |2 +-
 src/Makefile.am  |2 +-
 src/libvirt_private.syms |   21 +
 src/qemu/qemu_agent.c| 2248 --
 src/qemu/qemu_agent.h|  123 ---
 src/qemu/qemu_domain.h   |2 +-
 src/qemu/qemu_driver.c   |2 +-
 src/util/virqemuagent.c  | 2248 ++
 src/util/virqemuagent.h  |  123 +++
 tests/qemuagenttest.c|2 +-
 tests/qemumonitortestutils.c |2 +-
 tests/qemumonitortestutils.h |2 +-
 12 files changed, 2399 insertions(+), 2378 deletions(-)
 delete mode 100644 src/qemu/qemu_agent.c
 delete mode 100644 src/qemu/qemu_agent.h
 create mode 100644 src/util/virqemuagent.c
 create mode 100644 src/util/virqemuagent.h


I hope others will opine on this change. It seems reasonable to me and I'm
surprised the qemu driver only needed tiny changes to accommodate moving all
this code.

[...]



+qemuAgentPtr qemuAgentOpen(virDomainObjPtr vm,
+   const virDomainChrSourceDef *config,
+   qemuAgentCallbacksPtr cb);
+
+void qemuAgentClose(qemuAgentPtr mon);


Other files in src/util prefix structs and functions with "vir". I'm not sure
how picky folks are about that. If the consensus is towards the "vir" prefix,
perhaps it would be easier done with a follow-up after the move?


FYI, seems the "vir" prefix is preferred. See the discussion earlier today in 
this thread


https://www.redhat.com/archives/libvir-list/2017-March/msg00048.html

Regards,
Jim

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


Re: [libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-03-02 Thread Jim Fehlig

Sorry for the review delay.

On 02/08/2017 09:44 AM, Joao Martins wrote:

As it could be shared with libxl which now allows channels to
be created. Also changed filename to match others in the same
directory namely to virqemuagent.{h,c}

Signed-off-by: Joao Martins 
---
 po/POTFILES.in   |2 +-
 src/Makefile.am  |2 +-
 src/libvirt_private.syms |   21 +
 src/qemu/qemu_agent.c| 2248 --
 src/qemu/qemu_agent.h|  123 ---
 src/qemu/qemu_domain.h   |2 +-
 src/qemu/qemu_driver.c   |2 +-
 src/util/virqemuagent.c  | 2248 ++
 src/util/virqemuagent.h  |  123 +++
 tests/qemuagenttest.c|2 +-
 tests/qemumonitortestutils.c |2 +-
 tests/qemumonitortestutils.h |2 +-
 12 files changed, 2399 insertions(+), 2378 deletions(-)
 delete mode 100644 src/qemu/qemu_agent.c
 delete mode 100644 src/qemu/qemu_agent.h
 create mode 100644 src/util/virqemuagent.c
 create mode 100644 src/util/virqemuagent.h


I hope others will opine on this change. It seems reasonable to me and I'm 
surprised the qemu driver only needed tiny changes to accommodate moving all 
this code.


[...]


diff --git a/src/util/virqemuagent.h b/src/util/virqemuagent.h
new file mode 100644
index 000..2e81020
--- /dev/null
+++ b/src/util/virqemuagent.h
@@ -0,0 +1,123 @@
+/*
+ * virqemuagent.h: interaction with QEMU guest agent
+ *
+ * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * .
+ *
+ * Author: Daniel P. Berrange 
+ */
+
+
+#ifndef __QEMU_AGENT_H__
+# define __QEMU_AGENT_H__
+
+# include "internal.h"
+# include "domain_conf.h"


ISTR a recent discussion on the list frowning on using code from src/conf in 
src/util, although virthostdev.h also includes domain_conf.h.


BTW, compilation fails here

In file included from util/virqemuagent.c:35:0:
util/virqemuagent.h:29:26: fatal error: domain_conf.h: No such file or directory
 # include "domain_conf.h"


+
+typedef struct _qemuAgent qemuAgent;
+typedef qemuAgent *qemuAgentPtr;
+
+typedef struct _qemuAgentCallbacks qemuAgentCallbacks;
+typedef qemuAgentCallbacks *qemuAgentCallbacksPtr;
+struct _qemuAgentCallbacks {
+void (*destroy)(qemuAgentPtr mon,
+virDomainObjPtr vm);
+void (*eofNotify)(qemuAgentPtr mon,
+  virDomainObjPtr vm);
+void (*errorNotify)(qemuAgentPtr mon,
+virDomainObjPtr vm);
+};
+
+
+qemuAgentPtr qemuAgentOpen(virDomainObjPtr vm,
+   const virDomainChrSourceDef *config,
+   qemuAgentCallbacksPtr cb);
+
+void qemuAgentClose(qemuAgentPtr mon);


Other files in src/util prefix structs and functions with "vir". I'm not sure 
how picky folks are about that. If the consensus is towards the "vir" prefix, 
perhaps it would be easier done with a follow-up after the move?


Thanks a lot for working on this feature! It would be cool to get it in the 
3.2.0 release.


Regards,
Jim

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


[libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-02-08 Thread Joao Martins
As it could be shared with libxl which now allows channels to
be created. Also changed filename to match others in the same
directory namely to virqemuagent.{h,c}

Signed-off-by: Joao Martins 
---
 po/POTFILES.in   |2 +-
 src/Makefile.am  |2 +-
 src/libvirt_private.syms |   21 +
 src/qemu/qemu_agent.c| 2248 --
 src/qemu/qemu_agent.h|  123 ---
 src/qemu/qemu_domain.h   |2 +-
 src/qemu/qemu_driver.c   |2 +-
 src/util/virqemuagent.c  | 2248 ++
 src/util/virqemuagent.h  |  123 +++
 tests/qemuagenttest.c|2 +-
 tests/qemumonitortestutils.c |2 +-
 tests/qemumonitortestutils.h |2 +-
 12 files changed, 2399 insertions(+), 2378 deletions(-)
 delete mode 100644 src/qemu/qemu_agent.c
 delete mode 100644 src/qemu/qemu_agent.h
 create mode 100644 src/util/virqemuagent.c
 create mode 100644 src/util/virqemuagent.h

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 365ea66..ebb247b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -122,7 +122,6 @@ src/openvz/openvz_conf.c
 src/openvz/openvz_driver.c
 src/openvz/openvz_util.c
 src/phyp/phyp_driver.c
-src/qemu/qemu_agent.c
 src/qemu/qemu_alias.c
 src/qemu/qemu_capabilities.c
 src/qemu/qemu_cgroup.c
@@ -239,6 +238,7 @@ src/util/virpolkit.c
 src/util/virportallocator.c
 src/util/virprocess.c
 src/util/virqemu.c
+src/util/virqemuagent.c
 src/util/virrandom.c
 src/util/virrotatingfile.c
 src/util/virscsi.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 2f32d41..62c8733 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -161,6 +161,7 @@ UTIL_SOURCES =  
\
util/virprobe.h \
util/virprocess.c util/virprocess.h \
util/virqemu.c util/virqemu.h   \
+   util/virqemuagent.c util/virqemuagent.h \
util/virrandom.h util/virrandom.c   \
util/virrotatingfile.h util/virrotatingfile.c   \
util/virscsi.c util/virscsi.h   \
@@ -815,7 +816,6 @@ VBOX_DRIVER_EXTRA_DIST =
\
vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
 
 QEMU_DRIVER_SOURCES =  \
-   qemu/qemu_agent.c qemu/qemu_agent.h \
qemu/qemu_alias.c qemu/qemu_alias.h \
qemu/qemu_blockjob.c qemu/qemu_blockjob.h   \
qemu/qemu_capabilities.c qemu/qemu_capabilities.h   \
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index d556c7d..a5a1313 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2306,6 +2306,27 @@ virQEMUBuildLuksOpts;
 virQEMUBuildObjectCommandlineFromJSON;
 
 
+# util/virqemuagent.h
+qemuAgentArbitraryCommand;
+qemuAgentClose;
+qemuAgentFSFreeze;
+qemuAgentFSThaw;
+qemuAgentFSTrim;
+qemuAgentGetFSInfo;
+qemuAgentGetInterfaces;
+qemuAgentGetTime;
+qemuAgentGetVCPUs;
+qemuAgentNotifyClose;
+qemuAgentNotifyEvent;
+qemuAgentOpen;
+qemuAgentSetVCPUs;
+qemuAgentSetUserPassword;
+qemuAgentSetTime;
+qemuAgentShutdown;
+qemuAgentSuspend;
+qemuAgentUpdateCPUInfo;
+
+
 # util/virrandom.h
 virRandom;
 virRandomBits;
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
deleted file mode 100644
index 46cad53..000
--- a/src/qemu/qemu_agent.c
+++ /dev/null
@@ -1,2248 +0,0 @@
-/*
- * qemu_agent.c: interaction with QEMU guest agent
- *
- * Copyright (C) 2006-2014 Red Hat, Inc.
- * Copyright (C) 2006 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * .
- *
- * Author: Daniel P. Berrange 
- */
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "qemu_agent.h"
-#include "viralloc.h"
-#include "virlog.h"
-#include "virerror.h"
-#include "virjson.h"
-#include "virfile.h"
-#include "virprocess.h"
-#include "virtime.h"
-#include "virobject.h"
-#include "virstring.h"
-#include "base64.h"
-
-#define VIR_FROM_THIS VIR_FROM_QEMU
-
-VIR_LOG_INIT("qemu.qemu_agent");
-
-#define LINE_ENDING "\n"
-
-#define DEBUG_IO 0
-#define DEBUG_RAW_IO 0
-
-/* When you are the fi