Merge branch 'hvm' of 10.141.1.101:/var/lib/qubes/git/marmarek/core into hvm
This commit is contained in:
commit
11b952ffc5
@ -13,7 +13,7 @@ echo $$ > $PIDFILE
|
|||||||
trap "rm $PIDFILE" EXIT
|
trap "rm $PIDFILE" EXIT
|
||||||
|
|
||||||
# If no updates available - exit here
|
# If no updates available - exit here
|
||||||
qvm-dom0-updates --check-only && exit
|
qubes-dom0-updates --check-only && exit
|
||||||
RETCODE=$?
|
RETCODE=$?
|
||||||
|
|
||||||
if [ "$RETCODE" -ne 100 ]; then
|
if [ "$RETCODE" -ne 100 ]; then
|
||||||
@ -32,4 +32,4 @@ zenity --notification --window-icon=$NOTIFY_ICON --text="Qubes dom0 updates avai
|
|||||||
zenity --question --title="Qubes Dom0 updates" \
|
zenity --question --title="Qubes Dom0 updates" \
|
||||||
--text="There are updates for dom0 available, do you want to download them now?" || exit 0
|
--text="There are updates for dom0 available, do you want to download them now?" || exit 0
|
||||||
|
|
||||||
su -c "DISPLAY=:0 qvm-dom0-update --gui" $LOCAL_USER
|
su -c "DISPLAY=:0 qubes-dom0-update --gui" $LOCAL_USER
|
||||||
|
@ -32,7 +32,7 @@ if [ -e /sys/bus/pci/drivers/pciback/$BDF ]; then
|
|||||||
# Check if device not assigned to any RUNNING VM
|
# Check if device not assigned to any RUNNING VM
|
||||||
XS_PATH=/local/domain/0/backend/pci
|
XS_PATH=/local/domain/0/backend/pci
|
||||||
GREP_RE="^$XS_PATH/[0-9]*/[0-9]*/dev-[0-9]* = \"$BDF\""
|
GREP_RE="^$XS_PATH/[0-9]*/[0-9]*/dev-[0-9]* = \"$BDF\""
|
||||||
if xenstore-ls -f $XS_PATH | grep -q "$GREP_RE"; then
|
if xenstore-ls -f $XS_PATH 2> /dev/null | grep -q "$GREP_RE"; then
|
||||||
DOMID=`xenstore-ls -f $XS_PATH | grep "$GREP_RE"|cut -d/ -f7`
|
DOMID=`xenstore-ls -f $XS_PATH | grep "$GREP_RE"|cut -d/ -f7`
|
||||||
echo "ERROR: Device already attached to the running VM '`xl domname $DOMID`'" >&2
|
echo "ERROR: Device already attached to the running VM '`xl domname $DOMID`'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -60,7 +60,6 @@ qubes_servicevms_dir = qubes_base_dir + "/servicevms"
|
|||||||
qubes_store_filename = qubes_base_dir + "/qubes.xml"
|
qubes_store_filename = qubes_base_dir + "/qubes.xml"
|
||||||
qubes_kernels_base_dir = qubes_base_dir + "/vm-kernels"
|
qubes_kernels_base_dir = qubes_base_dir + "/vm-kernels"
|
||||||
|
|
||||||
qubes_max_xid = 1024
|
|
||||||
qubes_max_qid = 254
|
qubes_max_qid = 254
|
||||||
qubes_max_netid = 254
|
qubes_max_netid = 254
|
||||||
vm_default_netmask = "255.255.255.0"
|
vm_default_netmask = "255.255.255.0"
|
||||||
@ -142,7 +141,7 @@ class QubesHost(object):
|
|||||||
if previous is None:
|
if previous is None:
|
||||||
previous_time = time.time()
|
previous_time = time.time()
|
||||||
previous = {}
|
previous = {}
|
||||||
info = xc.domain_getinfo(0, qubes_max_xid)
|
info = xc.domain_getinfo(0, qubes_max_qid)
|
||||||
for vm in info:
|
for vm in info:
|
||||||
previous[vm['domid']] = {}
|
previous[vm['domid']] = {}
|
||||||
previous[vm['domid']]['cpu_time'] = vm['cpu_time']/vm['online_vcpus']
|
previous[vm['domid']]['cpu_time'] = vm['cpu_time']/vm['online_vcpus']
|
||||||
@ -151,7 +150,7 @@ class QubesHost(object):
|
|||||||
|
|
||||||
current_time = time.time()
|
current_time = time.time()
|
||||||
current = {}
|
current = {}
|
||||||
info = xc.domain_getinfo(0, qubes_max_xid)
|
info = xc.domain_getinfo(0, qubes_max_qid)
|
||||||
for vm in info:
|
for vm in info:
|
||||||
current[vm['domid']] = {}
|
current[vm['domid']] = {}
|
||||||
current[vm['domid']]['cpu_time'] = vm['cpu_time']/max(vm['online_vcpus'],1)
|
current[vm['domid']]['cpu_time'] = vm['cpu_time']/max(vm['online_vcpus'],1)
|
||||||
@ -553,7 +552,7 @@ class QubesVm(object):
|
|||||||
if start_xid < 0:
|
if start_xid < 0:
|
||||||
start_xid = 0
|
start_xid = 0
|
||||||
try:
|
try:
|
||||||
domains = xc.domain_getinfo(start_xid, qubes_max_xid-start_xid)
|
domains = xc.domain_getinfo(start_xid, qubes_max_qid)
|
||||||
except xen.lowlevel.xc.Error:
|
except xen.lowlevel.xc.Error:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -2376,6 +2375,14 @@ class QubesHVm(QubesVm):
|
|||||||
xc.domain_unpause(self.stubdom_xid)
|
xc.domain_unpause(self.stubdom_xid)
|
||||||
super(QubesHVm, self).unpause()
|
super(QubesHVm, self).unpause()
|
||||||
|
|
||||||
|
def is_fully_usable(self):
|
||||||
|
xid = self.stubdom_xid
|
||||||
|
if xid < 0:
|
||||||
|
return False
|
||||||
|
if not os.path.exists('/var/run/qubes/guid_running.%d' % xid):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
class QubesVmCollection(dict):
|
class QubesVmCollection(dict):
|
||||||
"""
|
"""
|
||||||
A collection of Qubes VMs indexed by Qubes id (qid)
|
A collection of Qubes VMs indexed by Qubes id (qid)
|
||||||
|
@ -174,7 +174,10 @@ def main():
|
|||||||
for vm in vms_to_display:
|
for vm in vms_to_display:
|
||||||
data_row = {}
|
data_row = {}
|
||||||
for f in fields_to_display:
|
for f in fields_to_display:
|
||||||
data_row[f] = str(eval(fields[f]["func"]))
|
if vm.qid == 0 and (f.startswith('priv-') or f.startswith('root-') or f == 'disk'):
|
||||||
|
data_row[f] = 'n/a'
|
||||||
|
else:
|
||||||
|
data_row[f] = str(eval(fields[f]["func"]))
|
||||||
l = len(data_row[f])
|
l = len(data_row[f])
|
||||||
if l > fields[f]["max_width"]:
|
if l > fields[f]["max_width"]:
|
||||||
fields[f]["max_width"] = l
|
fields[f]["max_width"] = l
|
||||||
|
@ -14,7 +14,9 @@ fi
|
|||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
HOTPLUG_STORE="/var/run/xen-hotplug/${XENBUS_PATH//\//-}"
|
if [ -n "$XENBUS_PATH" ]; then
|
||||||
|
HOTPLUG_STORE="/var/run/xen-hotplug/${XENBUS_PATH//\//-}"
|
||||||
|
fi
|
||||||
|
|
||||||
get_dev() {
|
get_dev() {
|
||||||
dev=$1
|
dev=$1
|
||||||
@ -102,7 +104,10 @@ case "$command" in
|
|||||||
add)
|
add)
|
||||||
case $t in
|
case $t in
|
||||||
snapshot|origin)
|
snapshot|origin)
|
||||||
p=$(xenstore_read "$XENBUS_PATH/params")
|
p=$(xenstore_read_default "$XENBUS_PATH/params" 'MISSING')
|
||||||
|
if [ "$p" == "MISSING" ]; then
|
||||||
|
fatal "Missing device parameters ($t $XENBUS_PATH/params)"
|
||||||
|
fi
|
||||||
base=${p/:*/}
|
base=${p/:*/}
|
||||||
cow=${p/*:/}
|
cow=${p/*:/}
|
||||||
|
|
||||||
@ -191,18 +196,20 @@ case "$command" in
|
|||||||
if [ "$command" = "cleanup" ]; then
|
if [ "$command" = "cleanup" ]; then
|
||||||
t=$2
|
t=$2
|
||||||
else
|
else
|
||||||
t=$(cat $HOTPLUG_STORE-type)
|
t=$(cat $HOTPLUG_STORE-type 2>/dev/null || echo 'MISSING')
|
||||||
fi
|
fi
|
||||||
case $t in
|
case "$t" in
|
||||||
snapshot|origin)
|
snapshot|origin)
|
||||||
if [ "$command" = "cleanup" ]; then
|
if [ "$command" = "cleanup" ]; then
|
||||||
node=$3
|
node=$3
|
||||||
else
|
else
|
||||||
node=$(cat "$HOTPLUG_STORE-node")
|
node=$(cat "$HOTPLUG_STORE-node" 2> /dev/null)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$node" ]; then
|
if [ -z "$node" ]; then
|
||||||
fatal "No device node to remove"
|
#fatal "No device node to remove"
|
||||||
|
#Most likely already removed
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$node" ]; then
|
if [ ! -e "$node" ]; then
|
||||||
@ -258,10 +265,13 @@ case "$command" in
|
|||||||
for dev in $deps; do
|
for dev in $deps; do
|
||||||
if [ -b "$dev" ]; then
|
if [ -b "$dev" ]; then
|
||||||
log debug "Removing $dev"
|
log debug "Removing $dev"
|
||||||
losetup -d $dev || true 2> /dev/null
|
losetup -d $dev 2> /dev/null || true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -n "$HOTPLUG_STORE" ]; then
|
||||||
|
rm $HOTPLUG_STORE-*
|
||||||
|
fi
|
||||||
release_lock "block"
|
release_lock "block"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -57,6 +57,9 @@ fi
|
|||||||
|
|
||||||
if [ -z "$PKGLIST" ]; then
|
if [ -z "$PKGLIST" ]; then
|
||||||
# No new updates
|
# No new updates
|
||||||
|
if [ "$GUI" = 1 ]; then
|
||||||
|
zenity --info --text="No new updates available"
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user