* [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
@ 2009-07-15 3:49 Yolkfull Chow
2009-07-15 9:46 ` Yaniv Kaul
0 siblings, 1 reply; 8+ messages in thread
From: Yolkfull Chow @ 2009-07-15 3:49 UTC (permalink / raw)
To: kvm; +Cc: lmr, autotest, Yolkfull Chow
This is a subtest in kvm. It will verify newly added pci block device now. For Windows support,it needs to use_telnet since 'wmic' which is used to check disk info could only be executed in telnet session not ssh. Just ran it on guest Fedora-11.32 and Windows2008.32, both passed:
# ./scan_results.py
test status seconds info
---- ------ ------- ----
Fedora.11.32.nic_hotplug.nic_rtl8139 GOOD 68 completed successfully
Fedora.11.32.nic_hotplug.nic_virtio GOOD 46 completed successfully
Fedora.11.32.block_hotplug.fmt_qcow2.block_virtio GOOD 46 completed successfully
Fedora.11.32.block_hotplug.fmt_qcow2.block_scsi GOOD 44 completed successfully
Fedora.11.32.block_hotplug.fmt_raw.block_virtio GOOD 45 completed successfully
Fedora.11.32.block_hotplug.fmt_raw.block_scsi GOOD 46 completed successfully
Win2008.32.nic_hotplug.nic_rtl8139 GOOD 66 completed successfully
Win2008.32.block_hotplug.fmt_qcow2.block_scsi GOOD 186 completed successfully
Win2008.32.block_hotplug.fmt_raw.block_scsi GOOD 71 completed successfully
Signed-off-by: Yolkfull Chow <yzhou@redhat.com>
---
client/tests/kvm/kvm.py | 1 +
client/tests/kvm/kvm_tests.cfg.sample | 69 +++++++++++++++++++++++-
client/tests/kvm/kvm_tests.py | 98 +++++++++++++++++++++++++++++++++
client/tests/kvm/kvm_vm.py | 2 +
4 files changed, 169 insertions(+), 1 deletions(-)
diff --git a/client/tests/kvm/kvm.py b/client/tests/kvm/kvm.py
index b18b643..fc92e10 100644
--- a/client/tests/kvm/kvm.py
+++ b/client/tests/kvm/kvm.py
@@ -55,6 +55,7 @@ class kvm(test.test):
"kvm_install": test_routine("kvm_install", "run_kvm_install"),
"linux_s3": test_routine("kvm_tests", "run_linux_s3"),
"stress_boot": test_routine("kvm_tests", "run_stress_boot"),
+ "pci_hotplug": test_routine("kvm_tests", "run_pci_hotplug"),
}
# Make it possible to import modules from the test's bindir
diff --git a/client/tests/kvm/kvm_tests.cfg.sample b/client/tests/kvm/kvm_tests.cfg.sample
index 2f864de..7ec6f72 100644
--- a/client/tests/kvm/kvm_tests.cfg.sample
+++ b/client/tests/kvm/kvm_tests.cfg.sample
@@ -91,9 +91,56 @@ variants:
- stress_boot:
type = stress_boot
- max_vms = 5
+ max_vms = 5
alive_test_cmd = ps aux
+
+ - nic_hotplug:
+ type = pci_hotplug
+ pci_type = nic
+ modprobe_acpiphp = yes
+ reference_cmd = lspci
+ find_pci_cmd = 'lspci | tail -n1'
+ pci_test_cmd = 'nslookup www.redhat.com'
+ seconds_wait_for_device_install = 3
+ variants:
+ - nic_8139:
+ pci_model = rtl8139
+ match_string = "8139"
+ - nic_virtio:
+ pci_model = virtio
+ match_string = "Virtio network device"
+ - nic_e1000:
+ pci_model = e1000
+ match_string = "Gigabit Ethernet Controller"
+
+ - block_hotplug:
+ type = pci_hotplug
+ pci_type = block
+ modprobe_acpiphp = yes
+ reference_cmd = lspci
+ find_pci_cmd = 'lspci | tail -n1'
+ images += " stg"
+ boot_drive_stg = no
+ image_name_stg = storage
+ image_size = 1G
+ force_create_image_stg = yes
+ seconds_wait_for_device_install = 3
+ pci_test_cmd = 'yes|mke2fs `fdisk -l 2>&1 |grep '/dev/[sv]d[a-z] doesn' | awk '{print $2}'`'
+ variants:
+ - block_virtio:
+ pci_model = virtio
+ match_string = "Virtio block device"
+ - block_scsi:
+ pci_model = scsi
+ match_string = "SCSI"
+ variants:
+ - fmt_qcow2:
+ image_format_stg = qcow2
+ - fmt_raw:
+ image_format_stg = raw
+
+
# NICs
variants:
- @rtl8139:
@@ -119,6 +166,10 @@ variants:
- Fedora:
no setup
ssh_prompt = "\[root@.{0,50}][\#\$] "
+ nic_hotplug:
+ modprobe_acpiphp = no
+ block_hotplug:
+ modprobe_acpiphp = no
variants:
- 8.32:
@@ -306,6 +357,22 @@ variants:
migration_test_command = ver && vol
stress_boot:
alive_test_cmd = systeminfo
+ nic_hotplug:
+ modprobe_acpiphp = no
+ reference_cmd = systeminfo
+ seconds_wait_for_device_install = 10
+ find_pci_cmd = ipconfig /all | find "Description"
+ nic_e1000:
+ match_string = "Intel(R) PRO/1000 MT Network Connection"
+ no nic_virtio
+ block_hotplug:
+ use_telnet = yes
+ modprobe_acpiphp = no
+ reference_cmd = wmic diskdrive
+ find_pci_cmd = wmic diskdrive | find "disk drives"
+ seconds_wait_for_device_install = 10
+ pci_test_cmd = echo select disk 1 > test.txt && echo detail disk >> test.txt && echo exit >> test.txt && diskpart /s test.txt
+ only block_scsi
variants:
- Win2000:
diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py
index 2d11fed..f4aa8e1 100644
--- a/client/tests/kvm/kvm_tests.py
+++ b/client/tests/kvm/kvm_tests.py
@@ -585,3 +585,101 @@ def run_stress_boot(tests, params, env):
for se in sessions:
se.close()
logging.info("Total number booted: %d" % (num -1))
+
+
+def run_pci_hotplug(test, params, env):
+ """
+ Test pci devices' hotplug
+ 1) pci_add a deivce (nic or storage)
+ 2) Compare 'info pci' output
+ 3) Compare 'reference_cmd' output
+ 4) Verify whether pci_model is shown in 'pci_find_cmd'
+ 5) Check whether the newly added pci device works fine
+ 6) pci_del the device, verify whether could remove the pci device
+
+ @param test: kvm test object
+ @param params: Dictionary with the test parameters
+ @param env: Dictionary with test environment.
+ """
+ vm = kvm_utils.env_get_vm(env, params.get("main_vm"))
+ if not vm:
+ raise error.TestError("VM object not found in environment")
+ if not vm.is_alive():
+ raise error.TestError("VM seems to be dead; Test requires a living VM")
+
+ logging.info("Waiting for guest to be up...")
+
+ session = kvm_utils.wait_for(vm.ssh_login, 240, 0, 2)
+ if not session:
+ raise error.TestFail("Could not log into guest")
+
+ logging.info("Logged in")
+
+ # modprobe the module that enable hotplug
+ if params.get("modprobe_acpiphp") == "yes":
+ if session.get_command_status("modprobe acpiphp"):
+ raise error.TestError("Modprobe module 'acpiphp' failed")
+
+ # get reference output
+ s, info_pci_ref = vm.send_monitor_cmd("info pci")
+
+ # compare the output
+ ref_cmd = params.get("reference_cmd")
+ reference = session.get_command_output(ref_cmd)
+
+ # implement pci hotplug
+ tested_model = params.get("pci_model")
+ logging.info("Testing hotplug pci device:%s" % tested_model)
+
+ test_type = params.get("pci_type")
+ if test_type == "nic":
+ pci_add_cmd = "pci_add pci_addr=auto nic model=%s" % tested_model
+
+ elif test_type == "block":
+ image_name = params.get("image_name_stg")
+ image_filename = "%s.%s" % (image_name, params.get("image_format_stg"))
+ image_dir = os.path.join(test.bindir, "images")
+ storage_name = os.path.join(image_dir, image_filename)
+ pci_add_cmd = ("pci_add pci_addr=auto storage file=%s,if=%s" %
+ (storage_name, tested_model))
+
+ s, add_output = vm.send_monitor_cmd(pci_add_cmd)
+ if not "OK domain" in add_output:
+ raise error.TestFail("Add device failed;Hypervisor command is: %s; "
+ "Output: %s" % (pci_add_cmd, add_output))
+
+ # compare the output of 'info pci'
+ s, after_add = vm.send_monitor_cmd("info pci")
+ if after_add == info_pci_ref:
+ raise error.TestFail("No new PCI device shown after executing "
+ "hypervisor command: 'info pci'")
+
+ time.sleep(int(params.get("seconds_wait_for_device_install")))
+
+ o = session.get_command_output(ref_cmd)
+ if reference == o:
+ raise error.TestFail("No new device shown in output of command \
+ executed in guest: %s" % ref_cmd)
+
+ cmd = params.get("find_pci_cmd")
+ output = session.get_command_output(cmd)
+ if not params.get("match_string") in output:
+ raise error.TestFail("Not found pci model:%s;Command is:%s;Output:%s" %
+ (tested_model, cmd, output))
+
+
+ # check whether VM's network & disk work fine
+ s, o = session.get_command_status_output(params.get("pci_test_cmd"))
+ if s:
+ raise error.TestFail("Check for %s device failed after PCI hotplug;"
+ "Output: %s" % (test_type, o))
+
+ # del pci device
+ slot_id = "0" + add_output.split(",")[2].split()[1]
+ cmd = "pci_del pci_addr=%s" % slot_id
+ s, after_del = vm.send_monitor_cmd(cmd)
+ if after_del == after_add:
+ raise error.TestFail("Failed to hot remove pci device:%s; "
+ "Hypervisor command: %s" % (tested_model, cmd))
+
+ session.close()
diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 503f636..95b55eb 100644
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -239,6 +239,8 @@ class VM:
for image_name in kvm_utils.get_sub_dict_names(params, "images"):
image_params = kvm_utils.get_sub_dict(params, image_name)
+ if image_params.get("boot_drive") == "no":
+ continue
qemu_cmd += " -drive file=%s" % get_image_filename(image_params,
image_dir)
if image_params.get("drive_format"):
--
1.6.2.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
2009-07-15 3:49 Yolkfull Chow
@ 2009-07-15 9:46 ` Yaniv Kaul
0 siblings, 0 replies; 8+ messages in thread
From: Yaniv Kaul @ 2009-07-15 9:46 UTC (permalink / raw)
To: Yolkfull Chow; +Cc: kvm, lmr, autotest
On 7/15/2009 6:49 AM, Yolkfull Chow wrote:
> This is a subtest in kvm. It will verify newly added pci block device now. For Windows support,it needs to use_telnet since 'wmic' which is used to check disk info could only be executed in telnet session not ssh. Just ran it on guest Fedora-11.32 and Windows2008.32, both passed:
>
> # ./scan_results.py
> test status seconds info
> ---- ------ ------- ----
> Fedora.11.32.nic_hotplug.nic_rtl8139 GOOD 68 completed successfully
> Fedora.11.32.nic_hotplug.nic_virtio GOOD 46 completed successfully
> Fedora.11.32.block_hotplug.fmt_qcow2.block_virtio GOOD 46 completed successfully
> Fedora.11.32.block_hotplug.fmt_qcow2.block_scsi GOOD 44 completed successfully
> Fedora.11.32.block_hotplug.fmt_raw.block_virtio GOOD 45 completed successfully
> Fedora.11.32.block_hotplug.fmt_raw.block_scsi GOOD 46 completed successfully
> Win2008.32.nic_hotplug.nic_rtl8139 GOOD 66 completed successfully
> Win2008.32.block_hotplug.fmt_qcow2.block_scsi GOOD 186 completed successfully
> Win2008.32.block_hotplug.fmt_raw.block_scsi GOOD 71 completed successfully
>
- Can you add virtio-net and virtio-blk to Windows 2008 as well?
- Where are you formating the disk on Windows?
- You need to check in virtio-net - that the adapter can send/receive
traffic after hot-plugging; in virtio-blk - that you can read from /
write to the disk.
Thanks,
Y.
>
>
> Signed-off-by: Yolkfull Chow<yzhou@redhat.com>
> ---
> client/tests/kvm/kvm.py | 1 +
> client/tests/kvm/kvm_tests.cfg.sample | 69 +++++++++++++++++++++++-
> client/tests/kvm/kvm_tests.py | 98 +++++++++++++++++++++++++++++++++
> client/tests/kvm/kvm_vm.py | 2 +
> 4 files changed, 169 insertions(+), 1 deletions(-)
>
> diff --git a/client/tests/kvm/kvm.py b/client/tests/kvm/kvm.py
> index b18b643..fc92e10 100644
> --- a/client/tests/kvm/kvm.py
> +++ b/client/tests/kvm/kvm.py
> @@ -55,6 +55,7 @@ class kvm(test.test):
> "kvm_install": test_routine("kvm_install", "run_kvm_install"),
> "linux_s3": test_routine("kvm_tests", "run_linux_s3"),
> "stress_boot": test_routine("kvm_tests", "run_stress_boot"),
> + "pci_hotplug": test_routine("kvm_tests", "run_pci_hotplug"),
> }
>
> # Make it possible to import modules from the test's bindir
> diff --git a/client/tests/kvm/kvm_tests.cfg.sample b/client/tests/kvm/kvm_tests.cfg.sample
> index 2f864de..7ec6f72 100644
> --- a/client/tests/kvm/kvm_tests.cfg.sample
> +++ b/client/tests/kvm/kvm_tests.cfg.sample
> @@ -91,9 +91,56 @@ variants:
>
> - stress_boot:
> type = stress_boot
> - max_vms = 5
> + max_vms = 5
> alive_test_cmd = ps aux
>
> +
> + - nic_hotplug:
> + type = pci_hotplug
> + pci_type = nic
> + modprobe_acpiphp = yes
> + reference_cmd = lspci
> + find_pci_cmd = 'lspci | tail -n1'
> + pci_test_cmd = 'nslookup www.redhat.com'
> + seconds_wait_for_device_install = 3
> + variants:
> + - nic_8139:
> + pci_model = rtl8139
> + match_string = "8139"
> + - nic_virtio:
> + pci_model = virtio
> + match_string = "Virtio network device"
> + - nic_e1000:
> + pci_model = e1000
> + match_string = "Gigabit Ethernet Controller"
> +
> + - block_hotplug:
> + type = pci_hotplug
> + pci_type = block
> + modprobe_acpiphp = yes
> + reference_cmd = lspci
> + find_pci_cmd = 'lspci | tail -n1'
> + images += " stg"
> + boot_drive_stg = no
> + image_name_stg = storage
> + image_size = 1G
> + force_create_image_stg = yes
> + seconds_wait_for_device_install = 3
> + pci_test_cmd = 'yes|mke2fs `fdisk -l 2>&1 |grep '/dev/[sv]d[a-z] doesn' | awk '{print $2}'`'
> + variants:
> + - block_virtio:
> + pci_model = virtio
> + match_string = "Virtio block device"
> + - block_scsi:
> + pci_model = scsi
> + match_string = "SCSI"
> + variants:
> + - fmt_qcow2:
> + image_format_stg = qcow2
> + - fmt_raw:
> + image_format_stg = raw
> +
> +
> # NICs
> variants:
> - @rtl8139:
> @@ -119,6 +166,10 @@ variants:
> - Fedora:
> no setup
> ssh_prompt = "\[root@.{0,50}][\#\$] "
> + nic_hotplug:
> + modprobe_acpiphp = no
> + block_hotplug:
> + modprobe_acpiphp = no
>
> variants:
> - 8.32:
> @@ -306,6 +357,22 @@ variants:
> migration_test_command = ver&& vol
> stress_boot:
> alive_test_cmd = systeminfo
> + nic_hotplug:
> + modprobe_acpiphp = no
> + reference_cmd = systeminfo
> + seconds_wait_for_device_install = 10
> + find_pci_cmd = ipconfig /all | find "Description"
> + nic_e1000:
> + match_string = "Intel(R) PRO/1000 MT Network Connection"
> + no nic_virtio
> + block_hotplug:
> + use_telnet = yes
> + modprobe_acpiphp = no
> + reference_cmd = wmic diskdrive
> + find_pci_cmd = wmic diskdrive | find "disk drives"
> + seconds_wait_for_device_install = 10
> + pci_test_cmd = echo select disk 1> test.txt&& echo detail disk>> test.txt&& echo exit>> test.txt&& diskpart /s test.txt
> + only block_scsi
>
> variants:
> - Win2000:
> diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py
> index 2d11fed..f4aa8e1 100644
> --- a/client/tests/kvm/kvm_tests.py
> +++ b/client/tests/kvm/kvm_tests.py
> @@ -585,3 +585,101 @@ def run_stress_boot(tests, params, env):
> for se in sessions:
> se.close()
> logging.info("Total number booted: %d" % (num -1))
> +
> +
> +def run_pci_hotplug(test, params, env):
> + """
> + Test pci devices' hotplug
> + 1) pci_add a deivce (nic or storage)
> + 2) Compare 'info pci' output
> + 3) Compare 'reference_cmd' output
> + 4) Verify whether pci_model is shown in 'pci_find_cmd'
> + 5) Check whether the newly added pci device works fine
> + 6) pci_del the device, verify whether could remove the pci device
> +
> + @param test: kvm test object
> + @param params: Dictionary with the test parameters
> + @param env: Dictionary with test environment.
> + """
> + vm = kvm_utils.env_get_vm(env, params.get("main_vm"))
> + if not vm:
> + raise error.TestError("VM object not found in environment")
> + if not vm.is_alive():
> + raise error.TestError("VM seems to be dead; Test requires a living VM")
> +
> + logging.info("Waiting for guest to be up...")
> +
> + session = kvm_utils.wait_for(vm.ssh_login, 240, 0, 2)
> + if not session:
> + raise error.TestFail("Could not log into guest")
> +
> + logging.info("Logged in")
> +
> + # modprobe the module that enable hotplug
> + if params.get("modprobe_acpiphp") == "yes":
> + if session.get_command_status("modprobe acpiphp"):
> + raise error.TestError("Modprobe module 'acpiphp' failed")
> +
> + # get reference output
> + s, info_pci_ref = vm.send_monitor_cmd("info pci")
> +
> + # compare the output
> + ref_cmd = params.get("reference_cmd")
> + reference = session.get_command_output(ref_cmd)
> +
> + # implement pci hotplug
> + tested_model = params.get("pci_model")
> + logging.info("Testing hotplug pci device:%s" % tested_model)
> +
> + test_type = params.get("pci_type")
> + if test_type == "nic":
> + pci_add_cmd = "pci_add pci_addr=auto nic model=%s" % tested_model
> +
> + elif test_type == "block":
> + image_name = params.get("image_name_stg")
> + image_filename = "%s.%s" % (image_name, params.get("image_format_stg"))
> + image_dir = os.path.join(test.bindir, "images")
> + storage_name = os.path.join(image_dir, image_filename)
> + pci_add_cmd = ("pci_add pci_addr=auto storage file=%s,if=%s" %
> + (storage_name, tested_model))
> +
> + s, add_output = vm.send_monitor_cmd(pci_add_cmd)
> + if not "OK domain" in add_output:
> + raise error.TestFail("Add device failed;Hypervisor command is: %s; "
> + "Output: %s" % (pci_add_cmd, add_output))
> +
> + # compare the output of 'info pci'
> + s, after_add = vm.send_monitor_cmd("info pci")
> + if after_add == info_pci_ref:
> + raise error.TestFail("No new PCI device shown after executing "
> + "hypervisor command: 'info pci'")
> +
> + time.sleep(int(params.get("seconds_wait_for_device_install")))
> +
> + o = session.get_command_output(ref_cmd)
> + if reference == o:
> + raise error.TestFail("No new device shown in output of command \
> + executed in guest: %s" % ref_cmd)
> +
> + cmd = params.get("find_pci_cmd")
> + output = session.get_command_output(cmd)
> + if not params.get("match_string") in output:
> + raise error.TestFail("Not found pci model:%s;Command is:%s;Output:%s" %
> + (tested_model, cmd, output))
> +
> +
> + # check whether VM's network& disk work fine
> + s, o = session.get_command_status_output(params.get("pci_test_cmd"))
> + if s:
> + raise error.TestFail("Check for %s device failed after PCI hotplug;"
> + "Output: %s" % (test_type, o))
> +
> + # del pci device
> + slot_id = "0" + add_output.split(",")[2].split()[1]
> + cmd = "pci_del pci_addr=%s" % slot_id
> + s, after_del = vm.send_monitor_cmd(cmd)
> + if after_del == after_add:
> + raise error.TestFail("Failed to hot remove pci device:%s; "
> + "Hypervisor command: %s" % (tested_model, cmd))
> +
> + session.close()
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index 503f636..95b55eb 100644
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -239,6 +239,8 @@ class VM:
>
> for image_name in kvm_utils.get_sub_dict_names(params, "images"):
> image_params = kvm_utils.get_sub_dict(params, image_name)
> + if image_params.get("boot_drive") == "no":
> + continue
> qemu_cmd += " -drive file=%s" % get_image_filename(image_params,
> image_dir)
> if image_params.get("drive_format"):
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
[not found] ` <20090721061121.GA5975@dhcp-66-70-57.nay.redhat.com>
@ 2009-07-21 7:45 ` Yaniv Kaul
2009-07-21 8:29 ` Yolkfull Chow
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Yaniv Kaul @ 2009-07-21 7:45 UTC (permalink / raw)
To: Yolkfull Chow; +Cc: kvm, lmr, autotest, Vadim Rozenfeld
On 7/21/2009 9:11 AM, Yolkfull Chow wrote:
<SNIP>
>
>>>
>>>
>>>>> Previously, I used 'create partition primary' to verify whether the disk could be formatted but always got an error:
>>>>> ---
>>>>> diskpart has encountered an error...
>>>>> ---
>>>>> And then I found the SCSI disk was added to Windows guest was read-only. So I changed the format command to be 'detail disk' temporarily.
>>>>>
>>>>>
>>>>>
>>>> Interesting - how did that happen? Lets see your command line, and
>>>> probably 'info block' from the monitor. Are you saying that hot-plugged
>>>> drives are added as r/o?
>>>>
>>>>
>>> I am afraid yes. After pci_add (monitor command: pci_add pci_addr=auto storage
>>> file=/tmp/stg.qcow2,if=scsi) the SCSI block device, 'info block' will
>>> show the scsi0-hd0 device is 'ro=0' whereas when I 'create partition
>>> primary' on this selected disk in diskpart tool, error message will be raised that the disk is
>>> write protected.
>>>
>>>
>> Well, that doesn't sound like the desired behavior. Work with the KVM
>> developers on this.
>>
> Hi Yaniv, following is the output from Windows guest:
>
> ---
> Microsoft DiskPart version 6.0.6001
> Copyright (C) 1999-2007 Microsoft Corporation.
> On computer: WIN-Q18A9GP5ECI
>
> Disk 1 is now the selected disk.
>
> DiskPart has encountered an error: The media is write protected.
> See the System Event Log for more information.
>
> Have you ever seen this error during format newly added SCSI block
> device?
>
> The contents of my diskpart script file:
> ---
> select disk 1
>
online
> create partition primary
> exit
> ---
>
>
I didn't use a script - nor have I ever hot-plugged a disk, but it does
seem to happen to me as well now - the 2nd disk (the first is IDE) is
indeed seems to be R/O.
I'll look into it.
>>
>>>
>>>
>>>> Also, you can always add an already formatted drive. Just create a qcow
>>>> drive in another instance, format it properly and use it.
>>>>
>>>>
>>>>
Any result with an already formatted drive?
Y.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
2009-07-21 7:45 ` [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS Yaniv Kaul
@ 2009-07-21 8:29 ` Yolkfull Chow
2009-07-21 9:01 ` Yolkfull Chow
2009-07-23 7:18 ` Yolkfull Chow
2 siblings, 0 replies; 8+ messages in thread
From: Yolkfull Chow @ 2009-07-21 8:29 UTC (permalink / raw)
To: Yaniv Kaul; +Cc: kvm, lmr, autotest, Vadim Rozenfeld
On Tue, Jul 21, 2009 at 10:45:31AM +0300, Yaniv Kaul wrote:
> On 7/21/2009 9:11 AM, Yolkfull Chow wrote:
>
> <SNIP>
>>
>>>>
>>>>
>>>>>> Previously, I used 'create partition primary' to verify whether the disk could be formatted but always got an error:
>>>>>> ---
>>>>>> diskpart has encountered an error...
>>>>>> ---
>>>>>> And then I found the SCSI disk was added to Windows guest was read-only. So I changed the format command to be 'detail disk' temporarily.
>>>>>>
>>>>>>
>>>>>>
>>>>> Interesting - how did that happen? Lets see your command line, and
>>>>> probably 'info block' from the monitor. Are you saying that hot-plugged
>>>>> drives are added as r/o?
>>>>>
>>>>>
>>>> I am afraid yes. After pci_add (monitor command: pci_add pci_addr=auto storage
>>>> file=/tmp/stg.qcow2,if=scsi) the SCSI block device, 'info block' will
>>>> show the scsi0-hd0 device is 'ro=0' whereas when I 'create partition
>>>> primary' on this selected disk in diskpart tool, error message will be raised that the disk is
>>>> write protected.
>>>>
>>>>
>>> Well, that doesn't sound like the desired behavior. Work with the KVM
>>> developers on this.
>>>
>> Hi Yaniv, following is the output from Windows guest:
>>
>> ---
>> Microsoft DiskPart version 6.0.6001
>> Copyright (C) 1999-2007 Microsoft Corporation.
>> On computer: WIN-Q18A9GP5ECI
>>
>> Disk 1 is now the selected disk.
>>
>> DiskPart has encountered an error: The media is write protected.
>> See the System Event Log for more information.
>>
>> Have you ever seen this error during format newly added SCSI block
>> device?
>>
>> The contents of my diskpart script file:
>> ---
>> select disk 1
>>
>
> online
>
>> create partition primary
>> exit
>> ---
>>
>>
> I didn't use a script - nor have I ever hot-plugged a disk, but it does
> seem to happen to me as well now - the 2nd disk (the first is IDE) is
> indeed seems to be R/O.
> I'll look into it.
>
>
>>>
>>>>
>>>>
>>>>> Also, you can always add an already formatted drive. Just create a qcow
>>>>> drive in another instance, format it properly and use it.
>>>>>
>>>>>
>>>>>
>
> Any result with an already formatted drive?
No, haven't got a chance to try that. :-(
> Y.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
2009-07-21 7:45 ` [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS Yaniv Kaul
2009-07-21 8:29 ` Yolkfull Chow
@ 2009-07-21 9:01 ` Yolkfull Chow
2009-07-23 7:18 ` Yolkfull Chow
2 siblings, 0 replies; 8+ messages in thread
From: Yolkfull Chow @ 2009-07-21 9:01 UTC (permalink / raw)
To: Yaniv Kaul; +Cc: kvm, lmr, autotest, Vadim Rozenfeld
On Tue, Jul 21, 2009 at 10:45:31AM +0300, Yaniv Kaul wrote:
> On 7/21/2009 9:11 AM, Yolkfull Chow wrote:
>
> <SNIP>
>>
>>>>
>>>>
>>>>>> Previously, I used 'create partition primary' to verify whether the disk could be formatted but always got an error:
>>>>>> ---
>>>>>> diskpart has encountered an error...
>>>>>> ---
>>>>>> And then I found the SCSI disk was added to Windows guest was read-only. So I changed the format command to be 'detail disk' temporarily.
>>>>>>
>>>>>>
>>>>>>
>>>>> Interesting - how did that happen? Lets see your command line, and
>>>>> probably 'info block' from the monitor. Are you saying that hot-plugged
>>>>> drives are added as r/o?
>>>>>
>>>>>
>>>> I am afraid yes. After pci_add (monitor command: pci_add pci_addr=auto storage
>>>> file=/tmp/stg.qcow2,if=scsi) the SCSI block device, 'info block' will
>>>> show the scsi0-hd0 device is 'ro=0' whereas when I 'create partition
>>>> primary' on this selected disk in diskpart tool, error message will be raised that the disk is
>>>> write protected.
>>>>
>>>>
>>> Well, that doesn't sound like the desired behavior. Work with the KVM
>>> developers on this.
>>>
>> Hi Yaniv, following is the output from Windows guest:
>>
>> ---
>> Microsoft DiskPart version 6.0.6001
>> Copyright (C) 1999-2007 Microsoft Corporation.
>> On computer: WIN-Q18A9GP5ECI
>>
>> Disk 1 is now the selected disk.
>>
>> DiskPart has encountered an error: The media is write protected.
>> See the System Event Log for more information.
>>
>> Have you ever seen this error during format newly added SCSI block
>> device?
>>
>> The contents of my diskpart script file:
>> ---
>> select disk 1
>>
>
> online
>
>> create partition primary
>> exit
>> ---
>>
>>
> I didn't use a script - nor have I ever hot-plugged a disk, but it does
> seem to happen to me as well now - the 2nd disk (the first is IDE) is
> indeed seems to be R/O.
> I'll look into it.
>
>
>>>
>>>>
>>>>
>>>>> Also, you can always add an already formatted drive. Just create a qcow
>>>>> drive in another instance, format it properly and use it.
>>>>>
>>>>>
>>>>>
>
> Any result with an already formatted drive?
I just tried, got same result -- write protected. Steps:
1. qemu-img create -f raw /tmp/stg.raw 1G
2. mkfs.vfat /tmp/stg.raw
3. hot_add the block device
4. diskpart to 'create partition primary' on the newly added disk
Did I make any mistake? Or I need also try to hot_add a drive which has
been installed an OS?
> Y.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
2009-07-21 7:45 ` [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS Yaniv Kaul
2009-07-21 8:29 ` Yolkfull Chow
2009-07-21 9:01 ` Yolkfull Chow
@ 2009-07-23 7:18 ` Yolkfull Chow
2009-07-28 5:03 ` [Autotest] " Lucas Meneghel Rodrigues
2 siblings, 1 reply; 8+ messages in thread
From: Yolkfull Chow @ 2009-07-23 7:18 UTC (permalink / raw)
To: lmr; +Cc: kvm, autotest, Vadim Rozenfeld
On Tue, Jul 21, 2009 at 10:45:31AM +0300, Yaniv Kaul wrote:
> On 7/21/2009 9:11 AM, Yolkfull Chow wrote:
>
> <SNIP>
>>
>>>>
>>>>
>>>>>> Previously, I used 'create partition primary' to verify whether the disk could be formatted but always got an error:
>>>>>> ---
>>>>>> diskpart has encountered an error...
>>>>>> ---
>>>>>> And then I found the SCSI disk was added to Windows guest was read-only. So I changed the format command to be 'detail disk' temporarily.
>>>>>>
>>>>>>
>>>>>>
>>>>> Interesting - how did that happen? Lets see your command line, and
>>>>> probably 'info block' from the monitor. Are you saying that hot-plugged
>>>>> drives are added as r/o?
>>>>>
>>>>>
>>>> I am afraid yes. After pci_add (monitor command: pci_add pci_addr=auto storage
>>>> file=/tmp/stg.qcow2,if=scsi) the SCSI block device, 'info block' will
>>>> show the scsi0-hd0 device is 'ro=0' whereas when I 'create partition
>>>> primary' on this selected disk in diskpart tool, error message will be raised that the disk is
>>>> write protected.
>>>>
>>>>
>>> Well, that doesn't sound like the desired behavior. Work with the KVM
>>> developers on this.
>>>
>> Hi Yaniv, following is the output from Windows guest:
>>
>> ---
>> Microsoft DiskPart version 6.0.6001
>> Copyright (C) 1999-2007 Microsoft Corporation.
>> On computer: WIN-Q18A9GP5ECI
>>
>> Disk 1 is now the selected disk.
>>
>> DiskPart has encountered an error: The media is write protected.
>> See the System Event Log for more information.
>>
>> Have you ever seen this error during format newly added SCSI block
>> device?
>>
>> The contents of my diskpart script file:
>> ---
>> select disk 1
>>
>
> online
>
>> create partition primary
>> exit
>> ---
>>
>>
> I didn't use a script - nor have I ever hot-plugged a disk, but it does
> seem to happen to me as well now - the 2nd disk (the first is IDE) is
> indeed seems to be R/O.
> I'll look into it.
Hi Lucas, did you notice this problem happened on Windows guest? What's
your opinion about the patch pci_hotplug,send or wait?
I think I can still send the patch for now, and just use 'detail disk' which doesn't format the newly added
disk in diskpart script. As soon as we have a solution, I can submit a
patch to fix it. Moreover, nic_virtio and block_virtio for Windows section will be
disabled in config file as well since both drivers don't work well now.
What do you think? Does anyone others has any suggestions/comments?
Thanks in advance. :-)
Regards,
Yolkfull
>
>
>>>
>>>>
>>>>
>>>>> Also, you can always add an already formatted drive. Just create a qcow
>>>>> drive in another instance, format it properly and use it.
>>>>>
>>>>>
>>>>>
>
> Any result with an already formatted drive?
> Y.
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Autotest] [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
2009-07-23 7:18 ` Yolkfull Chow
@ 2009-07-28 5:03 ` Lucas Meneghel Rodrigues
2009-07-28 9:01 ` Yolkfull Chow
0 siblings, 1 reply; 8+ messages in thread
From: Lucas Meneghel Rodrigues @ 2009-07-28 5:03 UTC (permalink / raw)
To: Yolkfull Chow; +Cc: autotest, Vadim Rozenfeld, kvm
On Thu, Jul 23, 2009 at 4:18 AM, Yolkfull Chow<yzhou@redhat.com> wrote:
>>> Hi Yaniv, following is the output from Windows guest:
>>>
>>> ---
>>> Microsoft DiskPart version 6.0.6001
>>> Copyright (C) 1999-2007 Microsoft Corporation.
>>> On computer: WIN-Q18A9GP5ECI
>>>
>>> Disk 1 is now the selected disk.
>>>
>>> DiskPart has encountered an error: The media is write protected.
>>> See the System Event Log for more information.
>>>
>>> Have you ever seen this error during format newly added SCSI block
>>> device?
>>>
>>> The contents of my diskpart script file:
>>> ---
>>> select disk 1
>>>
>>
>> online
>>
>>> create partition primary
>>> exit
>>> ---
>>>
>>>
>> I didn't use a script - nor have I ever hot-plugged a disk, but it does
>> seem to happen to me as well now - the 2nd disk (the first is IDE) is
>> indeed seems to be R/O.
>> I'll look into it.
>
> Hi Lucas, did you notice this problem happened on Windows guest? What's
> your opinion about the patch pci_hotplug,send or wait?
Hi Yolkfull, sorry for the delay answering. Yes, I did see the problem
on windows guests. About the test itself, it looks good and I am
making more tests before integrating it. Interestingly I tried it with
older fedora versions and lspci doesn't seem to be able to recognize
the newly added devices. High time we add step files and data for F10
and F11 on the default config file.
> I think I can still send the patch for now, and just use 'detail disk' which doesn't format the newly added
> disk in diskpart script. As soon as we have a solution, I can submit a
> patch to fix it. Moreover, nic_virtio and block_virtio for Windows section will be
> disabled in config file as well since both drivers don't work well now.
Ok, if you have an updated patch, please send it. Let's try to get all
the problems addressed as soon as possible.
Thanks for your work on this!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Autotest] [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS.
2009-07-28 5:03 ` [Autotest] " Lucas Meneghel Rodrigues
@ 2009-07-28 9:01 ` Yolkfull Chow
0 siblings, 0 replies; 8+ messages in thread
From: Yolkfull Chow @ 2009-07-28 9:01 UTC (permalink / raw)
To: Lucas Meneghel Rodrigues; +Cc: autotest, Vadim Rozenfeld, kvm
On Tue, Jul 28, 2009 at 02:03:10AM -0300, Lucas Meneghel Rodrigues wrote:
> On Thu, Jul 23, 2009 at 4:18 AM, Yolkfull Chow<yzhou@redhat.com> wrote:
> >>> Hi Yaniv, following is the output from Windows guest:
> >>>
> >>> ---
> >>> Microsoft DiskPart version 6.0.6001
> >>> Copyright (C) 1999-2007 Microsoft Corporation.
> >>> On computer: WIN-Q18A9GP5ECI
> >>>
> >>> Disk 1 is now the selected disk.
> >>>
> >>> DiskPart has encountered an error: The media is write protected.
> >>> See the System Event Log for more information.
> >>>
> >>> Have you ever seen this error during format newly added SCSI block
> >>> device?
> >>>
> >>> The contents of my diskpart script file:
> >>> ---
> >>> select disk 1
> >>>
> >>
> >> online
> >>
> >>> create partition primary
> >>> exit
> >>> ---
> >>>
> >>>
> >> I didn't use a script - nor have I ever hot-plugged a disk, but it does
> >> seem to happen to me as well now - the 2nd disk (the first is IDE) is
> >> indeed seems to be R/O.
> >> I'll look into it.
> >
> > Hi Lucas, did you notice this problem happened on Windows guest? What's
> > your opinion about the patch pci_hotplug,send or wait?
>
> Hi Yolkfull, sorry for the delay answering. Yes, I did see the problem
> on windows guests. About the test itself, it looks good and I am
> making more tests before integrating it. Interestingly I tried it with
> older fedora versions and lspci doesn't seem to be able to recognize
> the newly added devices. High time we add step files and data for F10
> and F11 on the default config file.
>
> > I think I can still send the patch for now, and just use 'detail disk' which doesn't format the newly added
> > disk in diskpart script. As soon as we have a solution, I can submit a
> > patch to fix it. Moreover, nic_virtio and block_virtio for Windows section will be
> > disabled in config file as well since both drivers don't work well now.
>
> Ok, if you have an updated patch, please send it. Let's try to get all
> the problems addressed as soon as possible.
>
> Thanks for your work on this!
Ok, I will post it here soon after I finish current case. Thanks, Lucas. :-)
Regards,
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-07-28 9:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1283926593.702711248067671557.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
[not found] ` <4A64032A.8090804@redhat.com>
[not found] ` <20090720070110.GA17650@aFu.nay.redhat.com>
[not found] ` <4A641AD4.2030502@redhat.com>
[not found] ` <20090721061121.GA5975@dhcp-66-70-57.nay.redhat.com>
2009-07-21 7:45 ` [PATCH] Add a kvm subtest -- pci_hotplug, which supports both Windows OS and Linux OS Yaniv Kaul
2009-07-21 8:29 ` Yolkfull Chow
2009-07-21 9:01 ` Yolkfull Chow
2009-07-23 7:18 ` Yolkfull Chow
2009-07-28 5:03 ` [Autotest] " Lucas Meneghel Rodrigues
2009-07-28 9:01 ` Yolkfull Chow
2009-07-15 3:49 Yolkfull Chow
2009-07-15 9:46 ` Yaniv Kaul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox