All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/8] qemu-ga patch queue
@ 2017-04-25 23:04 Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 1/8] qemu-ga: Make QGA VSS provider service run only when needed Michael Roth
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The following changes since commit fe491fa85c4634453b340b18046aae2eaf8147db:

  Merge remote-tracking branch 'remotes/agraf/tags/signed-s390-for-upstream' into staging (2017-04-25 14:48:55 +0100)

are available in the git repository at:

  git://github.com/mdroth/qemu.git tags/qga-pull-2017-04-25-tag

for you to fetch changes up to b3734da00e4285521f8eb2c958ab08b981f7a298:

  qga: Add `guest-get-timezone` command (2017-04-25 15:49:24 -0500)

----------------------------------------------------------------
qemu-ga patch queue

* new commands: guest-get-timezone, guest-get-users, guest-get-host-name
* fix hang on w32 when stopping qemu-ga service while fs frozen
* fix missing setting of can-offline in guest-get-vcpus
* make qemu-ga VSS w32 service on-demand rather than on-startup
* fix unecessary errors to EventLog on w32
* improvements to fsfreeze documentation

----------------------------------------------------------------
Marc-André Lureau (1):
      qga: improve fsfreeze documentations

Sameeh Jubran (4):
      qemu-ga: Make QGA VSS provider service run only when needed
      qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply
      qga-win: Fix a bug where qemu-ga service is stuck during stop operation
      qga-win: Fix Event Viewer errors caused by qemu-ga

Vinzenz Feenstra (3):
      qga: Add 'guest-get-host-name' command
      qga: Add 'guest-get-users' command
      qga: Add `guest-get-timezone` command

 configure                   |   2 +-
 include/glib-compat.h       |   5 +++
 qga/commands-posix.c        |  60 +++++++++++++++++++++++++
 qga/commands-win32.c        | 105 +++++++++++++++++++++++++++++++++++++++++++-
 qga/commands.c              |  49 +++++++++++++++++++++
 qga/main.c                  |  23 ++++++++++
 qga/qapi-schema.json        |  87 +++++++++++++++++++++++++++++++++++-
 qga/vss-win32.h             |   1 +
 qga/vss-win32/install.cpp   |  28 +++++++++++-
 qga/vss-win32/install.h     |  20 +++++++++
 qga/vss-win32/provider.cpp  |   1 -
 qga/vss-win32/requester.cpp |   2 +
 qga/vss-win32/vss-common.h  |  11 +----
 qga/vss-win32/vss-handles.h |  14 ++++++
 14 files changed, 391 insertions(+), 17 deletions(-)
 create mode 100644 qga/vss-win32/install.h
 create mode 100644 qga/vss-win32/vss-handles.h

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 1/8] qemu-ga: Make QGA VSS provider service run only when needed
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 2/8] qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply Michael Roth
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Sameeh Jubran

From: Sameeh Jubran <sameeh@daynix.com>

Currently the service runs in background on boot even though it is not
needed and once it is running it never stops. The service needs to be
running only during freeze operation and it should be stopped after
executing thaw.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/install.cpp   | 28 ++++++++++++++++++++++++++--
 qga/vss-win32/install.h     | 20 ++++++++++++++++++++
 qga/vss-win32/requester.cpp |  2 ++
 3 files changed, 48 insertions(+), 2 deletions(-)
 create mode 100644 qga/vss-win32/install.h

diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index f4160a3..f41fcdf 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -14,7 +14,7 @@
 
 #include "vss-common.h"
 #include <inc/win2003/vscoordint.h>
-#include <comadmin.h>
+#include "install.h"
 #include <wbemidl.h>
 #include <comdef.h>
 #include <comutil.h>
@@ -276,7 +276,7 @@ STDAPI COMRegister(void)
 
     chk(pCatalog->CreateServiceForApplication(
             _bstr_t(QGA_PROVIDER_LNAME), _bstr_t(QGA_PROVIDER_LNAME),
-            _bstr_t(L"SERVICE_AUTO_START"), _bstr_t(L"SERVICE_ERROR_NORMAL"),
+            _bstr_t(L"SERVICE_DEMAND_START"), _bstr_t(L"SERVICE_ERROR_NORMAL"),
             _bstr_t(L""), _bstr_t(L".\\localsystem"), _bstr_t(L""), FALSE));
     chk(pCatalog->InstallComponent(_bstr_t(QGA_PROVIDER_LNAME),
                                    _bstr_t(dllPath), _bstr_t(tlbPath),
@@ -461,3 +461,27 @@ namespace _com_util
         return bstr;
     }
 }
+
+/* Stop QGA VSS provider service from COM+ Application Admin Catalog */
+
+STDAPI StopService(void)
+{
+    HRESULT hr;
+    COMInitializer initializer;
+    COMPointer<IUnknown> pUnknown;
+    COMPointer<ICOMAdminCatalog2> pCatalog;
+
+    int count = 0;
+
+    chk(QGAProviderFind(QGAProviderCount, (void *)&count));
+    if (count) {
+        chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERVER,
+            IID_IUnknown, (void **)pUnknown.replace()));
+        chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2,
+            (void **)pCatalog.replace()));
+        chk(pCatalog->ShutdownApplication(_bstr_t(QGA_PROVIDER_LNAME)));
+    }
+
+out:
+    return hr;
+}
diff --git a/qga/vss-win32/install.h b/qga/vss-win32/install.h
new file mode 100644
index 0000000..35364af
--- /dev/null
+++ b/qga/vss-win32/install.h
@@ -0,0 +1,20 @@
+/*
+ * QEMU Guest Agent VSS requester declarations
+ *
+ * Copyright Hitachi Data Systems Corp. 2013
+ *
+ * Authors:
+ *  Tomoki Sekiyama   <tomoki.sekiyama@hds.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef INSTALL_H
+#define INSTALL_H
+
+#include <comadmin.h>
+
+STDAPI StopService(void);
+
+#endif
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 0cd2f0e..301762d 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "vss-common.h"
 #include "requester.h"
+#include "install.h"
 #include <inc/win2003/vswriter.h>
 #include <inc/win2003/vsbackup.h>
 
@@ -501,4 +502,5 @@ void requester_thaw(int *num_vols, ErrorSet *errset)
     requester_cleanup();
 
     CoUninitialize();
+    StopService();
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 2/8] qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 1/8] qemu-ga: Make QGA VSS provider service run only when needed Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 3/8] qga-win: Fix a bug where qemu-ga service is stuck during stop operation Michael Roth
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Sameeh Jubran, qemu-stable

From: Sameeh Jubran <sameeh@daynix.com>

The QGA schema states:

@can-offline: Whether offlining the VCPU is possible. This member
               is always filled in by the guest agent when the structure
               is returned, and always ignored on input (hence it can be
               omitted then).

Currently 'can-offline' is missing entirely from the reply. This causes
errors in libvirt which is expecting the reply to be compliant with the
schema docs.

BZ#1438735: https://bugzilla.redhat.com/show_bug.cgi?id=1438735

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 04026ee..9fec1fb 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -1344,7 +1344,7 @@ GuestLogicalProcessorList *qmp_guest_get_vcpus(Error **errp)
                     vcpu = g_malloc0(sizeof *vcpu);
                     vcpu->logical_id = current++;
                     vcpu->online = true;
-                    vcpu->has_can_offline = false;
+                    vcpu->has_can_offline = true;
 
                     entry = g_malloc0(sizeof *entry);
                     entry->value = vcpu;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 3/8] qga-win: Fix a bug where qemu-ga service is stuck during stop operation
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 1/8] qemu-ga: Make QGA VSS provider service run only when needed Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 2/8] qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 4/8] qga-win: Fix Event Viewer errors caused by qemu-ga Michael Roth
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Sameeh Jubran

From: Sameeh Jubran <sameeh@daynix.com>

After triggering a freeze command without any following thaw command,
qemu-ga will not respond to stop operation. This behaviour is wanted on Linux
as there is no time limit for a freeze command and we want to prevent
quitting in the middle of freeze, on the other hand on Windows the time
limit for freeze is 10 seconds, so we should wait for the timeout, thaw
the file system and quit.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/main.c                  | 23 +++++++++++++++++++++++
 qga/vss-win32.h             |  1 +
 qga/vss-win32/vss-common.h  | 11 +----------
 qga/vss-win32/vss-handles.h | 14 ++++++++++++++
 4 files changed, 39 insertions(+), 10 deletions(-)
 create mode 100644 qga/vss-win32/vss-handles.h

diff --git a/qga/main.c b/qga/main.c
index 07c2953..ad6f68f 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -131,9 +131,32 @@ static void quit_handler(int sig)
      * unless all log/pid files are on unfreezable filesystems. there's
      * also a very likely chance killing the agent before unfreezing
      * the filesystems is a mistake (or will be viewed as one later).
+     * On Windows the freeze interval is limited to 10 seconds, so
+     * we should quit, but first we should wait for the timeout, thaw
+     * the filesystem and quit.
      */
     if (ga_is_frozen(ga_state)) {
+#ifdef _WIN32
+        int i = 0;
+        Error *err = NULL;
+        HANDLE hEventTimeout;
+
+        g_debug("Thawing filesystems before exiting");
+
+        hEventTimeout = OpenEvent(EVENT_ALL_ACCESS, FALSE, EVENT_NAME_TIMEOUT);
+        if (hEventTimeout) {
+            WaitForSingleObject(hEventTimeout, 0);
+            CloseHandle(hEventTimeout);
+        }
+        qga_vss_fsfreeze(&i, false, &err);
+        if (err) {
+            g_debug("Error unfreezing filesystems prior to exiting: %s",
+                error_get_pretty(err));
+            error_free(err);
+        }
+#else
         return;
+#endif
     }
     g_debug("received signal num %d, quitting", sig);
 
diff --git a/qga/vss-win32.h b/qga/vss-win32.h
index 51d303a..4f8e39a 100644
--- a/qga/vss-win32.h
+++ b/qga/vss-win32.h
@@ -13,6 +13,7 @@
 #ifndef VSS_WIN32_H
 #define VSS_WIN32_H
 
+#include "qga/vss-win32/vss-handles.h"
 
 bool vss_init(bool init_requester);
 void vss_deinit(bool deinit_requester);
diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h
index c81a856..61c170b 100644
--- a/qga/vss-win32/vss-common.h
+++ b/qga/vss-win32/vss-common.h
@@ -51,21 +51,12 @@
  * http://www.microsoft.com/en-us/download/details.aspx?id=23490
  */
 #include <inc/win2003/vss.h>
+#include "vss-handles.h"
 
 /* Macros to convert char definitions to wchar */
 #define _L(a) L##a
 #define L(a) _L(a)
 
-/* Constants for QGA VSS Provider */
-
-#define QGA_PROVIDER_NAME "QEMU Guest Agent VSS Provider"
-#define QGA_PROVIDER_LNAME L(QGA_PROVIDER_NAME)
-#define QGA_PROVIDER_VERSION L(QEMU_VERSION)
-
-#define EVENT_NAME_FROZEN  "Global\\QGAVSSEvent-frozen"
-#define EVENT_NAME_THAW    "Global\\QGAVSSEvent-thaw"
-#define EVENT_NAME_TIMEOUT "Global\\QGAVSSEvent-timeout"
-
 const GUID g_gProviderId = { 0x3629d4ed, 0xee09, 0x4e0e,
     {0x9a, 0x5c, 0x6d, 0x8b, 0xa2, 0x87, 0x2a, 0xef} };
 const GUID g_gProviderVersion = { 0x11ef8b15, 0xcac6, 0x40d6,
diff --git a/qga/vss-win32/vss-handles.h b/qga/vss-win32/vss-handles.h
new file mode 100644
index 0000000..ff399dd
--- /dev/null
+++ b/qga/vss-win32/vss-handles.h
@@ -0,0 +1,14 @@
+#ifndef VSS_HANDLES
+#define VSS_HANDLES
+
+/* Constants for QGA VSS Provider */
+
+#define QGA_PROVIDER_NAME "QEMU Guest Agent VSS Provider"
+#define QGA_PROVIDER_LNAME L(QGA_PROVIDER_NAME)
+#define QGA_PROVIDER_VERSION L(QEMU_VERSION)
+
+#define EVENT_NAME_FROZEN  "Global\\QGAVSSEvent-frozen"
+#define EVENT_NAME_THAW    "Global\\QGAVSSEvent-thaw"
+#define EVENT_NAME_TIMEOUT "Global\\QGAVSSEvent-timeout"
+
+#endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 4/8] qga-win: Fix Event Viewer errors caused by qemu-ga
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
                   ` (2 preceding siblings ...)
  2017-04-25 23:04 ` [Qemu-devel] [PULL 3/8] qga-win: Fix a bug where qemu-ga service is stuck during stop operation Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 5/8] qga: Add 'guest-get-host-name' command Michael Roth
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Sameeh Jubran

From: Sameeh Jubran <sameeh@daynix.com>

When the command "guest-fsfreeze-freeze" is executed it causes
the VSS service to log the error below in the Event Viewer. This
error is caused by an issue in the function "CommitSnapshots" in
provider.cpp:

* When VSS_TIMEOUT_MSEC expires the funtion returns E_ABORT. This causes
the error #12293.

|event id|                           error                               |
* 12293  : Volume Shadow Copy Service error: Error calling a routine on a
           Shadow Copy Provider {00000000-0000-0000-0000-000000000000}.
           Routine details CommitSnapshots [hr = 0x80004004, Operation
           aborted.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/provider.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
index ef94669..72d8b0e 100644
--- a/qga/vss-win32/provider.cpp
+++ b/qga/vss-win32/provider.cpp
@@ -377,7 +377,6 @@ STDMETHODIMP CQGAVssProvider::CommitSnapshots(VSS_ID SnapshotSetId)
     if (WaitForSingleObject(hEventThaw, VSS_TIMEOUT_MSEC) != WAIT_OBJECT_0) {
         /* Send event to qemu-ga to notify the provider is timed out */
         SetEvent(hEventTimeout);
-        hr = E_ABORT;
     }
 
     CloseHandle(hEventThaw);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 5/8] qga: Add 'guest-get-host-name' command
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
                   ` (3 preceding siblings ...)
  2017-04-25 23:04 ` [Qemu-devel] [PULL 4/8] qga-win: Fix Event Viewer errors caused by qemu-ga Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 6/8] qga: improve fsfreeze documentations Michael Roth
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Vinzenz Feenstra

From: Vinzenz Feenstra <vfeenstr@redhat.com>

Retrieving the guest host name is a very useful feature for virtual management
systems. This information can help to have more user friendly VM access
details, instead of an IP there would be the host name. Also the host name
reported can be used to have automated checks for valid SSL certificates.

virsh # qemu-agent-command F25 '{ "execute": "guest-get-host-name" }'
{"return":{"host-name":"F25.lab.evilissimo.net"}}

Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
* minor whitespace fix-ups
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands.c       | 11 +++++++++++
 qga/qapi-schema.json | 26 ++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/qga/commands.c b/qga/commands.c
index 4d92946..57a31bb 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -499,3 +499,14 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp)
     error_setg(errp, "invalid whence code %"PRId64, whence->u.value);
     return -1;
 }
+
+GuestHostName *qmp_guest_get_host_name(Error **err)
+{
+    GuestHostName *result = NULL;
+    gchar const *hostname = g_get_host_name();
+    if (hostname != NULL) {
+        result = g_new0(GuestHostName, 1);
+        result->host_name = g_strdup(hostname);
+    }
+    return result;
+}
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index a02dbf2..6307ae2 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1042,3 +1042,29 @@
   'data':    { 'path': 'str', '*arg': ['str'], '*env': ['str'],
                '*input-data': 'str', '*capture-output': 'bool' },
   'returns': 'GuestExec' }
+
+
+##
+# @GuestHostName:
+# @host-name: Fully qualified domain name of the guest OS
+#
+# Since: 2.10
+##
+{ 'struct': 'GuestHostName',
+  'data':   { 'host-name': 'str' } }
+
+##
+# @guest-get-host-name:
+#
+# Return a name for the machine.
+#
+# The returned name is not necessarily a fully-qualified domain name, or even
+# present in DNS or some other name service at all. It need not even be unique
+# on your local network or site, but usually it is.
+#
+# Returns: the host name of the machine on success
+#
+# Since: 2.10
+##
+{ 'command': 'guest-get-host-name',
+  'returns': 'GuestHostName' }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 6/8] qga: improve fsfreeze documentations
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
                   ` (4 preceding siblings ...)
  2017-04-25 23:04 ` [Qemu-devel] [PULL 5/8] qga: Add 'guest-get-host-name' command Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 7/8] qga: Add 'guest-get-users' command Michael Roth
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Some users find the fsfreeze behaviour confusing. Add some notes about
invalid mount points and Windows usage.

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1436976

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Vinzenz Feenstra <vfeenstr@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/qapi-schema.json | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 6307ae2..0f4cba5 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -426,7 +426,13 @@
 ##
 # @guest-fsfreeze-freeze:
 #
-# Sync and freeze all freezable, local guest filesystems
+# Sync and freeze all freezable, local guest filesystems. If this
+# command succeeded, you may call @guest-fsfreeze-thaw later to
+# unfreeze.
+#
+# Note: On Windows, the command is implemented with the help of a
+# Volume Shadow-copy Service DLL helper. The frozen state is limited
+# for up to 10 seconds by VSS.
 #
 # Returns: Number of file systems currently frozen. On error, all filesystems
 # will be thawed.
@@ -439,10 +445,12 @@
 ##
 # @guest-fsfreeze-freeze-list:
 #
-# Sync and freeze specified guest filesystems
+# Sync and freeze specified guest filesystems.
+# See also @guest-fsfreeze-freeze.
 #
 # @mountpoints: an array of mountpoints of filesystems to be frozen.
 #               If omitted, every mounted filesystem is frozen.
+#               Invalid mount points are ignored.
 #
 # Returns: Number of file systems currently frozen. On error, all filesystems
 # will be thawed.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 7/8] qga: Add 'guest-get-users' command
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
                   ` (5 preceding siblings ...)
  2017-04-25 23:04 ` [Qemu-devel] [PULL 6/8] qga: improve fsfreeze documentations Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-25 23:04 ` [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command Michael Roth
  2017-04-26 10:51 ` [Qemu-devel] [PULL 0/8] qemu-ga patch queue Peter Maydell
  8 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Vinzenz Feenstra

From: Vinzenz Feenstra <vfeenstr@redhat.com>

A command that will list all currently logged in users, and the time
since when they are logged in.

Examples:

virsh # qemu-agent-command F25 '{ "execute": "guest-get-users" }'
{"return":[{"login-time":1490622289.903835,"user":"root"}]}

virsh # qemu-agent-command Win2k12r2 '{ "execute": "guest-get-users" }'
{"return":[{"login-time":1490351044.670552,"domain":"LADIDA",
"user":"Administrator"}]}

Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 configure             |   2 +-
 include/glib-compat.h |   5 +++
 qga/commands-posix.c  |  60 +++++++++++++++++++++++++++++
 qga/commands-win32.c  | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++
 qga/qapi-schema.json  |  25 ++++++++++++
 5 files changed, 194 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 5c2accc..74ba64b 100755
--- a/configure
+++ b/configure
@@ -743,7 +743,7 @@ if test "$mingw32" = "yes" ; then
   sysconfdir="\${prefix}"
   local_statedir=
   confsuffix=""
-  libs_qga="-lws2_32 -lwinmm -lpowrprof -liphlpapi -lnetapi32 $libs_qga"
+  libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -liphlpapi -lnetapi32 $libs_qga"
 fi
 
 werror=""
diff --git a/include/glib-compat.h b/include/glib-compat.h
index 863c8cf..f8ee9dc 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -217,6 +217,11 @@ static inline void g_hash_table_add(GHashTable *hash_table, gpointer key)
 {
     g_hash_table_replace(hash_table, key, key);
 }
+
+static gboolean g_hash_table_contains(GHashTable *hash_table, gpointer key)
+{
+    return g_hash_table_lookup_extended(hash_table, key, NULL, NULL);
+}
 #endif
 
 #ifndef g_assert_true
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 915df9e..ba06be4 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -15,6 +15,7 @@
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <dirent.h>
+#include <utmpx.h>
 #include "qga/guest-agent-core.h"
 #include "qga-qmp-commands.h"
 #include "qapi/qmp/qerror.h"
@@ -2517,3 +2518,62 @@ void ga_command_state_init(GAState *s, GACommandState *cs)
     ga_command_state_add(cs, NULL, guest_fsfreeze_cleanup);
 #endif
 }
+
+#define QGA_MICRO_SECOND_TO_SECOND 1000000
+
+static double ga_get_login_time(struct utmpx *user_info)
+{
+    double seconds = (double)user_info->ut_tv.tv_sec;
+    double useconds = (double)user_info->ut_tv.tv_usec;
+    useconds /= QGA_MICRO_SECOND_TO_SECOND;
+    return seconds + useconds;
+}
+
+GuestUserList *qmp_guest_get_users(Error **err)
+{
+    GHashTable *cache = NULL;
+    GuestUserList *head = NULL, *cur_item = NULL;
+    struct utmpx *user_info = NULL;
+    gpointer value = NULL;
+    GuestUser *user = NULL;
+    GuestUserList *item = NULL;
+    double login_time = 0;
+
+    cache = g_hash_table_new(g_str_hash, g_str_equal);
+    setutxent();
+
+    for (;;) {
+        user_info = getutxent();
+        if (user_info == NULL) {
+            break;
+        } else if (user_info->ut_type != USER_PROCESS) {
+            continue;
+        } else if (g_hash_table_contains(cache, user_info->ut_user)) {
+            value = g_hash_table_lookup(cache, user_info->ut_user);
+            user = (GuestUser *)value;
+            login_time = ga_get_login_time(user_info);
+            /* We're ensuring the earliest login time to be sent */
+            if (login_time < user->login_time) {
+                user->login_time = login_time;
+            }
+            continue;
+        }
+
+        item = g_new0(GuestUserList, 1);
+        item->value = g_new0(GuestUser, 1);
+        item->value->user = g_strdup(user_info->ut_user);
+        item->value->login_time = ga_get_login_time(user_info);
+
+        g_hash_table_insert(cache, item->value->user, item->value);
+
+        if (!cur_item) {
+            head = cur_item = item;
+        } else {
+            cur_item->next = item;
+            cur_item = item;
+        }
+    }
+    endutxent();
+    g_hash_table_destroy(cache);
+    return head;
+}
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 9fec1fb..439d229 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -11,6 +11,9 @@
  * See the COPYING file in the top-level directory.
  */
 
+#ifndef _WIN32_WINNT
+#   define _WIN32_WINNT 0x0600
+#endif
 #include "qemu/osdep.h"
 #include <wtypes.h>
 #include <powrprof.h>
@@ -25,6 +28,7 @@
 #include <initguid.h>
 #endif
 #include <lm.h>
+#include <wtsapi32.h>
 
 #include "qga/guest-agent-core.h"
 #include "qga/vss-win32.h"
@@ -1536,3 +1540,102 @@ void ga_command_state_init(GAState *s, GACommandState *cs)
         ga_command_state_add(cs, NULL, guest_fsfreeze_cleanup);
     }
 }
+
+/* MINGW is missing two fields: IncomingFrames & OutgoingFrames */
+typedef struct _GA_WTSINFOA {
+    WTS_CONNECTSTATE_CLASS State;
+    DWORD SessionId;
+    DWORD IncomingBytes;
+    DWORD OutgoingBytes;
+    DWORD IncomingFrames;
+    DWORD OutgoingFrames;
+    DWORD IncomingCompressedBytes;
+    DWORD OutgoingCompressedBy;
+    CHAR WinStationName[WINSTATIONNAME_LENGTH];
+    CHAR Domain[DOMAIN_LENGTH];
+    CHAR UserName[USERNAME_LENGTH + 1];
+    LARGE_INTEGER ConnectTime;
+    LARGE_INTEGER DisconnectTime;
+    LARGE_INTEGER LastInputTime;
+    LARGE_INTEGER LogonTime;
+    LARGE_INTEGER CurrentTime;
+
+} GA_WTSINFOA;
+
+GuestUserList *qmp_guest_get_users(Error **err)
+{
+#if (_WIN32_WINNT >= 0x0600)
+#define QGA_NANOSECONDS 10000000
+
+    GHashTable *cache = NULL;
+    GuestUserList *head = NULL, *cur_item = NULL;
+
+    DWORD buffer_size = 0, count = 0, i = 0;
+    GA_WTSINFOA *info = NULL;
+    WTS_SESSION_INFOA *entries = NULL;
+    GuestUserList *item = NULL;
+    GuestUser *user = NULL;
+    gpointer value = NULL;
+    INT64 login = 0;
+    double login_time = 0;
+
+    cache = g_hash_table_new(g_str_hash, g_str_equal);
+
+    if (WTSEnumerateSessionsA(NULL, 0, 1, &entries, &count)) {
+        for (i = 0; i < count; ++i) {
+            buffer_size = 0;
+            info = NULL;
+            if (WTSQuerySessionInformationA(
+                NULL,
+                entries[i].SessionId,
+                WTSSessionInfo,
+                (LPSTR *)&info,
+                &buffer_size
+            )) {
+
+                if (strlen(info->UserName) == 0) {
+                    WTSFreeMemory(info);
+                    continue;
+                }
+
+                login = info->LogonTime.QuadPart;
+                login -= W32_FT_OFFSET;
+                login_time = ((double)login) / QGA_NANOSECONDS;
+
+                if (g_hash_table_contains(cache, info->UserName)) {
+                    value = g_hash_table_lookup(cache, info->UserName);
+                    user = (GuestUser *)value;
+                    if (user->login_time > login_time) {
+                        user->login_time = login_time;
+                    }
+                } else {
+                    item = g_new0(GuestUserList, 1);
+                    item->value = g_new0(GuestUser, 1);
+
+                    item->value->user = g_strdup(info->UserName);
+                    item->value->domain = g_strdup(info->Domain);
+                    item->value->has_domain = true;
+
+                    item->value->login_time = login_time;
+
+                    g_hash_table_add(cache, item->value->user);
+
+                    if (!cur_item) {
+                        head = cur_item = item;
+                    } else {
+                        cur_item->next = item;
+                        cur_item = item;
+                    }
+                }
+            }
+            WTSFreeMemory(info);
+        }
+        WTSFreeMemory(entries);
+    }
+    g_hash_table_destroy(cache);
+    return head;
+#else
+    error_setg(err, QERR_UNSUPPORTED);
+    return NULL;
+#endif
+}
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 0f4cba5..f25467a 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1076,3 +1076,28 @@
 ##
 { 'command': 'guest-get-host-name',
   'returns': 'GuestHostName' }
+
+
+##
+# @GuestUser:
+# @user:       Username
+# @domain:     Logon domain (windows only)
+# @login-time: Time of login of this user on the computer. If multiple
+#              instances of the user are logged in, the earliest login time is
+#              reported. The value is in fractional seconds since epoch time.
+#
+# Since: 2.10
+##
+{ 'struct': 'GuestUser',
+  'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
+
+##
+# @guest-get-users:
+# Retrieves a list of currently active users on the VM.
+#
+# Returns: A unique list of users.
+#
+# Since: 2.10
+##
+{ 'command': 'guest-get-users',
+  'returns': ['GuestUser'] }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
                   ` (6 preceding siblings ...)
  2017-04-25 23:04 ` [Qemu-devel] [PULL 7/8] qga: Add 'guest-get-users' command Michael Roth
@ 2017-04-25 23:04 ` Michael Roth
  2017-04-26 11:02   ` Daniel P. Berrange
  2017-04-26 10:51 ` [Qemu-devel] [PULL 0/8] qemu-ga patch queue Peter Maydell
  8 siblings, 1 reply; 15+ messages in thread
From: Michael Roth @ 2017-04-25 23:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Vinzenz Feenstra

From: Vinzenz Feenstra <vfeenstr@redhat.com>

Adds a new command `guest-get-timezone` reporting the currently
configured timezone on the system. The information on what timezone is
currently is configured is useful in case of Windows VMs where the
offset of the hardware clock is required to have the same offset. This
can be used for management systems like `oVirt` to detect the timezone
difference and warn administrators of the misconfiguration.

Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
Reviewed-by: Sameeh Jubran <sameeh@daynix.com>
Tested-by: Sameeh Jubran <sameeh@daynix.com>
* moved stub implementation to end of function for consistency
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands.c       | 38 ++++++++++++++++++++++++++++++++++++++
 qga/qapi-schema.json | 24 ++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/qga/commands.c b/qga/commands.c
index 57a31bb..3333ed5 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -510,3 +510,41 @@ GuestHostName *qmp_guest_get_host_name(Error **err)
     }
     return result;
 }
+
+GuestTimezone *qmp_guest_get_timezone(Error **errp)
+{
+#if GLIB_CHECK_VERSION(2, 28, 0)
+    GuestTimezone *info = NULL;
+    GTimeZone *tz = NULL;
+    gint64 now = 0;
+    gint32 intv = 0;
+    gchar const *name = NULL;
+
+    info = g_new0(GuestTimezone, 1);
+    tz = g_time_zone_new_local();
+    if (tz == NULL) {
+        error_setg(errp, QERR_QGA_COMMAND_FAILED,
+                   "Couldn't retrieve local timezone");
+        goto error;
+    }
+
+    now = g_get_real_time() / G_USEC_PER_SEC;
+    intv = g_time_zone_find_interval(tz, G_TIME_TYPE_UNIVERSAL, now);
+    info->offset = g_time_zone_get_offset(tz, intv);
+    name = g_time_zone_get_abbreviation(tz, intv);
+    if (name != NULL) {
+        info->has_zone = true;
+        info->zone = g_strdup(name);
+    }
+    g_time_zone_unref(tz);
+
+    return info;
+
+error:
+    g_free(info);
+    return NULL;
+#else
+    error_setg(errp, QERR_UNSUPPORTED);
+    return NULL;
+#endif
+}
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index f25467a..5c325b1 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1101,3 +1101,27 @@
 ##
 { 'command': 'guest-get-users',
   'returns': ['GuestUser'] }
+
+##
+# @GuestTimezone:
+#
+# @zone:    Timezone name
+# @offset:  Offset to UTC in seconds, negative numbers for time zones west of
+#           GMT, positive numbers for east
+#
+# Since: 2.10
+##
+{ 'struct': 'GuestTimezone',
+  'data':   { '*zone': 'str', 'offset': 'int' } }
+
+##
+# @guest-get-timezone:
+#
+# Retrieves the timezone information from the guest.
+#
+# Returns: A GuestTimezone dictionary.
+#
+# Since: 2.10
+##
+{ 'command': 'guest-get-timezone',
+  'returns': 'GuestTimezone' }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] [PULL 0/8] qemu-ga patch queue
  2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
                   ` (7 preceding siblings ...)
  2017-04-25 23:04 ` [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command Michael Roth
@ 2017-04-26 10:51 ` Peter Maydell
  8 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2017-04-26 10:51 UTC (permalink / raw)
  To: Michael Roth; +Cc: QEMU Developers

On 26 April 2017 at 00:04, Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> The following changes since commit fe491fa85c4634453b340b18046aae2eaf8147db:
>
>   Merge remote-tracking branch 'remotes/agraf/tags/signed-s390-for-upstream' into staging (2017-04-25 14:48:55 +0100)
>
> are available in the git repository at:
>
>   git://github.com/mdroth/qemu.git tags/qga-pull-2017-04-25-tag
>
> for you to fetch changes up to b3734da00e4285521f8eb2c958ab08b981f7a298:
>
>   qga: Add `guest-get-timezone` command (2017-04-25 15:49:24 -0500)
>
> ----------------------------------------------------------------
> qemu-ga patch queue
>
> * new commands: guest-get-timezone, guest-get-users, guest-get-host-name
> * fix hang on w32 when stopping qemu-ga service while fs frozen
> * fix missing setting of can-offline in guest-get-vcpus
> * make qemu-ga VSS w32 service on-demand rather than on-startup
> * fix unecessary errors to EventLog on w32
> * improvements to fsfreeze documentation
>

Hi. I'm afraid this doesn't build with clang:

In file included from
/Users/pm215/src/qemu-for-merges/qapi/qapi-dealloc-visitor.c:15:
In file included from /Users/pm215/src/qemu-for-merges/include/qemu/osdep.h:107:
/Users/pm215/src/qemu-for-merges/include/glib-compat.h:221:17: error:
unused function 'g_hash_table_contains' [-Werror,-Wunused-function]
static gboolean g_hash_table_contains(GHashTable *hash_table, gpointer key)
                ^
1 error generated.

Marking it "static inline" should fix this.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command
  2017-04-25 23:04 ` [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command Michael Roth
@ 2017-04-26 11:02   ` Daniel P. Berrange
  2017-04-26 13:08     ` Eric Blake
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel P. Berrange @ 2017-04-26 11:02 UTC (permalink / raw)
  To: Michael Roth; +Cc: qemu-devel, peter.maydell, Vinzenz Feenstra

On Tue, Apr 25, 2017 at 06:04:41PM -0500, Michael Roth wrote:
> From: Vinzenz Feenstra <vfeenstr@redhat.com>
> 
> Adds a new command `guest-get-timezone` reporting the currently
> configured timezone on the system. The information on what timezone is
> currently is configured is useful in case of Windows VMs where the
> offset of the hardware clock is required to have the same offset. This
> can be used for management systems like `oVirt` to detect the timezone
> difference and warn administrators of the misconfiguration.

> +GuestTimezone *qmp_guest_get_timezone(Error **errp)
> +{

> +    name = g_time_zone_get_abbreviation(tz, intv);

[snip]

> +##
> +# @GuestTimezone:
> +#
> +# @zone:    Timezone name

This isn't clearly documented in glib, but it looks like the time zone
names are *different* when glib is run on POSIX vs Win32 platforms.

Do we really want to expose something in QAPI that is going to have
different semantics depending on the guest OS the agent runs in ?

> +# @offset:  Offset to UTC in seconds, negative numbers for time zones west of
> +#           GMT, positive numbers for east
> +#
> +# Since: 2.10
> +##
> +{ 'struct': 'GuestTimezone',
> +  'data':   { '*zone': 'str', 'offset': 'int' } }

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command
  2017-04-26 11:02   ` Daniel P. Berrange
@ 2017-04-26 13:08     ` Eric Blake
  2017-04-26 13:10       ` Daniel P. Berrange
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Blake @ 2017-04-26 13:08 UTC (permalink / raw)
  To: Daniel P. Berrange, Michael Roth
  Cc: peter.maydell, qemu-devel, Vinzenz Feenstra

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

On 04/26/2017 06:02 AM, Daniel P. Berrange wrote:
> On Tue, Apr 25, 2017 at 06:04:41PM -0500, Michael Roth wrote:
>> From: Vinzenz Feenstra <vfeenstr@redhat.com>
>>
>> Adds a new command `guest-get-timezone` reporting the currently
>> configured timezone on the system. The information on what timezone is
>> currently is configured is useful in case of Windows VMs where the
>> offset of the hardware clock is required to have the same offset. This
>> can be used for management systems like `oVirt` to detect the timezone
>> difference and warn administrators of the misconfiguration.
> 
>> +GuestTimezone *qmp_guest_get_timezone(Error **errp)
>> +{
> 
>> +    name = g_time_zone_get_abbreviation(tz, intv);
> 
> [snip]
> 
>> +##
>> +# @GuestTimezone:
>> +#
>> +# @zone:    Timezone name
> 
> This isn't clearly documented in glib, but it looks like the time zone
> names are *different* when glib is run on POSIX vs Win32 platforms.
> 
> Do we really want to expose something in QAPI that is going to have
> different semantics depending on the guest OS the agent runs in ?
> 

Maybe it's just a matter of proper documentation.  The 'offset' field is
the important one, with unambiguous machine-parseable semantics; the
'zone' field is an optional, informative, human-readable format
according to the guest OS's whims, and should not be relied on for
scripting purposes.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command
  2017-04-26 13:08     ` Eric Blake
@ 2017-04-26 13:10       ` Daniel P. Berrange
  0 siblings, 0 replies; 15+ messages in thread
From: Daniel P. Berrange @ 2017-04-26 13:10 UTC (permalink / raw)
  To: Eric Blake; +Cc: Michael Roth, peter.maydell, qemu-devel, Vinzenz Feenstra

On Wed, Apr 26, 2017 at 08:08:25AM -0500, Eric Blake wrote:
> On 04/26/2017 06:02 AM, Daniel P. Berrange wrote:
> > On Tue, Apr 25, 2017 at 06:04:41PM -0500, Michael Roth wrote:
> >> From: Vinzenz Feenstra <vfeenstr@redhat.com>
> >>
> >> Adds a new command `guest-get-timezone` reporting the currently
> >> configured timezone on the system. The information on what timezone is
> >> currently is configured is useful in case of Windows VMs where the
> >> offset of the hardware clock is required to have the same offset. This
> >> can be used for management systems like `oVirt` to detect the timezone
> >> difference and warn administrators of the misconfiguration.
> > 
> >> +GuestTimezone *qmp_guest_get_timezone(Error **errp)
> >> +{
> > 
> >> +    name = g_time_zone_get_abbreviation(tz, intv);
> > 
> > [snip]
> > 
> >> +##
> >> +# @GuestTimezone:
> >> +#
> >> +# @zone:    Timezone name
> > 
> > This isn't clearly documented in glib, but it looks like the time zone
> > names are *different* when glib is run on POSIX vs Win32 platforms.
> > 
> > Do we really want to expose something in QAPI that is going to have
> > different semantics depending on the guest OS the agent runs in ?
> > 
> 
> Maybe it's just a matter of proper documentation.  The 'offset' field is
> the important one, with unambiguous machine-parseable semantics; the
> 'zone' field is an optional, informative, human-readable format
> according to the guest OS's whims, and should not be relied on for
> scripting purposes.

Yeah, if it is only intended for informative purposes this should be
explicitly documented that it is not standardized across guests.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] [PULL 0/8] qemu-ga patch queue
  2017-07-18  5:20 Michael Roth
@ 2017-07-18 11:01 ` Michael Roth
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Roth @ 2017-07-18 11:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Quoting Michael Roth (2017-07-18 00:20:08)
> The following changes since commit ca4e667dbf431d4a2a5a619cde79d30dd2ac3eb2:
> 
>   Merge remote-tracking branch 'remotes/kraxel/tags/usb-20170717-pull-request' into staging (2017-07-17 17:54:17 +0100)
> 
> are available in the git repository at:
> 
>   git://github.com/mdroth/qemu.git tags/qga-pull-2017-07-17-tag
> 
> for you to fetch changes up to 48f66332e435ed35c23f3c6ec40b2f1af521758f:
> 
>   test-qga: add test for guest-get-osinfo (2017-07-17 19:27:45 -0500)
> 
> ----------------------------------------------------------------
> qemu-ga patch queue
> * new command: qemu-get-osinfo

Sorry, this triggered a travis failure with older GCCs due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Turns out we don't actually need to zero-initialize the value in
the first place, so will send a v2 which drops it.

> * build fix for OpenBSD
> * better error-reporting for failure on keyfile dump
> * remove redundant initialization of qa_state global
> * include libpcre in w32 package
> * w32 localization fixes for service installation/registration
> 
> ----------------------------------------------------------------
> Daniel Rempel (1):
>       qga-win: fix installation on localized windows
> 
> Marc-André Lureau (1):
>       qga: report error on keyfile dump error
> 
> Peng Hao (1):
>       qga-win32: remove a redundancy code
> 
> Thomas Lamprecht (1):
>       qemu-ga: add missing libpcre to MSI build
> 
> Tomáš Golembiovský (4):
>       qemu-ga: check if utmpx.h is available on the system
>       qemu-ga: add guest-get-osinfo command
>       test-qga: pass environemnt to qemu-ga
>       test-qga: add test for guest-get-osinfo
> 
>  configure                      |  19 +++++
>  qga/commands-posix.c           | 158 +++++++++++++++++++++++++++++++++-
>  qga/commands-win32.c           | 188 +++++++++++++++++++++++++++++++++++++++++
>  qga/installer/qemu-ga.wxs      |   4 +
>  qga/main.c                     |   9 +-
>  qga/qapi-schema.json           |  65 ++++++++++++++
>  qga/vss-win32/install.cpp      |  35 +++++++-
>  tests/data/test-qga-os-release |   7 ++
>  tests/test-qga.c               |  64 +++++++++++++-
>  9 files changed, 540 insertions(+), 9 deletions(-)
>  create mode 100644 tests/data/test-qga-os-release
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Qemu-devel] [PULL 0/8] qemu-ga patch queue
@ 2017-07-18  5:20 Michael Roth
  2017-07-18 11:01 ` Michael Roth
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Roth @ 2017-07-18  5:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The following changes since commit ca4e667dbf431d4a2a5a619cde79d30dd2ac3eb2:

  Merge remote-tracking branch 'remotes/kraxel/tags/usb-20170717-pull-request' into staging (2017-07-17 17:54:17 +0100)

are available in the git repository at:

  git://github.com/mdroth/qemu.git tags/qga-pull-2017-07-17-tag

for you to fetch changes up to 48f66332e435ed35c23f3c6ec40b2f1af521758f:

  test-qga: add test for guest-get-osinfo (2017-07-17 19:27:45 -0500)

----------------------------------------------------------------
qemu-ga patch queue
* new command: qemu-get-osinfo
* build fix for OpenBSD
* better error-reporting for failure on keyfile dump
* remove redundant initialization of qa_state global
* include libpcre in w32 package
* w32 localization fixes for service installation/registration

----------------------------------------------------------------
Daniel Rempel (1):
      qga-win: fix installation on localized windows

Marc-André Lureau (1):
      qga: report error on keyfile dump error

Peng Hao (1):
      qga-win32: remove a redundancy code

Thomas Lamprecht (1):
      qemu-ga: add missing libpcre to MSI build

Tomáš Golembiovský (4):
      qemu-ga: check if utmpx.h is available on the system
      qemu-ga: add guest-get-osinfo command
      test-qga: pass environemnt to qemu-ga
      test-qga: add test for guest-get-osinfo

 configure                      |  19 +++++
 qga/commands-posix.c           | 158 +++++++++++++++++++++++++++++++++-
 qga/commands-win32.c           | 188 +++++++++++++++++++++++++++++++++++++++++
 qga/installer/qemu-ga.wxs      |   4 +
 qga/main.c                     |   9 +-
 qga/qapi-schema.json           |  65 ++++++++++++++
 qga/vss-win32/install.cpp      |  35 +++++++-
 tests/data/test-qga-os-release |   7 ++
 tests/test-qga.c               |  64 +++++++++++++-
 9 files changed, 540 insertions(+), 9 deletions(-)
 create mode 100644 tests/data/test-qga-os-release

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-07-18 11:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 23:04 [Qemu-devel] [PULL 0/8] qemu-ga patch queue Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 1/8] qemu-ga: Make QGA VSS provider service run only when needed Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 2/8] qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 3/8] qga-win: Fix a bug where qemu-ga service is stuck during stop operation Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 4/8] qga-win: Fix Event Viewer errors caused by qemu-ga Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 5/8] qga: Add 'guest-get-host-name' command Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 6/8] qga: improve fsfreeze documentations Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 7/8] qga: Add 'guest-get-users' command Michael Roth
2017-04-25 23:04 ` [Qemu-devel] [PULL 8/8] qga: Add `guest-get-timezone` command Michael Roth
2017-04-26 11:02   ` Daniel P. Berrange
2017-04-26 13:08     ` Eric Blake
2017-04-26 13:10       ` Daniel P. Berrange
2017-04-26 10:51 ` [Qemu-devel] [PULL 0/8] qemu-ga patch queue Peter Maydell
2017-07-18  5:20 Michael Roth
2017-07-18 11:01 ` Michael Roth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.