qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] b519e2: qga: Rename guest-get-devices return


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] b519e2: qga: Rename guest-get-devices return member 'addre...
Date: Tue, 03 Nov 2020 06:40:01 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: b519e2e982f7f5368c5976ca44d9ca7bbb7a3378
      
https://github.com/qemu/qemu/commit/b519e2e982f7f5368c5976ca44d9ca7bbb7a3378
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-win32.c
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: Rename guest-get-devices return member 'address' to 'id'

Member 'address' is union GuestDeviceAddress with a single branch
GuestDeviceAddressPCI, containing PCI vendor ID and device ID.  This
is not a PCI address.  Type GuestPCIAddress is.  Messed up in recent
commit 2e4211cee4 "qga: add command guest-get-devices for reporting
VirtIO devices".

Rename type GuestDeviceAddressPCI to GuestDeviceIdPCI, type
GuestDeviceAddress to GuestDeviceId, and member 'address' to 'id'.

Document the member properly while there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: a88bceef789f0b8bfe96bb77cef686e9b4976699
      
https://github.com/qemu/qemu/commit/a88bceef789f0b8bfe96bb77cef686e9b4976699
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-win32.c
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: Use common time encoding for guest-get-devices 'driver-date'

guest-get-devices returns 'driver-date' as string in the format
YYYY-MM-DD.  Goes back to recent commit 2e4211cee4 "qga: add command
guest-get-devices for reporting VirtIO devices".

We should avoid use of multiple encodings for the same kind of data.
Especially string encodings.  Change it to return nanoseconds since
the epoch, like guest-get-time does.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 939caddc2c24a9f4840e5d9d52eb0465deed1c47
      
https://github.com/qemu/qemu/commit/939caddc2c24a9f4840e5d9d52eb0465deed1c47
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-win32.c

  Log Message:
  -----------
  qga-win: Fix guest-get-devices error API violations

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

qmp_guest_get_devices() is wrong that way: it calls error_setg() in a
loop.

If no iteration fails, the function returns a value and sets no error.
Okay.

If exactly one iteration fails, the function returns a value and sets
an error.  Wrong.

If multiple iterations fail, the function trips error_setv()'s
assertion.

Fix it to return immediately on error.

Perhaps the failure to convert the driver version to UTF-8 should not
be an error.  We could simply not report the botched version string
instead.

Drop a superfluous continue while there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 0083124b3adb67bb740f1f06c2360335a5ce1533
      
https://github.com/qemu/qemu/commit/0083124b3adb67bb740f1f06c2360335a5ce1533
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-win32.c
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: Flatten simple union GuestDeviceId

Simple unions are simpler than flat unions in the schema, but more
complicated in C and on the QMP wire: there's extra indirection in C
and extra nesting on the wire, both pointless.  They should be avoided
in new code.

GuestDeviceId was recently added for guest-get-devices.  Convert it to
a flat union.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: c27ea3f9ef7c7f29e55bde91879f8514abce9c38
      
https://github.com/qemu/qemu/commit/c27ea3f9ef7c7f29e55bde91879f8514abce9c38
  Author: Tomáš Golembiovský <tgolembi@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: add command guest-get-disks

Add API and stubs for new guest-get-disks command.

The command guest-get-fsinfo can be used to list information about disks
and partitions but it is limited only to mounted disks with filesystem.
This new command should allow listing information about disks of the VM
regardles whether they are mounted or not. This can be usefull for
management applications for mapping virtualized devices or pass-through
devices to device names in the guest OS.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: fed3956429d560a06fc2d2fcf1a01efb58659f87
      
https://github.com/qemu/qemu/commit/fed3956429d560a06fc2d2fcf1a01efb58659f87
  Author: Tomáš Golembiovský <tgolembi@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-posix.c

  Log Message:
  -----------
  qga: add implementation of guest-get-disks for Linux

The command lists all disks (real and virtual) as well as disk
partitions. For each disk the list of dependent disks is also listed and
/dev path is used as a handle so it can be matched with "name" field of
other returned disk entries. For disk partitions the "dependents" list
is populated with the the parent device for easier tracking of
hierarchy.

Example output:
{
  "return": [
    ...
    {
      "name": "/dev/dm-0",
      "partition": false,
      "dependents": [
        "/dev/sda2"
      ],
      "alias": "luks-7062202e-5b9b-433e-81e8-6628c40da9f7"
    },
    {
      "name": "/dev/sda2",
      "partition": true,
      "dependents": [
        "/dev/sda"
      ]
    },
    {
      "name": "/dev/sda",
      "partition": false,
      "address": {
        "serial": "SAMSUNG_MZ7LN512HCHP-000L1_S1ZKNXAG822493",
        "bus-type": "sata",
        ...
        "dev": "/dev/sda",
        "target": 0
      },
      "dependents": []
    },
    ...
  ]
}

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
*add missing stub for !defined(CONFIG_FSFREEZE)
*remove unused deps_dir variable
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: c67d2efd9d1771fd886e3b58771adaa62897f3d9
      
https://github.com/qemu/qemu/commit/c67d2efd9d1771fd886e3b58771adaa62897f3d9
  Author: Tomáš Golembiovský <tgolembi@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-win32.c

  Log Message:
  -----------
  qga: add implementation of guest-get-disks for Windows

The command lists all the physical disk drives. Unlike for Linux
partitions and virtual volumes are not listed.

Example output:

{
  "return": [
    {
      "name": "\\\\.\\PhysicalDrive0",
      "partition": false,
      "address": {
        "serial": "QM00001",
        "bus-type": "sata",
        ...
      },
      "dependents": []
    }
  ]
}

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 6d593ab451c490b0ca941c6a519894231634751e
      
https://github.com/qemu/qemu/commit/6d593ab451c490b0ca941c6a519894231634751e
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M include/glib-compat.h

  Log Message:
  -----------
  glib-compat: add g_unix_get_passwd_entry_qemu()

The glib function was introduced in 2.64. It's a safer version of
getpwnam, and also simpler to use than getpwnam_r.

Currently, it's only use by the next patch in qemu-ga, which doesn't
(well well...) need the thread safety guarantees. Since the fallback
version is still unsafe, I would rather keep the _qemu postfix, to make
sure it's not being misused by mistake. When/if necessary, we can
implement a safer fallback and drop the _qemu suffix.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
*fix checkpatch warnings about newlines before/after block comments
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 8d769ec777dccbff199711aba43aa6297fe4a0e0
      
https://github.com/qemu/qemu/commit/8d769ec777dccbff199711aba43aa6297fe4a0e0
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    A qga/commands-posix-ssh.c
    M qga/meson.build
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: add ssh-{add,remove}-authorized-keys

Add new commands to add and remove SSH public keys from
~/.ssh/authorized_keys.

I took a different approach for testing, including the unit tests right
with the code. I wanted to overwrite the function to get the user
details, I couldn't easily do that over QMP. Furthermore, I prefer
having unit tests very close to the code, and unit files that are domain
specific (commands-posix is too crowded already). FWIW, that
coding/testing style is Rust-style (where tests can or should even be
part of the documentation!).

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

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
*squashed in fix-ups for setting file ownership and use of QAPI
 conditionals for CONFIG_POSIX instead of stub definitions
*disable qga-ssh-test for now due to G_TEST_OPTION_ISOLATE_DIRS
 triggering leak detector in build-oss-fuzz
*fix disallowed g_assert* usage reported by checkpatch
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 0e3c94758e3851f0ab30d2a1e63a73284499775d
      
https://github.com/qemu/qemu/commit/0e3c94758e3851f0ab30d2a1e63a73284499775d
  Author: Michael Roth <michael.roth@amd.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-posix-ssh.c
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: add *reset argument to ssh-add-authorized-keys

I prefer 'reset' over 'clear', since 'clear' and keys may have some
other relations or meaning.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
*fix disallowed g_assert* usage reported by checkpatch
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 2a127f96a558bf6a42067604860d6ee63ffe685a
      
https://github.com/qemu/qemu/commit/2a127f96a558bf6a42067604860d6ee63ffe685a
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/meson.build

  Log Message:
  -----------
  meson: minor simplification

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: cad97c08a1c17830d77a46780088bc0199df89d1
      
https://github.com/qemu/qemu/commit/cad97c08a1c17830d77a46780088bc0199df89d1
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M qga/commands-posix-ssh.c
    M qga/meson.build
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: add ssh-get-authorized-keys

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
*fix-up merge conflicts due to qga-ssh-test being disabled in earlier
 patch due to G_TEST_OPTION_ISOLATE_DIRS triggering build-oss-fuzz
 leak detector.
*fix up style and disallowed g_assert* usage reported by checkpatch
Signed-off-by: Michael Roth <michael.roth@amd.com>


  Commit: 83851c7c60c90e9fb6a23ff48076387a77bc33cd
      
https://github.com/qemu/qemu/commit/83851c7c60c90e9fb6a23ff48076387a77bc33cd
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M include/glib-compat.h
    A qga/commands-posix-ssh.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qga/meson.build
    M qga/qapi-schema.json

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-10-27-v3-tag' 
into staging

qemu-ga patch queue for soft-freeze

* add guest-get-disks for w32/linux
* add guest-{add,remove,get}-authorized-keys
* fix API violations and schema documentation inconsistencies with
  recently-added guest-get-devices

v3:
- fix checkpatch errors regarding disallowed usages of g_assert*
  macros and other warnings

v2:
- fix BSD build error due to missing stub for guest_get_disks
- fix clang build error on linux due to unused variable
- disable qga-ssh-test for now due to a memory leak within GLib when
  G_TEST_OPTION_ISOLATE_DIRS is passed to g_test_init() since it
  break Gitlab CI build-oss-fuzz test
- rebased and re-tested on master

# gpg: Signature made Tue 03 Nov 2020 02:30:50 GMT
# gpg:                using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584
# gpg:                issuer "michael.roth@amd.com"
# gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full]
# gpg:                 aka "Michael Roth <mdroth@utexas.edu>" [full]
# gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full]
# Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584

* remotes/mdroth/tags/qga-pull-2020-10-27-v3-tag:
  qga: add ssh-get-authorized-keys
  meson: minor simplification
  qga: add *reset argument to ssh-add-authorized-keys
  qga: add ssh-{add,remove}-authorized-keys
  glib-compat: add g_unix_get_passwd_entry_qemu()
  qga: add implementation of guest-get-disks for Windows
  qga: add implementation of guest-get-disks for Linux
  qga: add command guest-get-disks
  qga: Flatten simple union GuestDeviceId
  qga-win: Fix guest-get-devices error API violations
  qga: Use common time encoding for guest-get-devices 'driver-date'
  qga: Rename guest-get-devices return member 'address' to 'id'

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/c7a7a877b716...83851c7c60c9



reply via email to

[Prev in Thread] Current Thread [Next in Thread]