Project

General

Profile

Actions

Bug #14657

closed

zoneadmd: remove warning gags and add ctf support

Added by Toomas Soome 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zones
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

I was attempting to use mdb on zoneadmd process and found it resisting to display information. Rebuilding with CTF support, I have noticed we should clean it up a bit...

    vplat.c: In function 'mount_one_dev':
    vplat.c:1164:6: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
      if (err = zonecfg_get_handle(zone_name, handle)) {
          ^~~
    vplat.c:1169:6: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
      if (err = zonecfg_setdevent(handle)) {
          ^~~
    vplat.c: In function 'get_privset':
    vplat.c:3295:7: error: 'curr_iptype' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       if (zonecfg_default_privset(privs, curr_iptype) == Z_OK) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vplat.c: In function 'mount_one_dev':
    vplat.c:1147:6: error: 'curr_iptype' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      if (brand_platform_iter_devices(bh, zone_name,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          mount_one_dev_device_cb, prof, curr_iptype) != 0) {
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vplat.c: In function 'vplat_create':
    vplat.c:4951:5: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      if ((zoneid = zone_create(kzone, rootpath, privs, rctlbuf,
         ^
    cc1: all warnings being treated as errors

    zoneadmd.c: In function 'server':
    zoneadmd.c:1482:3: error: enumeration value 'Z_FORCEBOOT' not handled in switch [-Werror=switch]
       switch (cmd) {
       ^~~~~~
    zoneadmd.c:1482:3: error: enumeration value 'Z_FORCEMOUNT' not handled in switch [-Werror=switch]
    zoneadmd.c:1555:3: error: enumeration value 'Z_FORCEBOOT' not handled in switch [-Werror=switch]
       switch (cmd) {
       ^~~~~~
    zoneadmd.c:1555:3: error: enumeration value 'Z_FORCEMOUNT' not handled in switch [-Werror=switch]
    zoneadmd.c:1639:5: error: 'kernelcall' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      if (kernelcall) {
         ^
    cc1: all warnings being treated as errors

Testing done: build/install/boot, running my local zones.

root@beastie:/home/tsoome# zoneadm -z test install
A ZFS file system has been created for this zone.
       Image: Preparing at /zones/test/root.

   Publisher: Using on-nightly (http://beastie.local/).
   Publisher: Using openindiana.org (https://pkg.openindiana.org/hipster/).
       Cache: Using /var/pkg/publisher.
  Installing: Packages (output follows)
Packages to install: 183
Mediators to change:   7
 Services to change:   6

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            183/183   37214/37214  316.1/316.1  2.2M/s

PHASE                                          ITEMS
Installing new actions                   52413/52413
Updating package state database                 Done 
Updating package cache                           0/0 
Updating image state                            Done 
Creating fast lookup database                   Done 
 Postinstall: Copying SMF seed repository ... done.
        Done: Installation completed in 221,095 seconds.

  Next Steps: Boot the zone, then log into the zone console (zlogin -C)
              to complete the configuration process.
root@beastie:/home/tsoome# zoneadm -z test boot
root@beastie:/home/tsoome# zoneadm -z test halt
root@beastie:/home/tsoome# zoneadm -z test detach
root@beastie:/home/tsoome# zoneadm -z test attach
Log File: /var/tmp/test.attach_log.8VaiPi
               Attach Path: /zones/test/root
        Attach ZFS Dataset: rpool/zones/test/ROOT/zbe

                Installing: Using pre-existing data in zonepath
                     Cache: Using /var/pkg/publisher.
  Updating non-global zone: Output follows
Packages to install: 4

                Evaluation: Packages in zone test are out of sync with the global zone. To proceed, retry with the -u flag.
                    Result: Attach Failed.
root@beastie:/home/tsoome# zoneadm -z test attach -u
Log File: /var/tmp/test.attach_log.Gqaqij
               Attach Path: /zones/test/root
        Attach ZFS Dataset: rpool/zones/test/ROOT/zbe

                Installing: Using pre-existing data in zonepath
                     Cache: Using /var/pkg/publisher.
  Updating non-global zone: Output follows
Packages to install: 4

PHASE                                          ITEMS
Installing new actions                         48/48
Updating package state database                 Done 
Updating package cache                           0/0 
Updating image state                            Done 
Creating fast lookup database                   Done 

  Updating non-global zone: Zone updated.
                    Result: Attach Succeeded.
root@beastie:/home/tsoome# zoneadm -z test verify
root@beastie:/home/tsoome# zoneadm -z test verify -v
-v: illegal option -- v
usage:    verify
    Check to make sure the configuration can safely be instantiated
    on the machine: physical network interfaces exist, etc.
root@beastie:/home/tsoome# zoneadm -z test uninstall
Are you sure you want to uninstall zone test (y/[n])? y
rm: Unable to remove directory /zones/test/root: Device busy
root@beastie:/home/tsoome# zoneadm -z test uninstall
zoneadm: zone 'test': is already in state 'configured'.
root@beastie:/home/tsoome# zonecfg -z test delete
Are you sure you want to delete zone test (y/[n])? y
root@beastie:/home/tsoome# 
Actions #1

Updated by Toomas Soome 5 months ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 2126
Actions #3

Updated by Toomas Soome 5 months ago

  • Description updated (diff)
Actions #4

Updated by Toomas Soome 5 months ago

  • Description updated (diff)
Actions #5

Updated by Electric Monk 5 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 2a22bccab8733d6de38ab1e1fbe8c810122a4427

commit  2a22bccab8733d6de38ab1e1fbe8c810122a4427
Author: Toomas Soome <tsoome@me.com>
Date:   2022-05-02T21:30:50.000Z

    14657 zoneadmd: remove warning gags and add ctf support
    Reviewed by: Jason King <jason.brian.king+illumos@gmail.com>
    Reviewed by: Juraj Lutter <juraj@lutter.sk>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF